[pypy-svn] r77377 - pypy/branch/jit-str/pypy/jit/metainterp/optimizeopt

arigo at codespeak.net arigo at codespeak.net
Sun Sep 26 14:00:53 CEST 2010


Author: arigo
Date: Sun Sep 26 14:00:52 2010
New Revision: 77377

Modified:
   pypy/branch/jit-str/pypy/jit/metainterp/optimizeopt/string.py
Log:
Fix annotation: the _attrs_ forces the attributes to be known, even in examples
where we never instantiate the classes.


Modified: pypy/branch/jit-str/pypy/jit/metainterp/optimizeopt/string.py
==============================================================================
--- pypy/branch/jit-str/pypy/jit/metainterp/optimizeopt/string.py	(original)
+++ pypy/branch/jit-str/pypy/jit/metainterp/optimizeopt/string.py	Sun Sep 26 14:00:52 2010
@@ -11,7 +11,6 @@
 from pypy.jit.codewriter.effectinfo import EffectInfo, callinfo_for_oopspec
 from pypy.jit.codewriter import heaptracker
 from pypy.rlib.unroll import unrolling_iterable
-from pypy.rlib.objectmodel import missing_value
 
 
 class __extend__(optimizer.OptValue):
@@ -48,6 +47,7 @@
 
 
 class VAbstractStringValue(virtualize.AbstractVirtualValue):
+    _attrs_ = ()
 
     def _really_force(self):
         s = self.get_constant_string()
@@ -155,7 +155,7 @@
 
 class VStringSliceValue(VAbstractStringValue):
     """A slice."""
-    vstr = vstart = vlength = missing_value     # annotator fix
+    _attrs_ = ('vstr', 'vstart', 'vlength')
 
     def setup(self, vstr, vstart, vlength):
         self.vstr = vstr



More information about the Pypy-commit mailing list