[pypy-svn] r22818 - pypy/dist/pypy/jit

pedronis at codespeak.net pedronis at codespeak.net
Sun Jan 29 11:37:41 CET 2006


Author: pedronis
Date: Sun Jan 29 11:37:40 2006
New Revision: 22818

Modified:
   pypy/dist/pypy/jit/hintmodel.py
Log:
some more array ops.



Modified: pypy/dist/pypy/jit/hintmodel.py
==============================================================================
--- pypy/dist/pypy/jit/hintmodel.py	(original)
+++ pypy/dist/pypy/jit/hintmodel.py	Sun Jan 29 11:37:40 2006
@@ -94,6 +94,16 @@
         else:
             return SomeLLAbstractVariable(FIELD_TYPE)
 
+    def getarrayitem(hs_c1, hs_index):
+        A = hs_c1.concretetype.TO
+        READ_TYPE = A.OF
+        if A._hints.get('immutable', False):
+            origin = getbookkeeper().myorigin()
+            origin.merge(hs_c1.origins)
+            return SomeLLAbstractConstant(READ_TYPE, {origin: True})
+        else:
+            return SomeLLAbstractVariable(READ_TYPE)
+
     def getsubstruct(hs_c1, hs_fieldname):
         S = hs_c1.concretetype.TO
         SUB_TYPE = getattr(S, hs_fieldname.const)
@@ -125,6 +135,8 @@
 
     getsubstruct = getfield
 
+    def getarrayitem(hs_a1, hs_index):
+        return hs_a1.contentdef.read_item()
 
 class __extend__(pairtype(SomeLLAbstractValue, SomeLLAbstractValue)):
 



More information about the Pypy-commit mailing list