[pypy-commit] pypy guard-compatible: use the new CPU interface
cfbolz
pypy.commits at gmail.com
Sun Mar 13 08:55:46 EDT 2016
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: guard-compatible
Changeset: r83009:d086871396dd
Date: 2016-03-13 13:54 +0100
http://bitbucket.org/pypy/pypy/changeset/d086871396dd/
Log: use the new CPU interface
diff --git a/rpython/jit/metainterp/compile.py b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -1089,7 +1089,6 @@
def __init__(self):
# XXX for now - in the end this would be in assembler
- self._checked_ptrs = []
self._compatibility_conditions = None
def handle_fail(self, deadframe, metainterp_sd, jitdriver_sd):
@@ -1099,30 +1098,16 @@
refval = metainterp_sd.cpu.get_value_direct(deadframe, 'r', index)
if self.is_compatible(metainterp_sd.cpu, refval):
from rpython.jit.metainterp.blackhole import resume_in_blackhole
- # next time it'll pass XXX use new cpu thingie here
- self._checked_ptrs.append(history.newconst(refval))
resume_in_blackhole(metainterp_sd, jitdriver_sd, self, deadframe)
else:
# a real failure
return ResumeGuardDescr.handle_fail(self, deadframe, metainterp_sd, jitdriver_sd)
- def fake_check_against_list(self, cpu, ref):
- # XXX should be in assembler
- const = history.newconst(ref)
- if self._compatibility_conditions:
- for i in range(len(self._checked_ptrs)):
- if const.same_constant(self._checked_ptrs[i]):
- return True
- return False
-
def is_compatible(self, cpu, ref):
const = history.newconst(ref)
if self._compatibility_conditions:
- for i in range(len(self._checked_ptrs)):
- if const.same_constant(self._checked_ptrs[i]):
- return True
if self._compatibility_conditions.check_compat(cpu, ref):
- self._checked_ptrs.append(const)
+ cpu.grow_guard_compatible_switch(self, ref)
return True
return False
return True # no conditions, everything works
More information about the pypy-commit
mailing list