Author: David Schneider <[email protected]>
Branch: jitframe-on-heap
Changeset: r60732:8b3593ba24a1
Date: 2013-01-30 15:55 +0100
http://bitbucket.org/pypy/pypy/changeset/8b3593ba24a1/
Log: merge
diff --git a/rpython/jit/backend/llsupport/gc.py
b/rpython/jit/backend/llsupport/gc.py
--- a/rpython/jit/backend/llsupport/gc.py
+++ b/rpython/jit/backend/llsupport/gc.py
@@ -139,7 +139,6 @@
""" Allocate a new frame, overwritten by tests
"""
frame = jitframe.JITFRAME.allocate(frame_info)
- llop.gc_assume_young_pointers(lltype.Void, frame)
return frame
class JitFrameDescrs:
diff --git a/rpython/jit/backend/llsupport/jitframe.py
b/rpython/jit/backend/llsupport/jitframe.py
--- a/rpython/jit/backend/llsupport/jitframe.py
+++ b/rpython/jit/backend/llsupport/jitframe.py
@@ -81,6 +81,7 @@
GCMAPLENGTHOFS = llmemory.arraylengthoffset(GCMAP)
GCMAPBASEOFS = llmemory.itemoffsetof(GCMAP, 0)
BASEITEMOFS = llmemory.itemoffsetof(JITFRAME.jf_frame, 0)
+LENGTHOFS = llmemory.arraylengthoffset(JITFRAME.jf_frame)
SIGN_SIZE = llmemory.sizeof(lltype.Signed)
UNSIGN_SIZE = llmemory.sizeof(lltype.Unsigned)
@@ -128,8 +129,12 @@
else:
new_state = 3 | ((state + 1) << 3) | (no << 9)
(obj_addr + getofs('jf_gc_trace_state')).signed[0] = new_state
+ index = no * SIZEOFSIGNED * 8 + state
+ # sanity check
+ frame_lgt = (obj_addr + getofs('jf_frame') + LENGTHOFS).signed[0]
+ ll_assert(index < frame_lgt, "bogus frame field get")
return (obj_addr + getofs('jf_frame') + BASEITEMOFS + SIGN_SIZE *
- (no * SIZEOFSIGNED * 8 + state))
+ (index))
no += 1
state = 0
return llmemory.NULL
diff --git a/rpython/jit/backend/llsupport/test/test_gc.py
b/rpython/jit/backend/llsupport/test/test_gc.py
--- a/rpython/jit/backend/llsupport/test/test_gc.py
+++ b/rpython/jit/backend/llsupport/test/test_gc.py
@@ -272,7 +272,7 @@
jitframe.BASEITEMOFS + jitframe.SIGN_SIZE * no)
frame_info = lltype.malloc(jitframe.JITFRAMEINFO, zero=True, flavor='raw')
- frame = lltype.malloc(jitframe.JITFRAME, 15, zero=True)
+ frame = lltype.malloc(jitframe.JITFRAME, 100, zero=True)
frame.jf_frame_info = frame_info
frame.jf_gcmap = lltype.malloc(jitframe.GCMAP, 2, flavor='raw')
if sys.maxint == 2**31 - 1:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit