Author: Antonio Cuni <[email protected]>
Branch: 
Changeset: r65956:cb457dcf368c
Date: 2013-08-06 11:12 +0200
http://bitbucket.org/pypy/pypy/changeset/cb457dcf368c/

Log:    put the name of the driver in the location string, in case
        get_printable_location is not set

diff --git a/rpython/jit/metainterp/test/test_warmstate.py 
b/rpython/jit/metainterp/test/test_warmstate.py
--- a/rpython/jit/metainterp/test/test_warmstate.py
+++ b/rpython/jit/metainterp/test/test_warmstate.py
@@ -185,7 +185,7 @@
     state.jit_getter = jit_getter
     state.make_jitdriver_callbacks()
     res = state.get_location_str([ConstInt(5), constfloat(42.5)])
-    assert res == '(no jitdriver.get_printable_location!)'
+    assert res == '(<unknown jitdriver>: no get_printable_location)'
 
 def test_make_jitdriver_callbacks_3():
     def get_location(x, y):
diff --git a/rpython/jit/metainterp/warmstate.py 
b/rpython/jit/metainterp/warmstate.py
--- a/rpython/jit/metainterp/warmstate.py
+++ b/rpython/jit/metainterp/warmstate.py
@@ -600,7 +600,12 @@
         #
         get_location_ptr = self.jitdriver_sd._get_printable_location_ptr
         if get_location_ptr is None:
-            missing = '(no jitdriver.get_printable_location!)'
+            jitdriver = self.jitdriver_sd.jitdriver
+            if self.jitdriver_sd.jitdriver:
+                drivername = jitdriver.name
+            else:
+                drivername = '<unknown jitdriver>'
+            missing = '(%s: no get_printable_location)' % drivername
             def get_location_str(greenkey):
                 return missing
         else:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to