[pypy-svn] r59468 - pypy/branch/oo-jit/pypy/jit/codegen/cli
antocuni at codespeak.net
antocuni at codespeak.net
Tue Oct 28 10:38:39 CET 2008
Author: antocuni
Date: Tue Oct 28 10:38:35 2008
New Revision: 59468
Modified:
pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py
pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
Log:
rename "JumpFromFlexSwitch" to "NonLocalJump", and rewrite it in a way that
should work for all jumps between methods, as it delegates everything to the
dispatch block
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/operation.py Tue Oct 28 10:38:35 2008
@@ -134,7 +134,7 @@
self.meth.il.Emit(OpCodes.Br, retlabel.il_label)
-class JumpFromFlexSwitch(Operation):
+class NonLocalJump(Operation):
def __init__(self, meth, target, args_gv):
self.meth = meth
@@ -151,7 +151,8 @@
graphinfo.args_manager.copy_to_inputargs(self.meth, self.args_gv)
block_id = self.target.block_id
il.Emit(OpCodes.Ldc_I4, intmask(block_id))
- il.Emit(OpCodes.Ret)
+ il.Emit(OpCodes.Stloc, self.meth.jumpto_var)
+ il.Emit(OpCodes.Br, self.meth.il_dispatch_block_label)
class Call(Operation):
Modified: pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py (original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/cli/rgenop.py Tue Oct 28 10:38:35 2008
@@ -694,7 +694,7 @@
def get_op_Return(self, gv_returnvar):
target = self.graphinfo.graph_retlabel
- return ops.JumpFromFlexSwitch(self, target, [gv_returnvar])
+ return ops.NonLocalJump(self, target, [gv_returnvar])
def emit_code(self):
MethodGenerator.emit_code(self)
@@ -735,6 +735,7 @@
il.Emit(OpCodes.Ldloc, self.jumpto_var)
il.Emit(OpCodes.Ret)
+
class BranchBuilder(GenBuilder):
def __init__(self, meth, il_label):
@@ -767,8 +768,8 @@
inputargs_gv, label.il_label)
else:
# jump from a flexswitch to the parent method
- op = ops.JumpFromFlexSwitch(self.meth, label,
- outputargs_gv)
+ op = ops.NonLocalJump(self.meth, label,
+ outputargs_gv)
self.appendop(op)
self.close()
More information about the Pypy-commit
mailing list