[svn:parrot] r37897 - trunk/src/jit/i386

cotto at svn.parrot.org cotto at svn.parrot.org
Sat Apr 4 07:41:30 UTC 2009


Author: cotto
Date: Sat Apr  4 07:41:28 2009
New Revision: 37897
URL: https://trac.parrot.org/parrot/changeset/37897

Log:
[PMC] switch some jit code to use get_pointer, remove an obselete conditional compilation macro
tewk++ for the VTABLE jit code

Modified:
   trunk/src/jit/i386/jit_defs.c

Modified: trunk/src/jit/i386/jit_defs.c
==============================================================================
--- trunk/src/jit/i386/jit_defs.c	Sat Apr  4 05:46:37 2009	(r37896)
+++ trunk/src/jit/i386/jit_defs.c	Sat Apr  4 07:41:28 2009	(r37897)
@@ -11,6 +11,7 @@
 #include "parrot/hash.h"
 #include "parrot/oplib/ops.h"
 #include "pmc/pmc_fixedintegerarray.h"
+#include "pmc/pmc_unmanagedstruct.h"
 #include "jit.h"
 #include "jit_emit.h"
 
@@ -2234,25 +2235,17 @@
                 break;
             case 'p':   /* push pmc->data */
                 emitm_call_cfunc(pc, get_nci_P);
-#if ! PMC_DATA_IN_EXT
-                /* mov pmc, %edx
-                 * mov 8(%edx), %eax
-                 * push %eax
-                 */
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(struct PMC, data));
-#else
-                /* push pmc->pmc_ext->data
-                 * mov pmc, %edx
-                 * mov pmc_ext(%edx), %eax
-                 * mov data(%eax), %eax
-                 * push %eax
-                 */
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
-                               offsetof(struct PMC, pmc_ext));
-                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1,
-                               offsetof(struct PMC_EXT, data));
-#endif
+                /* save off PMC* */
+                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+                /* lookup get_pointer in VTABLE */
+                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable));
+                emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer));
+                emitm_callr(pc, emit_EAX);
                 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, args_offset);
+                /* reset ESP(4) */
+                emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);
+                emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4);
+
                 break;
             case 'O':   /* push PMC * object in P2 */
             case 'P':   /* push PMC * */
@@ -2403,16 +2396,8 @@
 
             /* eax = PMC, get return value into edx */
             /* stuff return value into pmc->data */
-
-#if ! PMC_DATA_IN_EXT
             /* mov %edx, (data) %eax */
             emitm_movl_r_m(interp, pc, emit_EDX, emit_EAX, 0, 1, offsetof(struct PMC, data));
-#else
-            /* mov pmc_ext(%eax), %eax
-               mov %edx, data(%eax) */
-            emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(struct PMC, pmc_ext));
-            emitm_movl_r_m(interp, pc, emit_EDX, emit_EAX, 0, 1, offsetof(struct PMC_EXT, data));
-#endif
 
             /* reset EBP(4) */
             emitm_lea_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, st_offset);


More information about the parrot-commits mailing list