[pypy-commit] pypy default: More jittest-ability.

arigo noreply at buildbot.pypy.org
Tue Jan 21 16:19:32 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r68816:1ae31b6d89d1
Date: 2014-01-21 16:18 +0100
http://bitbucket.org/pypy/pypy/changeset/1ae31b6d89d1/

Log:	More jittest-ability.

diff --git a/rpython/jit/backend/llgraph/support.py b/rpython/jit/backend/llgraph/support.py
--- a/rpython/jit/backend/llgraph/support.py
+++ b/rpython/jit/backend/llgraph/support.py
@@ -67,10 +67,11 @@
     if isinstance(TYPE, lltype.Ptr):
         if isinstance(x, (int, long, llmemory.AddressAsInt)):
             x = llmemory.cast_int_to_adr(x)
-        #if repr(x.ptr).startswith('<* <C object '):    # pom pom pom
-        #    # assume that we want a "C-style" cast, without typechecking the value
-        return rffi.cast(TYPE, x)
-        #return llmemory.cast_adr_to_ptr(x, TYPE)
+        try:   # pom pom pom
+            return llmemory.cast_adr_to_ptr(x, TYPE)
+        except (TypeError, RuntimeError, NotImplementedError, ValueError):
+            # assume that we want a "C-style" cast, without typechecking the value
+            return rffi.cast(TYPE, x)
     elif TYPE == llmemory.Address:
         if isinstance(x, (int, long, llmemory.AddressAsInt)):
             x = llmemory.cast_int_to_adr(x)
diff --git a/rpython/jit/tl/jittest.py b/rpython/jit/tl/jittest.py
--- a/rpython/jit/tl/jittest.py
+++ b/rpython/jit/tl/jittest.py
@@ -4,15 +4,20 @@
 only after the '---> Checkpoint' fork.
 """
 
+import os
 from rpython import conftest
 from rpython.rtyper.lltypesystem import lltype
 from rpython.rtyper.llinterp import LLInterpreter
 from rpython.rtyper.annlowlevel import llstr
 from rpython.jit.metainterp import warmspot
+from rpython.tool import runsubprocess
 
+os.environ['PYPY_DONT_RUN_SUBPROCESS'] = '1'
+reload(runsubprocess)
 
-ARGS = ["--jit", "trace_eagerness=18,threshold=50", "-S",
-        "/home/arigo/pypysrc/32compiled/z.py"]
+
+ARGS = ["--jit", "threshold=100000,trace_eagerness=100000",
+        "-S", "/home/arigo/pypysrc/32compiled/z.py"]
 
 
 def jittest(driver):
@@ -36,7 +41,8 @@
         class MyOpt:
             pass
         conftest.option = MyOpt()
-    conftest.option.view = True
+    conftest.option.view = False
+    conftest.option.viewloops = True   # XXX doesn't seem to work
     LIST = graph.getargs()[0].concretetype
     lst = LIST.TO.ll_newlist(len(ARGS))
     for i, arg in enumerate(ARGS):


More information about the pypy-commit mailing list