[pypy-commit] pypy jitframe-on-heap: moar debugging

fijal noreply at buildbot.pypy.org
Wed Jan 23 21:33:10 CET 2013


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: jitframe-on-heap
Changeset: r60399:64b36a3ea02a
Date: 2013-01-23 22:32 +0200
http://bitbucket.org/pypy/pypy/changeset/64b36a3ea02a/

Log:	moar debugging

diff --git a/rpython/jit/backend/llsupport/llmodel.py b/rpython/jit/backend/llsupport/llmodel.py
--- a/rpython/jit/backend/llsupport/llmodel.py
+++ b/rpython/jit/backend/llsupport/llmodel.py
@@ -57,7 +57,11 @@
                                              llmemory.GCREF))
 
         def realloc_frame(frame, size, asm):
+            from rpython.rtyper.lltypesystem.ll2ctypes import _opaque_objs
+            from rpython.jit.backend.x86.assembler import all_clts
             frame = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, frame)
+            called_from_clt = all_clts[asm]
+            coming_from_loop = _opaque_objs[frame.jf_comingfrom._obj.intval // 2]
             if not frame.jf_frame_info.jfi_frame_depth >= size:
                 import pdb
                 pdb.set_trace()
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
@@ -33,6 +33,8 @@
 from rpython.rlib.rarithmetic import intmask, r_uint
 from rpython.rlib.objectmodel import compute_unique_id
 
+all_clts = []
+
 # darwin requires the stack to be 16 bytes aligned on calls. Same for gcc 4.5.0,
 # better safe than sorry
 CALL_ALIGN = 16 // WORD
@@ -686,9 +688,9 @@
         jg_location = mc.get_relative_pos()
         self.push_gcmap(mc, gcmap, mov=True)
         mc.MOV_si(WORD, 0xffffff)
-        gcref = cast_instance_to_gcref(self.current_clt)
-        mc.MOV_si(2*WORD, rffi.cast(lltype.Signed, gcref))
         ofs2 = mc.get_relative_pos() - 4
+        all_clts.append(self.current_clt)
+        mc.MOV_si(2*WORD, len(all_clts) - 1)
         mc.CALL(imm(self._stack_check_failure))
         # patch the JG above
         offset = mc.get_relative_pos() - jg_location


More information about the pypy-commit mailing list