[pypy-commit] pypy ppc-jit-backend: Allow ConstInt objects as parameters for FINISH instructions.
hager
noreply at buildbot.pypy.org
Thu Aug 11 11:15:30 CEST 2011
Author: hager <sven.hager at uni-duesseldorf.de>
Branch: ppc-jit-backend
Changeset: r46434:b7440ef162a5
Date: 2011-08-11 11:18 +0200
http://bitbucket.org/pypy/pypy/changeset/b7440ef162a5/
Log: Allow ConstInt objects as parameters for FINISH instructions.
diff --git a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
--- a/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
+++ b/pypy/jit/backend/ppc/ppcgen/ppc_assembler.py
@@ -972,14 +972,20 @@
cpu.patch_list.append((numops, fail_index, op, reglist))
def emit_finish(self, op, cpu):
+ from pypy.jit.metainterp.history import ConstInt, BoxInt
fail_index = len(cpu.saved_descr)
cpu.saved_descr[fail_index] = op.getdescr()
args = op.getarglist()
for index, arg in enumerate(args):
- regnum = cpu.reg_map[arg]
- addr = cpu.fail_boxes_int.get_addr_for_num(index)
- self.store_reg(regnum, addr)
+ if isinstance(arg, BoxInt):
+ regnum = cpu.reg_map[arg]
+ addr = cpu.fail_boxes_int.get_addr_for_num(index)
+ self.store_reg(regnum, addr)
+ elif isinstance(arg, ConstInt):
+ addr = cpu.fail_boxes_int.get_addr_for_num(index)
+ self.load_word(cpu.next_free_register, arg.value)
+ self.store_reg(cpu.next_free_register, addr)
self.load_word(3, 0)
self.blr()
More information about the pypy-commit
mailing list