[pypy-svn] r51715 - in pypy/branch/jit-refactoring/pypy/jit/rainbow: . test

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Feb 21 11:20:54 CET 2008


Author: cfbolz
Date: Thu Feb 21 11:20:53 2008
New Revision: 51715

Modified:
   pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py
   pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
Log:
attach the RGenOp instance to the interpreter


Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/interpreter.py	Thu Feb 21 11:20:53 2008
@@ -48,13 +48,14 @@
 STOP = STOP()
 
 class JitInterpreter(object):
-    def __init__(self, exceptiondesc):
+    def __init__(self, exceptiondesc, RGenOp):
         self.exceptiondesc = exceptiondesc
         self.opcode_implementations = []
         self.opcode_descs = []
         self.opname_to_index = {}
         self.jitstate = None
         self.queue = None
+        self.rgenop = RGenOp()
         self._add_implemented_opcodes()
 
     def run(self, jitstate, bytecode, greenargs, redargs,
@@ -516,8 +517,7 @@
                     genconst = self.get_greenarg()
                     arg = genconst.revealconst(opdesc.ARGS[i])
                     args += (arg, )
-                rgenop = self.jitstate.curbuilder.rgenop
-                result = rgenop.genconst(opdesc.llop(*args))
+                result = self.rgenop.genconst(opdesc.llop(*args))
                 self.green_result(result)
         elif color == "red":
             if opdesc.nb_args == 1:

Modified: pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py
==============================================================================
--- pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py	(original)
+++ pypy/branch/jit-refactoring/pypy/jit/rainbow/test/test_interpreter.py	Thu Feb 21 11:20:53 2008
@@ -149,7 +149,7 @@
                                         ll_function.convert_arguments, values)]
         writer, jitcode, argcolors = self.serialize(ll_function, values,
                                                     **kwds)
-        rgenop = writer.RGenOp()
+        rgenop = writer.interpreter.rgenop
         sigtoken = rgenop.sigToken(self.RESIDUAL_FUNCTYPE)
         builder, gv_generated, inputargs_gv = rgenop.newgraph(sigtoken, "generated")
         builder.start_writing()



More information about the Pypy-commit mailing list