[pypy-svn] r67262 - pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp

antocuni at codespeak.net antocuni at codespeak.net
Thu Aug 27 22:19:05 CEST 2009


Author: antocuni
Date: Thu Aug 27 22:19:02 2009
New Revision: 67262

Modified:
   pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py
   pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/typesystem.py
Log:
unify loops_done_with_this_frame_{obj,ptr} and loops_exit_frame_with_exception_{obj,ptr}



Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py	(original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/compile.py	Thu Aug 27 22:19:02 2009
@@ -10,6 +10,7 @@
      Const
 from pypy.jit.metainterp import history
 from pypy.jit.metainterp.specnode import NotSpecNode
+from pypy.jit.metainterp.typesystem import llhelper, oohelper
 from pypy.rlib.debug import debug_print
 
 def compile_new_loop(metainterp, old_loops, greenkey, start=0):
@@ -191,17 +192,17 @@
 _loop.finishdescr = done_with_this_frame_descr_int
 loops_done_with_this_frame_int = [_loop]
 
-_loop = TerminatingLoop('done_with_this_frame_ptr')
+_loop = TerminatingLoop('done_with_this_frame_ref')
 _loop.specnodes = [prebuiltNotSpecNode]
 _loop.inputargs = [BoxPtr()]
 _loop.finishdescr = done_with_this_frame_descr_ref
-loops_done_with_this_frame_ptr = [_loop]
+llhelper.loops_done_with_this_frame_ref = [_loop]
 
-_loop = TerminatingLoop('done_with_this_frame_obj')
+_loop = TerminatingLoop('done_with_this_frame_ref')
 _loop.specnodes = [prebuiltNotSpecNode]
 _loop.inputargs = [BoxObj()]
 _loop.finishdescr = done_with_this_frame_descr_ref
-loops_done_with_this_frame_obj = [_loop]
+oohelper.loops_done_with_this_frame_ref = [_loop]
 
 _loop = TerminatingLoop('done_with_this_frame_void')
 _loop.specnodes = []
@@ -209,17 +210,17 @@
 _loop.finishdescr = done_with_this_frame_descr_void
 loops_done_with_this_frame_void = [_loop]
 
-_loop = TerminatingLoop('exit_frame_with_exception_ptr')
+_loop = TerminatingLoop('exit_frame_with_exception_ref')
 _loop.specnodes = [prebuiltNotSpecNode]
 _loop.inputargs = [BoxPtr()]
 _loop.finishdescr = exit_frame_with_exception_descr_ref
-loops_exit_frame_with_exception_ptr = [_loop]
+llhelper.loops_exit_frame_with_exception_ref = [_loop]
 
-_loop = TerminatingLoop('exit_frame_with_exception_obj')
+_loop = TerminatingLoop('exit_frame_with_exception_ref')
 _loop.specnodes = [prebuiltNotSpecNode]
 _loop.inputargs = [BoxObj()]
 _loop.finishdescr = exit_frame_with_exception_descr_ref
-loops_exit_frame_with_exception_obj = [_loop]
+oohelper.loops_exit_frame_with_exception_ref = [_loop]
 del _loop
 
 

Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/pyjitpl.py	Thu Aug 27 22:19:02 2009
@@ -1440,12 +1440,9 @@
         elif sd.result_type == 'int':
             exits = [exitbox]
             loops = compile.loops_done_with_this_frame_int
-        elif not sd.cpu.is_oo and sd.result_type == 'ref':
+        elif sd.result_type == 'ref':
             exits = [exitbox]
-            loops = compile.loops_done_with_this_frame_ptr
-        elif sd.cpu.is_oo and sd.result_type == 'ref':
-            exits = [exitbox]
-            loops = compile.loops_done_with_this_frame_obj
+            loops = sd.cpu.ts.loops_done_with_this_frame_ref
         else:
             assert False
         self.history.record(rop.JUMP, exits, None)
@@ -1456,10 +1453,7 @@
         self.gen_store_back_in_virtualizable()
         # temporarily put a JUMP to a pseudo-loop
         self.history.record(rop.JUMP, [valuebox], None)
-        if self.cpu.is_oo:
-            loops = compile.loops_exit_frame_with_exception_obj
-        else:
-            loops = compile.loops_exit_frame_with_exception_ptr
+        loops = self.cpu.ts.loops_exit_frame_with_exception_ref
         target_loop = compile.compile_new_bridge(self, loops, self.resumekey)
         assert target_loop is loops[0]
 

Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/typesystem.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/typesystem.py	(original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/typesystem.py	Thu Aug 27 22:19:02 2009
@@ -40,6 +40,7 @@
     BASETYPE = llmemory.GCREF
     BoxRef = history.BoxPtr
     ConstRef = history.ConstPtr
+    loops_done_with_this_frame_ref = None # patched by compile.py
 
     def new_ConstRef(self, x):
         ptrval = lltype.cast_opaque_ptr(llmemory.GCREF, x)
@@ -121,7 +122,8 @@
     BASETYPE = ootype.Object
     BoxRef = history.BoxObj
     ConstRef = history.ConstObj
-
+    loops_done_with_this_frame_ref = None # patched by compile.py
+    
     def new_ConstRef(self, x):
         obj = ootype.cast_to_object(x)
         return history.ConstObj(obj)



More information about the Pypy-commit mailing list