Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r60324:ad3465ae1d6c
Date: 2013-01-22 00:02 +0200
http://bitbucket.org/pypy/pypy/changeset/ad3465ae1d6c/

Log:    fix a few bugs, took a while

diff --git a/rpython/jit/backend/x86/assembler.py 
b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -885,7 +885,8 @@
         # copy frame-info data
         old_fi = oldlooptoken.compiled_loop_token.frame_info
         new_fi = newlooptoken.compiled_loop_token.frame_info
-        old_fi.jfi_frame_depth = new_fi.jfi_frame_depth
+        old_fi.jfi_frame_depth = max(old_fi.jfi_frame_depth,
+                                     new_fi.jfi_frame_depth)
         mc = codebuf.MachineCodeBlockWrapper()
         mc.JMP(imm(target))
         if WORD == 4:         # keep in sync with prepare_loop()
@@ -2211,10 +2212,7 @@
         # we need to allocate the frame, keep in sync with runner's
         # execute_token
         jd = descr.outermost_jitdriver_sd
-        if jd.index_of_virtualizable >= 0:
-            vloc = stack(jd.index_of_virtualizable, REF)
-        else:
-            vloc = imm(0)
+        base_ofs = self.cpu.get_baseofs_of_frame_field()
         self._emit_call(imm(descr._x86_function_addr),
                         [argloc], 0, tmp=eax)
         if op.result is None:
@@ -2244,6 +2242,13 @@
         # Path A: use assembler_helper_adr
         assert jd is not None
         asm_helper_adr = self.cpu.cast_adr_to_int(jd.assembler_helper_adr)
+        if jd.index_of_virtualizable >= 0:
+            idx = jd.index_of_virtualizable + JITFRAME_FIXED_SIZE
+            self.mc.MOV(esi, mem(eax, base_ofs + idx * WORD))
+            vloc = esi
+        else:
+            vloc = imm(0)
+
         self._emit_call(imm(asm_helper_adr),
                         [eax, vloc], 0, tmp=ecx)
         if IS_X86_32 and isinstance(result_loc, StackLoc) and result_loc.type 
== FLOAT:
@@ -2264,7 +2269,7 @@
             assert isinstance(fielddescr, FieldDescr)
             vtoken_ofs = fielddescr.offset
             vable_ofs = (jd.index_of_virtualizable + JITFRAME_FIXED_SIZE) * 
WORD
-            self.mc.MOV_rb(edx.value, vable_ofs)
+            self.mc.MOV_rm(edx.value, (eax.value, vable_ofs))
             self.mc.MOV_mi((edx.value, vtoken_ofs), 0)
             # in the line above, TOKEN_NONE = 0
         #
diff --git a/rpython/jit/backend/x86/regalloc.py 
b/rpython/jit/backend/x86/regalloc.py
--- a/rpython/jit/backend/x86/regalloc.py
+++ b/rpython/jit/backend/x86/regalloc.py
@@ -1316,8 +1316,9 @@
             loc = self.loc(arg)
             assert loc is not ebp
             arglocs[i] = loc
-            if isinstance(loc, RegLoc):
-                self.fm.mark_as_free(arg)
+            # ARGH
+            #if isinstance(loc, RegLoc):
+            #    self.fm.mark_as_free(arg)
         #
         # if we are too close to the start of the loop, the label's target may
         # get overridden by redirect_call_assembler().  (rare case)
diff --git a/rpython/jit/metainterp/warmspot.py 
b/rpython/jit/metainterp/warmspot.py
--- a/rpython/jit/metainterp/warmspot.py
+++ b/rpython/jit/metainterp/warmspot.py
@@ -1,6 +1,6 @@
 import sys, py
 from rpython.tool.sourcetools import func_with_new_name
-from rpython.rtyper.lltypesystem import lltype, llmemory
+from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
 from rpython.rtyper.annlowlevel import llhelper, MixLevelHelperAnnotator,\
      cast_base_ptr_to_instance, hlstr
 from rpython.annotator import model as annmodel
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to