Author: leo
Date: Wed Oct 19 05:04:13 2005
New Revision: 9513

Modified:
   trunk/include/parrot/interpreter.h
   trunk/jit/ppc/jit_emit.h
Log:
Variable-sized reg frames 7 - permute struct parrot_regs_t

* swap register arrangement
* this can break (old) JIT code that still uses absolute addresses
  and calculates offsets relative to INT_REG(0), but then uses these
  as offsets relative to interpreter->ctx.bp 
* fix PPC for above problem


Modified: trunk/include/parrot/interpreter.h
==============================================================================
--- trunk/include/parrot/interpreter.h  (original)
+++ trunk/include/parrot/interpreter.h  Wed Oct 19 05:04:13 2005
@@ -163,10 +163,10 @@ struct _imc_info_t;
  * of a continuation by restoring the interpreter context.
  */
 struct parrot_regs_t {
-    struct IReg int_reg;
     struct NReg num_reg;
-    struct SReg string_reg;
+    struct IReg int_reg;
     struct PReg pmc_reg;
+    struct SReg string_reg;
 };
 
 typedef union {

Modified: trunk/jit/ppc/jit_emit.h
==============================================================================
--- trunk/jit/ppc/jit_emit.h    (original)
+++ trunk/jit/ppc/jit_emit.h    Wed Oct 19 05:04:13 2005
@@ -419,13 +419,15 @@ enum { JIT_PPC_CALL, JIT_PPC_BRANCH, JIT
 
 /* Load a CPU register from a Parrot register. */
 
+/* TODO use offsets directly - see also jit/i386 and src/jit.c JIT_USE_OFFS */
+
 #  define jit_emit_mov_rm_i(pc, reg, addr) \
     jit_emit_lwz(pc, reg, (((char *)addr) - \
-      ((char *)&REG_INT(0))), r13)
+      ((char *)interpreter->ctx.bp)), r13)
 
 #  define jit_emit_mov_rm_n(pc, reg, addr) \
     jit_emit_lfd(pc, reg, (((char *)addr) - \
-      ((char *)&REG_INT(0))), r13)
+      ((char *)interpreter->ctx.bp)), r13)
 
 /* compare operation.
  *
@@ -561,11 +563,11 @@ jit_emit_bx(Parrot_jit_info_t *jit_info,
 
 #  define jit_emit_mov_mr_i(pc, addr, reg) \
     jit_emit_stw(pc, reg, (((char *)addr) - \
-      ((char *)&REG_INT(0))), r13)
+      ((char *)interpreter->ctx.bp)), r13)
 
 #  define jit_emit_mov_mr_n(pc, addr, reg) \
     jit_emit_stfd(pc, reg, (((char *)addr) - \
-      ((char *)&REG_INT(0))), r13)
+      ((char *)interpreter->ctx.bp)), r13)
 
 
 /*

Reply via email to