[pypy-svn] r37410 - pypy/dist/pypy/jit/codegen/i386
arigo at codespeak.net
arigo at codespeak.net
Fri Jan 26 23:19:50 CET 2007
Author: arigo
Date: Fri Jan 26 23:19:47 2007
New Revision: 37410
Modified:
pypy/dist/pypy/jit/codegen/i386/operation.py
pypy/dist/pypy/jit/codegen/i386/regalloc.py
Log:
Another strange fix.
Modified: pypy/dist/pypy/jit/codegen/i386/operation.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/operation.py (original)
+++ pypy/dist/pypy/jit/codegen/i386/operation.py Fri Jan 26 23:19:47 2007
@@ -108,6 +108,8 @@
srcop = allocator.get_operand(self.x)
mc = allocator.mc
self.emit(mc, srcop)
+ def copy(self):
+ return self.__class__(self.x)
class OpIntIsTrue(OpCompare1):
opname = 'int_is_true', 'ptr_nonzero', 'uint_is_true'
@@ -431,6 +433,8 @@
except FailedToImplement:
mc.MOV(ecx, srcop)
mc.CMP(ecx, dstop)
+ def copy(self):
+ return self.__class__(self.x, self.y)
class OpIntLt(OpCompare2):
opname = 'int_lt', 'char_lt'
Modified: pypy/dist/pypy/jit/codegen/i386/regalloc.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/i386/regalloc.py (original)
+++ pypy/dist/pypy/jit/codegen/i386/regalloc.py Fri Jan 26 23:19:47 2007
@@ -78,11 +78,15 @@
def save_cc(self):
# we need a value to be in the CC, but we see a clobbering
# operation, so we copy the original CC-creating operation down
- # past the clobbering operation
+ # past the clobbering operation.
+ # <pedronis> completely obscure code
+ # <arigo> yes, well, needs very careful reviewing I guess :-)
v = self.need_var_in_cc
if not we_are_translated():
assert v in self.operations[:self.operationindex]
+ v = v.copy()
self.operations.insert(self.operationindex, v)
+ v.allocate(self)
self.need_var_in_cc = None
def using_cc(self, v):
More information about the Pypy-commit
mailing list