[pypy-commit] pypy stmgc-c7: Pass the tests
arigo
noreply at buildbot.pypy.org
Mon Apr 21 18:23:07 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r70815:cd1d172bfa05
Date: 2014-04-21 18:22 +0200
http://bitbucket.org/pypy/pypy/changeset/cd1d172bfa05/
Log: Pass the tests
diff --git a/rpython/jit/backend/llsupport/rewrite.py b/rpython/jit/backend/llsupport/rewrite.py
--- a/rpython/jit/backend/llsupport/rewrite.py
+++ b/rpython/jit/backend/llsupport/rewrite.py
@@ -229,8 +229,10 @@
args = [frame, arglist[jd.index_of_virtualizable]]
else:
args = [frame]
- self.newops.append(ResOperation(rop.CALL_ASSEMBLER, args,
- op.result, op.getdescr()))
+ op1 = ResOperation(rop.CALL_ASSEMBLER, args,
+ op.result, op.getdescr())
+ op1.stm_location = op.stm_location
+ self.newops.append(op1)
# ----------
@@ -406,29 +408,31 @@
def handle_write_barrier_setfield(self, op):
val = op.getarg(0)
if self.must_apply_write_barrier(val, op.getarg(1)):
- self.gen_write_barrier(val)
+ self.gen_write_barrier(val, op.stm_location)
self.newops.append(op)
def handle_write_barrier_setinteriorfield(self, op):
val = op.getarg(0)
if self.must_apply_write_barrier(val, op.getarg(2)):
- self.gen_write_barrier(val)
+ self.gen_write_barrier(val, op.stm_location)
self.newops.append(op)
def handle_write_barrier_setarrayitem(self, op):
val = op.getarg(0)
if self.must_apply_write_barrier(val, op.getarg(2)):
- self.gen_write_barrier_array(val, op.getarg(1))
+ self.gen_write_barrier_array(val, op.getarg(1), op.stm_location)
self.newops.append(op)
- def gen_write_barrier(self, v_base):
+ def gen_write_barrier(self, v_base, stm_location):
write_barrier_descr = self.gc_ll_descr.write_barrier_descr
args = [v_base]
- self.newops.append(ResOperation(rop.COND_CALL_GC_WB, args, None,
- descr=write_barrier_descr))
+ op = ResOperation(rop.COND_CALL_GC_WB, args, None,
+ descr=write_barrier_descr)
+ op.stm_location = stm_location
+ self.newops.append(op)
self.write_barrier_applied[v_base] = None
- def gen_write_barrier_array(self, v_base, v_index):
+ def gen_write_barrier_array(self, v_base, v_index, stm_location):
write_barrier_descr = self.gc_ll_descr.write_barrier_descr
if write_barrier_descr.has_write_barrier_from_array(self.cpu):
# If we know statically the length of 'v', and it is not too
@@ -439,14 +443,15 @@
if length >= LARGE:
# unknown or too big: produce a write_barrier_from_array
args = [v_base, v_index]
- self.newops.append(
- ResOperation(rop.COND_CALL_GC_WB_ARRAY, args, None,
- descr=write_barrier_descr))
+ op = ResOperation(rop.COND_CALL_GC_WB_ARRAY, args, None,
+ descr=write_barrier_descr)
+ op.stm_location = stm_location
+ self.newops.append(op)
# a WB_ARRAY is not enough to prevent any future write
# barriers, so don't add to 'write_barrier_applied'!
return
# fall-back case: produce a write_barrier
- self.gen_write_barrier(v_base)
+ self.gen_write_barrier(v_base, stm_location)
def round_up_for_allocation(self, size):
if not self.gc_ll_descr.round_up:
diff --git a/rpython/jit/backend/llsupport/stmrewrite.py b/rpython/jit/backend/llsupport/stmrewrite.py
--- a/rpython/jit/backend/llsupport/stmrewrite.py
+++ b/rpython/jit/backend/llsupport/stmrewrite.py
@@ -126,17 +126,19 @@
@specialize.arg(1)
- def _do_stm_call(self, funcname, args, result):
+ def _do_stm_call(self, funcname, args, result, stm_location):
addr = self.gc_ll_descr.get_malloc_fn_addr(funcname)
descr = getattr(self.gc_ll_descr, funcname + '_descr')
op1 = ResOperation(rop.CALL, [ConstInt(addr)] + args,
result, descr=descr)
+ op1.stm_location = stm_location
self.newops.append(op1)
def fallback_inevitable(self, op):
if not self.always_inevitable:
self.emitting_an_operation_that_can_collect()
- self._do_stm_call('stm_try_inevitable', [], None)
+ self._do_stm_call('stm_try_inevitable', [], None,
+ op.stm_location)
self.always_inevitable = True
self.newops.append(op)
debug_print("fallback for", op.repr())
@@ -153,5 +155,5 @@
def handle_setters_for_pure_fields(self, op, targetindex):
val = op.getarg(targetindex)
if self.must_apply_write_barrier(val):
- self.gen_write_barrier(val)
+ self.gen_write_barrier(val, op.stm_location)
self.newops.append(op)
More information about the pypy-commit
mailing list