+2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
+
+ * mintops.def: rename the ICALL op codes to give a better
+ clue about their signature.
+
+ * transform.c (generate): use new ICALL types and add
+ a case for two args + a result
+
+ * interp.c (ves_exec_method_with_context): new ICALL
+ op codes.
+
2004-07-21 Bernie Solomon <bernard@ugsolutions.com>
* mintops.def: add MINT_DUP_VT
}
goto handle_finally;
MINT_IN_BREAK;
- MINT_IN_CASE(MINT_MONO_PROC1) {
- void (*func)(gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
+ MINT_IN_CASE(MINT_ICALL_P_V) {
+ void (*func)(gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
ip += 2;
func (sp [-1].data.p);
sp --;
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_MONO_CONV1) {
- gpointer (*func)(gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
+ MINT_IN_CASE(MINT_ICALL_P_P) {
+ gpointer (*func)(gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
ip += 2;
sp [-1].data.p = func (sp [-1].data.p);
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_MONO_CONV2) {
- void (*func)(gpointer,gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
+ MINT_IN_CASE(MINT_ICALL_PP_V) {
+ void (*func)(gpointer,gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
ip += 2;
sp -= 2;
func (sp [0].data.p, sp [1].data.p);
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_MONO_CONV3) {
- void (*func)(gpointer,gpointer,gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
+ MINT_IN_CASE(MINT_ICALL_PP_P) {
+ gpointer (*func)(gpointer,gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
+ ip += 2;
+ --sp;
+
+ sp [-1].data.p = func (sp [-1].data.p, sp [0].data.p);
+ MINT_IN_BREAK;
+ }
+ MINT_IN_CASE(MINT_ICALL_PPP_V) {
+ void (*func)(gpointer,gpointer,gpointer) = rtm->data_items [*(guint16 *)(ip + 1)];
ip += 2;
sp -= 3;
OPDEF(MINT_STRLEN, "strlen", 1, MintOpNoArgs)
OPDEF(MINT_ARRAY_RANK, "array_rank", 1, MintOpNoArgs)
-OPDEF(MINT_MONO_PROC1, "mono_proc1", 2, MintOpClassToken) /* not really */
-OPDEF(MINT_MONO_CONV1, "mono_conv1", 2, MintOpClassToken)
-OPDEF(MINT_MONO_CONV2, "mono_conv2", 2, MintOpClassToken)
-OPDEF(MINT_MONO_CONV3, "mono_conv3", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_P_V, "mono_icall_p_v", 2, MintOpClassToken) /* not really */
+OPDEF(MINT_ICALL_P_P, "mono_icall_p_p", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PP_V, "mono_icall_pp_v", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PP_P, "mono_icall_pp_p", 2, MintOpClassToken)
+OPDEF(MINT_ICALL_PPP_V, "mono_icall_ppp_v", 2, MintOpClassToken)
OPDEF(MINT_MONO_LDPTR, "mono_ldptr", 2, MintOpClassToken)
OPDEF(MINT_MONO_NEWOBJ, "mono_newobj", 2, MintOpClassToken)
OPDEF(MINT_MONO_RETOBJ, "mono_retobj", 1, MintOpNoArgs)
switch (info->sig->param_count) {
case 1:
if (MONO_TYPE_IS_VOID (info->sig->ret))
- ADD_CODE (&td,MINT_MONO_PROC1);
+ ADD_CODE (&td,MINT_ICALL_P_V);
else
- ADD_CODE (&td,MINT_MONO_CONV1);
+ ADD_CODE (&td,MINT_ICALL_P_P);
break;
case 2:
- ADD_CODE (&td,MINT_MONO_CONV2);
+ if (MONO_TYPE_IS_VOID (info->sig->ret))
+ ADD_CODE (&td,MINT_ICALL_PP_V);
+ else
+ ADD_CODE (&td,MINT_ICALL_PP_P);
break;
case 3:
- ADD_CODE (&td,MINT_MONO_CONV3);
+ g_assert (MONO_TYPE_IS_VOID (info->sig->ret));
+ ADD_CODE (&td,MINT_ICALL_PPP_V);
break;
default:
g_assert_not_reached ();