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

antocuni at codespeak.net antocuni at codespeak.net
Thu Aug 27 23:57:55 CEST 2009


Author: antocuni
Date: Thu Aug 27 23:57:54 2009
New Revision: 67267

Modified:
   pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/optimizeopt.py
   pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/typesystem.py
Log:
get rid of is_oos in optimizeopt.py


Modified: pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/optimizeopt.py
==============================================================================
--- pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/optimizeopt.py	(original)
+++ pypy/branch/pyjitpl5-less-is_oo/pypy/jit/metainterp/optimizeopt.py	Thu Aug 27 23:57:54 2009
@@ -8,6 +8,7 @@
 from pypy.jit.metainterp.specnode import VirtualStructSpecNode
 from pypy.jit.metainterp.optimizeutil import av_newdict2, _findall, sort_descrs
 from pypy.jit.metainterp import resume, compile
+from pypy.jit.metainterp.typesystem import llhelper, oohelper
 from pypy.rlib.objectmodel import we_are_translated
 from pypy.rpython.lltypesystem import lltype
 
@@ -124,8 +125,8 @@
         self.box = box
 
 CVAL_ZERO    = ConstantValue(ConstInt(0))
-CVAL_NULLPTR = ConstantValue(ConstPtr(ConstPtr.value))
-CVAL_NULLOBJ = ConstantValue(ConstObj(ConstObj.value))
+llhelper.CVAL_NULLREF = ConstantValue(ConstPtr(ConstPtr.value))
+oohelper.CVAL_NULLREF = ConstantValue(ConstObj(ConstObj.value))
 
 
 class AbstractVirtualValue(OptValue):
@@ -399,10 +400,7 @@
         return value
 
     def new_ptr_box(self):
-        if not self.cpu.is_oo:
-            return BoxPtr()
-        else:
-            return BoxObj()
+        return self.cpu.ts.BoxRef()
 
     def new_box(self, fieldofs):
         if fieldofs.is_pointer_field():
@@ -412,10 +410,7 @@
 
     def new_const(self, fieldofs):
         if fieldofs.is_pointer_field():
-            if not self.cpu.is_oo:
-                return CVAL_NULLPTR
-            else:
-                return CVAL_NULLOBJ
+            return self.cpu.ts.CVAL_NULLREF
         else:
             return CVAL_ZERO
 
@@ -427,10 +422,7 @@
 
     def new_const_item(self, arraydescr):
         if arraydescr.is_array_of_pointers():
-            if not self.cpu.is_oo:
-                return CVAL_NULLPTR
-            else:
-                return CVAL_NULLOBJ
+            return self.cpu.ts.CVAL_NULLREF
         else:
             return CVAL_ZERO
 

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 23:57:54 2009
@@ -45,6 +45,7 @@
     BoxRef = history.BoxPtr
     ConstRef = history.ConstPtr
     loops_done_with_this_frame_ref = None # patched by compile.py
+    CVAL_NULLREF = None # patched by optimizeopt.py
 
     from pypy.rpython.lltypesystem.rvirtualizable2 import VABLERTIPTR as VABLERTI
     null_vable_rti = lltype.nullptr(VABLERTI.TO)
@@ -143,6 +144,7 @@
     BoxRef = history.BoxObj
     ConstRef = history.ConstObj
     loops_done_with_this_frame_ref = None # patched by compile.py
+    CVAL_NULLREF = None # patched by optimizeopt.py
     
     from pypy.rpython.ootypesystem.rvirtualizable2 import VABLERTI
     null_vable_rti = ootype.make_null_instance(VABLERTI)



More information about the Pypy-commit mailing list