Author: fijal
Branch: jit-leaner-frontend
Changeset: r83291:cd7cb1f484a7
Date: 2016-03-23 11:29 +0200
http://bitbucket.org/pypy/pypy/changeset/cd7cb1f484a7/

Log:    leave some notes and improve the tests

diff --git a/rpython/jit/metainterp/heapcache.py 
b/rpython/jit/metainterp/heapcache.py
--- a/rpython/jit/metainterp/heapcache.py
+++ b/rpython/jit/metainterp/heapcache.py
@@ -5,6 +5,11 @@
 from rpython.rlib.rarithmetic import r_uint32, r_uint
 from rpython.rlib.objectmodel import always_inline
 
+""" A big note: we don't do heap caches on Consts, because it used
+to be done with the identity of the Const instance. This gives very wonky
+results at best, so we decided to not do it at all. Can be fixed with
+interning of Consts (already done on trace anyway)
+"""
 
 # RefFrontendOp._heapc_flags:
 HF_LIKELY_VIRTUAL  = 0x01
diff --git a/rpython/jit/metainterp/test/test_tracingopts.py 
b/rpython/jit/metainterp/test/test_tracingopts.py
--- a/rpython/jit/metainterp/test/test_tracingopts.py
+++ b/rpython/jit/metainterp/test/test_tracingopts.py
@@ -74,9 +74,14 @@
     def test_heap_caching_while_tracing(self):
         class A:
             pass
-        a1 = A()
-        a2 = A()
+
+        @jit.dont_look_inside
+        def get():
+            return A()
+
         def fn(n):
+            a1 = get()
+            a2 = get()
             if n > 0:
                 a = a1
             else:
@@ -91,6 +96,8 @@
         self.check_operations_history(getfield_gc_i=0)
 
         def fn(n, ca, cb):
+            a1 = get()
+            a2 = get()
             a1.x = n
             a2.x = n
             a = a1
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to