[svn:parrot] r39816 - in branches/context_pmc/lib/Parrot: OpTrans Ops2c
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sun Jun 28 17:38:34 UTC 2009
Author: whiteknight
Date: Sun Jun 28 17:38:34 2009
New Revision: 39816
URL: https://trac.parrot.org/parrot/changeset/39816
Log:
[context_pmc] a few more switchovers, especially dealing with ops. Doesn't work correctly, need to figure out what everything is expecting here. Also, may need to find a VTABLE-based method for getting constants
Modified:
branches/context_pmc/lib/Parrot/OpTrans/C.pm
branches/context_pmc/lib/Parrot/OpTrans/CGoto.pm
branches/context_pmc/lib/Parrot/OpTrans/Compiled.pm
branches/context_pmc/lib/Parrot/Ops2c/Utils.pm
Modified: branches/context_pmc/lib/Parrot/OpTrans/C.pm
==============================================================================
--- branches/context_pmc/lib/Parrot/OpTrans/C.pm Sun Jun 28 17:25:29 2009 (r39815)
+++ branches/context_pmc/lib/Parrot/OpTrans/C.pm Sun Jun 28 17:38:34 2009 (r39816)
@@ -54,11 +54,11 @@
#undef CONST
#define REL_PC ((size_t)(cur_opcode - (opcode_t *)interp->code->base.data))
#define CUR_OPCODE cur_opcode
-#define IREG(i) REG_INT(interp, cur_opcode[i])
-#define NREG(i) REG_NUM(interp, cur_opcode[i])
-#define PREG(i) REG_PMC(interp, cur_opcode[i])
-#define SREG(i) REG_STR(interp, cur_opcode[i])
-#define CONST(i) CONTEXT(interp)->constants[cur_opcode[i]]
+#define IREG(i) VTABLE_get_integer_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define NREG(i) VTABLE_get_number_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define PREG(i) VTABLE_get_pmc_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define SREG(i) VTABLE_get_string_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define CONST(i) PARROT_CONTEXT(CONTEXT(interp))->constants[cur_opcode[i]]
END
}
Modified: branches/context_pmc/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- branches/context_pmc/lib/Parrot/OpTrans/CGoto.pm Sun Jun 28 17:25:29 2009 (r39815)
+++ branches/context_pmc/lib/Parrot/OpTrans/CGoto.pm Sun Jun 28 17:38:34 2009 (r39816)
@@ -66,10 +66,10 @@
#undef CONST
#define REL_PC ((size_t)(cur_opcode - (opcode_t*)interp->code->base.data))
#define CUR_OPCODE cur_opcode
-#define IREG(i) REG_INT(interp, cur_opcode[i])
-#define NREG(i) REG_NUM(interp, cur_opcode[i])
-#define PREG(i) REG_PMC(interp, cur_opcode[i])
-#define SREG(i) REG_STR(interp, cur_opcode[i])
+#define IREG(i) VTABLE_get_integer_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define NREG(i) VTABLE_get_number_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define PREG(i) VTABLE_get_pmc_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
+#define SREG(i) VTABLE_get_string_keyed_int(interp, CONTEXT(interp), cur_opcode[i])
#define CONST(i) CONTEXT(interp)->constants[cur_opcode[i]]
END
}
Modified: branches/context_pmc/lib/Parrot/OpTrans/Compiled.pm
==============================================================================
--- branches/context_pmc/lib/Parrot/OpTrans/Compiled.pm Sun Jun 28 17:25:29 2009 (r39815)
+++ branches/context_pmc/lib/Parrot/OpTrans/Compiled.pm Sun Jun 28 17:38:34 2009 (r39816)
@@ -33,10 +33,10 @@
sub defines {
return <<END;
#define REL_PC (cur_opcode - start_code)
-#define IREG(i) REG_INT(interp, i)
-#define NREG(i) REG_NUM(interp, i)
-#define PREG(i) REG_PMC(interp, i)
-#define SREG(i) REG_STR(interp, i)
+#define IREG(i) VTABLE_get_integer_keyed_int(interp, CONTEXT(interp), i)
+#define NREG(i) VTABLE_get_number_keyed_int(interp, CONTEXT(interp), i)
+#define PREG(i) VTABLE_get_pmc_keyed_int(interp, CONTEXT(interp), i)
+#define SREG(i) VTABLE_get_string_keyed_int(interp, CONTEXT(interp), i)
#define CONST(i) interp->code->const_table->constants[i]
END
}
Modified: branches/context_pmc/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- branches/context_pmc/lib/Parrot/Ops2c/Utils.pm Sun Jun 28 17:25:29 2009 (r39815)
+++ branches/context_pmc/lib/Parrot/Ops2c/Utils.pm Sun Jun 28 17:38:34 2009 (r39816)
@@ -686,7 +686,7 @@
__asm__ ("jmp *4(%ebp)"); /* jump to ret addr, used by JIT */
# endif
#endif
- _reg_base = (char*)interp->ctx.bp.regs_i;
+ _reg_base = (char*)PARROT_CONTEXT(interp->ctx)->bp.regs_i;
goto **(void **)cur_opcode;
END_C
More information about the parrot-commits
mailing list