[pypy-svn] r67260 - pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp
antocuni at codespeak.net
antocuni at codespeak.net
Thu Aug 27 22:07:36 CEST 2009
Author: antocuni
Date: Thu Aug 27 22:07:35 2009
New Revision: 67260
Modified:
pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py
pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/history.py
Log:
unify Box.changevalue_{obj,ptr} and get rid of a couple of is_oo
Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py (original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py Thu Aug 27 22:07:35 2009
@@ -256,12 +256,9 @@
if isinstance(box, BoxInt):
srcvalue = cpu.get_latest_value_int(i)
box.changevalue_int(srcvalue)
- elif not cpu.is_oo and isinstance(box, BoxPtr):
+ elif isinstance(box, cpu.ts.BoxRef):
srcvalue = cpu.get_latest_value_ref(i)
- box.changevalue_ptr(srcvalue)
- elif cpu.is_oo and isinstance(box, BoxObj):
- srcvalue = cpu.get_latest_value_ref(i)
- box.changevalue_obj(srcvalue)
+ box.changevalue_ref(srcvalue)
elif isinstance(box, Const):
pass # we don't need to do anything
else:
@@ -274,12 +271,10 @@
dstbox = fail_op.args[i]
if isinstance(dstbox, BoxInt):
dstbox.changevalue_int(srcbox.getint())
- elif not metainterp_sd.cpu.is_oo and isinstance(dstbox, BoxPtr):
- dstbox.changevalue_ptr(srcbox.getref_base())
+ elif isinstance(dstbox, metainterp_sd.cpu.ts.BoxRef):
+ dstbox.changevalue_ref(srcbox.getref_base())
elif isinstance(dstbox, Const):
pass
- elif metainterp_sd.cpu.is_oo and isinstance(dstbox, BoxObj):
- dstbox.changevalue_obj(srcbox.getref_base())
else:
assert False
Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/history.py (original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/history.py Thu Aug 27 22:07:35 2009
@@ -503,10 +503,10 @@
return repr_rpython(self, 'bp')
def changevalue_box(self, srcbox):
- self.changevalue_ptr(srcbox.getref_base())
+ self.changevalue_ref(srcbox.getref_base())
_getrepr_ = repr_pointer
- changevalue_ptr = __init__
+ changevalue_ref = __init__
NULLBOX = BoxPtr()
@@ -548,10 +548,10 @@
return repr_rpython(self, 'bo')
def changevalue_box(self, srcbox):
- self.changevalue_obj(srcbox.getref_base())
+ self.changevalue_ref(srcbox.getref_base())
_getrepr_ = repr_object
- changevalue_obj = __init__
+ changevalue_ref = __init__
def set_future_values(cpu, boxes):
More information about the Pypy-commit
mailing list