[pypy-commit] pypy stmgc-c4: another fix
Raemi
noreply at buildbot.pypy.org
Fri Aug 9 15:25:35 CEST 2013
Author: Remi Meier <remi.meier at gmail.com>
Branch: stmgc-c4
Changeset: r66038:ffe6ff0ccf95
Date: 2013-08-09 15:24 +0200
http://bitbucket.org/pypy/pypy/changeset/ffe6ff0ccf95/
Log: another fix
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
@@ -2313,9 +2313,11 @@
def _stm_barrier_fastpath(self, mc, descr, arglocs, is_frame=False,
align_stack=False):
assert self.cpu.gc_ll_descr.stm
- #from rpython.jit.backend.llsupport.gc import (
- # STMBarrierDescr, STMReadBarrierDescr, STMWriteBarrierDescr)
- #assert isinstance(descr, STMBarrierDescr)
+ from rpython.jit.backend.llsupport.gc import (
+ STMBarrierDescr, STMReadBarrierDescr, STMWriteBarrierDescr)
+ if we_are_translated():
+ # tests use a a mock class, but translation needs it
+ assert isinstance(descr, STMBarrierDescr)
assert descr.returns_modified_object
loc_base = arglocs[0]
assert isinstance(loc_base, RegLoc)
diff --git a/rpython/jit/backend/x86/test/test_stm_integration.py b/rpython/jit/backend/x86/test/test_stm_integration.py
--- a/rpython/jit/backend/x86/test/test_stm_integration.py
+++ b/rpython/jit/backend/x86/test/test_stm_integration.py
@@ -58,16 +58,22 @@
# ____________________________________________________________
-def allocate_protected(TP, tid=123, n=1, zero=True):
+def allocate_protected(TP, n=1, zero=True, tid=124):
obj = lltype.malloc(TP, n=n, zero=zero)
- obj.h_tid = rffi.cast(lltype.Unsigned,
- StmGC.GCFLAG_OLD|StmGC.GCFLAG_WRITE_BARRIER | tid)
+ obj.h_tid = rffi.cast(lltype.Unsigned,
+ StmGC.GCFLAG_OLD|StmGC.GCFLAG_WRITE_BARRIER | tid)
obj.h_revision = rffi.cast(lltype.Signed, -sys.maxint)
return obj
+def allocate_prebuilt(TP, n=1, zero=True, tid=123):
+ obj = lltype.malloc(TP, n=n, zero=zero)
+ obj.h_tid = rffi.cast(lltype.Unsigned, StmGC.PREBUILT_FLAGS | tid)
+ obj.h_revision = rffi.cast(lltype.Signed, StmGC.PREBUILT_REVISION)
+ return obj
+
def jitframe_allocate(frame_info):
- frame = allocate_protected(JITFRAME,
- frame_info.jfi_frame_depth, zero=True)
+ frame = allocate_protected(JITFRAME, n=frame_info.jfi_frame_depth,
+ zero=True)
frame.jf_frame_info = frame_info
return frame
@@ -232,6 +238,7 @@
def test_read_barrier_fastpath(self):
cpu = self.cpu
+ cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
PRIV_REV = rffi.cast(lltype.Signed, StmGC.PREBUILT_REVISION)
self.priv_rev_num[0] = PRIV_REV
@@ -274,6 +281,7 @@
def test_write_barrier_fastpath(self):
cpu = self.cpu
+ cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
PRIV_REV = rffi.cast(lltype.Signed, StmGC.PREBUILT_REVISION)
self.priv_rev_num[0] = PRIV_REV
@@ -313,6 +321,7 @@
def test_ptr_eq_fastpath(self):
cpu = self.cpu
+ cpu.gc_ll_descr.init_nursery(100)
cpu.setup_once()
called_on = cpu.gc_ll_descr.ptr_eq_called_on
@@ -360,12 +369,12 @@
looptoken)
print c_loop
args = [s for i, s in enumerate((s1, s2))
- if not isinstance((p1, p2)[i], Const)] + [1]
+ if not isinstance((p1, p2)[i], Const)] + [7]
frame = self.cpu.execute_token(looptoken, *args)
frame = rffi.cast(JITFRAMEPTR, frame)
guard_failed = frame.jf_descr is not finaldescr
-
+
# CHECK:
a, b = s1, s2
if isinstance(p1, Const):
More information about the pypy-commit
mailing list