Author: Maciej Fijalkowski <[email protected]>
Branch: jitframe-on-heap
Changeset: r61740:6b58d4c57cd5
Date: 2013-02-24 20:18 +0200
http://bitbucket.org/pypy/pypy/changeset/6b58d4c57cd5/

Log:    merge

diff --git a/rpython/memory/gctransform/asmgcroot.py 
b/rpython/memory/gctransform/asmgcroot.py
--- a/rpython/memory/gctransform/asmgcroot.py
+++ b/rpython/memory/gctransform/asmgcroot.py
@@ -557,6 +557,7 @@
             pos = ~ pos     # can ignore this "range" marker here
         gccallshapes = llop.gc_asmgcroot_static(llmemory.Address, 2)
         self.addr = gccallshapes + pos
+        self.jit_index = -1
 
     def setjitframe(self, extra_stack_depth):
         self.addr = llmemory.NULL
@@ -564,9 +565,10 @@
         self.extra_stack_depth = extra_stack_depth
 
     def next(self):
-        addr = self.addr
-        if addr:
+        index = self.jit_index
+        if index < 0:
             # case "outside the jit"
+            addr = self.addr
             value = 0
             while True:
                 b = ord(addr.char[0])
@@ -581,7 +583,6 @@
             # case "in the jit"
             from rpython.jit.backend.x86.arch import FRAME_FIXED_SIZE
             from rpython.jit.backend.x86.arch import PASS_ON_MY_FRAME
-            index = self.jit_index
             self.jit_index = index + 1
             if index == 0:
                 # the jitframe is an object in EBP
diff --git a/rpython/rlib/_stacklet_asmgcc.py b/rpython/rlib/_stacklet_asmgcc.py
--- a/rpython/rlib/_stacklet_asmgcc.py
+++ b/rpython/rlib/_stacklet_asmgcc.py
@@ -77,15 +77,20 @@
                     callee = self.curframe
                     retaddraddr = self.translateptr(callee.frame_address)
                     retaddr = retaddraddr.address[0]
-                    basewalker.locate_caller_based_on_retaddr(retaddr)
+                    ebp_in_caller = callee.regs_stored_at[INDEX_OF_EBP]
+                    ebp_in_caller = self.translateptr(ebp_in_caller)
+                    ebp_in_caller = ebp_in_caller.address[0]
+                    basewalker.locate_caller_based_on_retaddr(retaddr,
+                                                              ebp_in_caller)
                     self.enumerating = True
+                else:
+                    callee = self.curframe
+                    ebp_in_caller = callee.regs_stored_at[INDEX_OF_EBP]
+                    ebp_in_caller = self.translateptr(ebp_in_caller)
+                    ebp_in_caller = ebp_in_caller.address[0]
                 #
                 # not really a loop, but kept this way for similarity
                 # with asmgcroot:
-                callee = self.curframe
-                ebp_in_caller = callee.regs_stored_at[INDEX_OF_EBP]
-                ebp_in_caller = self.translateptr(ebp_in_caller)
-                ebp_in_caller = ebp_in_caller.address[0]
                 while True:
                     location = basewalker._shape_decompressor.next()
                     if location == 0:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to