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

pedronis at codespeak.net pedronis at codespeak.net
Sun Jan 29 11:58:22 CET 2006


Author: pedronis
Date: Sun Jan 29 11:58:21 2006
New Revision: 22822

Modified:
   pypy/dist/pypy/jit/hintmodel.py
Log:
(arre, pedronis)

more ops, also getarraysize on virtual arrays.



Modified: pypy/dist/pypy/jit/hintmodel.py
==============================================================================
--- pypy/dist/pypy/jit/hintmodel.py	(original)
+++ pypy/dist/pypy/jit/hintmodel.py	Sun Jan 29 11:58:21 2006
@@ -5,6 +5,7 @@
 
 UNARY_OPERATIONS = """same_as hint getfield setfield getsubstruct getarraysize getarrayitem
                       direct_call
+                      int_is_true int_neg
                       cast_char_to_int""".split()
 
 BINARY_OPERATIONS = """int_add int_sub int_mul int_and
@@ -127,10 +128,18 @@
         else:
             return hs_res # impossible value
 
-    def cast_char_to_int(hs_c1):
+    def int_neg(hs_c1):
         origin = getbookkeeper().myorigin()
         origin.merge(hs_c1.origins)
         return SomeLLAbstractConstant(lltype.Signed, {origin: True})
+
+    cast_char_to_int = int_neg
+
+    def int_is_true(hs_c1):
+        origin = getbookkeeper().myorigin()
+        origin.merge(hs_c1.origins)
+        return SomeLLAbstractConstant(lltype.Bool, {origin: True})
+    
         
 class __extend__(SomeLLAbstractContainer):
 
@@ -145,6 +154,10 @@
     def getarrayitem(hs_a1, hs_index):
         return hs_a1.contentdef.read_item()
 
+    def getarraysize(hs_a1):
+        origin = getbookkeeper().myorigin()
+        return SomeLLAbstractConstant(lltype.Signed, {origin: True})
+
 class __extend__(pairtype(SomeLLAbstractValue, SomeLLAbstractValue)):
 
     def int_add((hs_v1, hs_v2)):



More information about the Pypy-commit mailing list