[pypy-svn] r49973 - in pypy/dist/pypy/jit/hintannotator: . test

antocuni at codespeak.net antocuni at codespeak.net
Fri Dec 21 10:46:22 CET 2007


Author: antocuni
Date: Fri Dec 21 10:46:21 2007
New Revision: 49973

Modified:
   pypy/dist/pypy/jit/hintannotator/bookkeeper.py
   pypy/dist/pypy/jit/hintannotator/model.py
   pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
Log:
deepfreeze oodowncast, ooupcast, and null constant pointers



Modified: pypy/dist/pypy/jit/hintannotator/bookkeeper.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator/bookkeeper.py	(original)
+++ pypy/dist/pypy/jit/hintannotator/bookkeeper.py	Fri Dec 21 10:46:21 2007
@@ -6,6 +6,7 @@
 from pypy.objspace.flow.model import Variable, Block, Link, FunctionGraph
 from pypy.annotation import model as annmodel
 from pypy.rpython.lltypesystem import lltype, lloperation
+from pypy.rpython.ootypesystem import ootype
 from pypy.tool.algo.unionfind import UnionFind
 from pypy.translator.backendopt import graphanalyze
 from pypy.translator.unsimplify import copyvar
@@ -291,7 +292,10 @@
         res = hintmodel.SomeLLAbstractConstant(const.concretetype, {})
         res.const = const.value
         # we want null pointers to be deepfrozen!
-        if isinstance(const.concretetype, lltype.Ptr):
+        if isinstance(const.concretetype, (lltype.Ptr,
+                                           ootype.Instance,
+                                           ootype.BuiltinType,
+                                           ootype.StaticMethod)):
             if not const.value:
                 res.deepfrozen = True
         return res

Modified: pypy/dist/pypy/jit/hintannotator/model.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator/model.py	(original)
+++ pypy/dist/pypy/jit/hintannotator/model.py	Fri Dec 21 10:46:21 2007
@@ -410,6 +410,9 @@
         RESTYPE = getbookkeeper().current_op_concretetype()
         return SomeLLAbstractVariable(RESTYPE, hs_v1.deepfrozen)
 
+    ooupcast = cast_pointer
+    oodowncast = cast_pointer
+
     def indirect_call(hs_v1, *args_hs):
         hs_graph_list = args_hs[-1]
         args_hs = args_hs[:-1]
@@ -566,6 +569,8 @@
                                       myorigin = origin,
                                       deepfrozen = hs_c1.deepfrozen)
 
+    ooupcast = cast_pointer
+    oodowncast = cast_pointer
 
 class __extend__(SomeLLAbstractContainer):
 

Modified: pypy/dist/pypy/jit/hintannotator/test/test_annotator.py
==============================================================================
--- pypy/dist/pypy/jit/hintannotator/test/test_annotator.py	(original)
+++ pypy/dist/pypy/jit/hintannotator/test/test_annotator.py	Fri Dec 21 10:46:21 2007
@@ -1106,7 +1106,6 @@
 
     # these tests fail because of deepfreeze
     test_specialize_deepfreeze_calls = skip_policy
-    test_cast_pointer_keeps_deepfreeze = skip_policy
 
     def test_void_oosend(self):
         class Foo:



More information about the Pypy-commit mailing list