[pypy-svn] r79839 - in pypy/trunk/pypy/jit/codewriter: . test
arigo at codespeak.net
arigo at codespeak.net
Mon Dec 6 11:01:56 CET 2010
Author: arigo
Date: Mon Dec 6 11:01:54 2010
New Revision: 79839
Modified:
pypy/trunk/pypy/jit/codewriter/regalloc.py
pypy/trunk/pypy/jit/codewriter/test/test_regalloc.py
Log:
Very minor test and fix: if an operation produces an unused result, it remains
accidentally occupying a variable until the end of the block.
Modified: pypy/trunk/pypy/jit/codewriter/regalloc.py
==============================================================================
--- pypy/trunk/pypy/jit/codewriter/regalloc.py (original)
+++ pypy/trunk/pypy/jit/codewriter/regalloc.py Mon Dec 6 11:01:54 2010
@@ -36,7 +36,7 @@
if isinstance(v1, Variable):
die_at[v1] = i
if op.result is not None:
- die_at[op.result] = i
+ die_at[op.result] = i + 1
if isinstance(block.exitswitch, tuple):
for x in block.exitswitch:
die_at.pop(x, None)
Modified: pypy/trunk/pypy/jit/codewriter/test/test_regalloc.py
==============================================================================
--- pypy/trunk/pypy/jit/codewriter/test/test_regalloc.py (original)
+++ pypy/trunk/pypy/jit/codewriter/test/test_regalloc.py Mon Dec 6 11:01:54 2010
@@ -281,22 +281,22 @@
# this used to produce bogus code, containing these two
# lines in the following broken order:
# last_exc_value -> %r0
- # ref_copy %r0 -> %r2 -- but expect to read the old value of %r0!
+ # ref_copy %r0 -> %r1 -- but expect to read the old value of %r0!
self.check_assembler(graph, """
residual_call_r_r $<* fn bar>, <Descr>, R[%r0] -> %r1
-live-
- residual_call_ir_r $<* fn g>, <Descr>, I[%i0], R[] -> %r2
+ residual_call_ir_r $<* fn g>, <Descr>, I[%i0], R[] -> %r1
-live-
catch_exception L1
- ref_return %r2
+ ref_return %r1
---
L1:
goto_if_exception_mismatch $<* struct object_vtable>, L2
- ref_copy %r0 -> %r2
+ ref_copy %r0 -> %r1
last_exc_value -> %r0
residual_call_r_r $<* fn foo>, <Descr>, R[%r0] -> %r0
-live-
- ref_return %r2
+ ref_return %r1
---
L2:
reraise
More information about the Pypy-commit
mailing list