[pypy-svn] r55519 - in pypy/branch/oo-jit/pypy/jit: codegen/llgraph rainbow/test

antocuni at codespeak.net antocuni at codespeak.net
Tue Jun 3 16:45:24 CEST 2008


Author: antocuni
Date: Tue Jun  3 16:45:23 2008
New Revision: 55519

Modified:
   pypy/branch/oo-jit/pypy/jit/codegen/llgraph/llimpl.py
   pypy/branch/oo-jit/pypy/jit/rainbow/test/test_portal.py
Log:
this is a terrible hack to make test_isinstance passing.  The comment
in llimpl.genconst() says that it should not be used for Void
constants, but it's very old (from r23049) and I'm not sure it's still
up to date.

Things seem to work, though.



Modified: pypy/branch/oo-jit/pypy/jit/codegen/llgraph/llimpl.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/llgraph/llimpl.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/llgraph/llimpl.py	Tue Jun  3 16:45:23 2008
@@ -238,6 +238,11 @@
     return lltype.typeOf(result)
 
 def genconst(llvalue):
+    # XXX: it conflicts with the comment below :-/
+    if isinstance(llvalue, lltype.LowLevelType):
+        v = flowmodel.Constant(llvalue)
+        v.concretetype = lltype.Void
+        return _to_opaque(v)
     T = lltype.typeOf(llvalue)
     T1 = lltype.erasedType(T)
     if T1 != T:
@@ -256,7 +261,9 @@
     return _to_opaque(c)
 
 def _generalcast(T, value):
-    if lltype.typeOf(value) == T:
+    if T is lltype.Void:
+        return value
+    elif lltype.typeOf(value) == T:
         return value
     elif isinstance(T, lltype.Ptr):
         return lltype.cast_pointer(T, value)

Modified: pypy/branch/oo-jit/pypy/jit/rainbow/test/test_portal.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/rainbow/test/test_portal.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/rainbow/test/test_portal.py	Tue Jun  3 16:45:23 2008
@@ -635,7 +635,6 @@
 
     test_method_call_promote = _skip
     test_float_promote = _skip
-    test_isinstance = _skip
     test_virt_obj_method_call_promote = _skip
     test_simple_recursive_portal_call_with_exc = _skip
 



More information about the Pypy-commit mailing list