2010-02-10 Miguel de Icaza <miguel@novell.com>
[mono.git] / mono / mini / mini-ops.h
index b23d8bf1d2be77997fbd6be7707f877f535b4808..2f76fd211fa16319660994a330e9ebcb0ef91718 100644 (file)
@@ -17,7 +17,6 @@ MINI_OP(OP_ICOMPARE_IMM,      "icompare_imm", NONE, IREG, NONE)
 MINI_OP(OP_LCOMPARE_IMM,       "lcompare_imm", NONE, LREG, NONE)
 MINI_OP(OP_LOCAL,      "local", NONE, NONE, NONE)
 MINI_OP(OP_ARG,                "arg", NONE, NONE, NONE)
-MINI_OP(OP_ARGLIST,    "oparglist", NONE, IREG, NONE)
 MINI_OP(OP_OUTARG_VT,  "outarg_vt", NONE, VREG, NONE)
 MINI_OP(OP_OUTARG_VTRETADDR, "outarg_vtretaddr", IREG, NONE, NONE)
 MINI_OP(OP_SETRET,     "setret", NONE, IREG, NONE)
@@ -26,6 +25,8 @@ MINI_OP(OP_SETLRET,   "setlret", NONE, IREG, IREG)
 MINI_OP(OP_LOCALLOC, "localloc", IREG, IREG, NONE)
 MINI_OP(OP_LOCALLOC_IMM, "localloc_imm", IREG, NONE, NONE)
 MINI_OP(OP_CHECK_THIS, "checkthis", NONE, IREG, NONE)
+MINI_OP(OP_SEQ_POINT, "seq_point", NONE, NONE, NONE)
+MINI_OP(OP_IMPLICIT_EXCEPTION, "implicit_exception", NONE, NONE, NONE)
 
 MINI_OP(OP_VOIDCALL,   "voidcall", NONE, NONE, NONE)
 MINI_OP(OP_VOIDCALLVIRT,       "voidcallvirt", NONE, NONE, NONE)
@@ -65,6 +66,23 @@ MINI_OP(OP_SWITCH,  "switch", NONE, IREG, NONE)
 MINI_OP(OP_THROW, "throw", NONE, IREG, NONE)
 MINI_OP(OP_RETHROW,    "rethrow", NONE, IREG, NONE)
 
+/*
+ * Vararg calls are implemented as follows:
+ * - the caller emits a hidden argument just before the varargs argument. this
+ *   'signature cookie' argument contains the signature describing the the call.
+ * - all implicit arguments are passed in memory right after the signature cookie, i.e.
+ *   the stack will look like this:
+ *   <argn>
+ *   ..
+ *   <arg1>
+ *   <sig cookie>
+ * - the OP_ARGLIST opcode in the callee computes the address of the sig cookie argument
+ *   on the stack and saves it into its sreg1.
+ * - mono_ArgIterator_Setup receives this value and uses it to find the signature and
+ *   the arguments.
+ */
+MINI_OP(OP_ARGLIST,    "oparglist", NONE, IREG, NONE)
+
 /* MONO_IS_STORE_MEMBASE depends on the order here */
 MINI_OP(OP_STORE_MEMBASE_REG,"store_membase_reg", IREG, IREG, NONE)
 MINI_OP(OP_STOREI1_MEMBASE_REG, "storei1_membase_reg", IREG, IREG, NONE)