[pypy-svn] r66461 - pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Mon Jul 20 23:13:51 CEST 2009


Author: arigo
Date: Mon Jul 20 23:13:50 2009
New Revision: 66461

Modified:
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/history.py
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py
Log:
Implement NEW_WITH_VTABLE again.


Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/history.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/history.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/history.py	Mon Jul 20 23:13:50 2009
@@ -317,8 +317,6 @@
     def repr_rpython(self):
         return repr_rpython(self, 'cp')
 
-CONST_NULL = ConstPtr(ConstPtr.value)
-
 class ConstObj(Const):
     type = OBJ
     value = ootype.NULL
@@ -362,8 +360,6 @@
     def repr_rpython(self):
         return repr_rpython(self, 'co')
 
-CONST_NULL_OBJ = ConstObj(ConstObj.value)
-
 class Box(AbstractValue):
     __slots__ = ()
     _extended_display = True

Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py	Mon Jul 20 23:13:50 2009
@@ -1,5 +1,5 @@
-from pypy.jit.metainterp.history import Const, Box, BoxInt, BoxPtr, BoxObj
-from pypy.jit.metainterp import history
+from pypy.jit.metainterp.history import Box, BoxInt, BoxPtr, BoxObj
+from pypy.jit.metainterp.history import Const, ConstInt, ConstPtr, ConstObj
 from pypy.jit.metainterp.resoperation import rop, ResOperation
 from pypy.jit.metainterp.specnode import SpecNode
 from pypy.jit.metainterp.specnode import VirtualInstanceSpecNode
@@ -77,6 +77,10 @@
     def __init__(self, box):
         self.box = box
 
+CVAL_ZERO    = ConstantValue(ConstInt(0))
+CVAL_NULLPTR = ConstantValue(ConstPtr(ConstPtr.value))
+CVAL_NULLOBJ = ConstantValue(ConstObj(ConstObj.value))
+
 
 class VirtualValue(InstanceValue):
     box = None
@@ -98,7 +102,7 @@
     def force_box(self):
         if self.box is None:
             optimizer = self.optimizer
-            xxxx
+            import py; py.test.skip("in-progress")
         return self.box
 
 
@@ -171,11 +175,11 @@
     def new_const(self, fieldofs):
         if fieldofs.is_pointer_field():
             if not self.cpu.is_oo:
-                return history.CONST_NULL
+                return CVAL_NULLPTR
             else:
-                return history.CONST_NULL_OBJ
+                return CVAL_NULLOBJ
         else:
-            return history.CONST_FALSE
+            return CVAL_ZERO
 
     # ----------
 
@@ -329,7 +333,7 @@
             self.optimize_default(op)
 
     def optimize_NEW_WITH_VTABLE(self, op):
-        import py; py.test.skip("in-progress")
+        self.make_virtual(op.result)
 
 
 optimize_ops = _findall(Optimizer, 'optimize_')



More information about the Pypy-commit mailing list