Hakan Ardo avatar Hakan Ardo committed 01e3685

work in progress

Comments (0)

Files changed (3)

pypy/jit/metainterp/optimizeopt/unroll.py

                 for sh in short:
                     ok = False
                     extra_guards = []
+                    
                     if sh.virtual_state.generalization_of(virtual_state):
                         ok = True
                     else:
+                        import pdb; pdb.set_trace()
                         try:
                             cpu = self.optimizer.cpu
                             sh.virtual_state.generate_guards(virtual_state,

pypy/jit/metainterp/optimizeopt/virtualstate.py

     def generalization_of(self, other):
         assert len(self.state) == len(other.state)
         for i in range(len(self.state)):
+            print 'ge: ', i
             if not self.state[i].generalization_of(other.state[i]):
                 return False
         return True
     def generate_guards(self, other, args, cpu, extra_guards):        
         assert len(self.state) == len(other.state) == len(args)
         for i in range(len(self.state)):
+            print 'gu: ', i
             self.state[i].generate_guards(other.state[i], args[i],
                                           cpu, extra_guards)
 

pypy/jit/metainterp/test/test_ajit.py

         assert res == 12
         self.check_tree_loop_count(2)        
 
+    def test_caching_setfield(self):
+        myjitdriver = JitDriver(greens = [], reds = ['sa', 'i', 'n', 'a', 'node'])
+        class A:
+            pass
+        def f(n, a):
+            i = sa = 0
+            node = A()
+            while i < n:
+                myjitdriver.can_enter_jit(sa=sa, i=i, n=n, a=a, node=node)
+                myjitdriver.jit_merge_point(sa=sa, i=i, n=n, a=a, node=node)
+                if i < n/2:
+                    node.val1 = a
+                    node.val2 = a
+                sa += node.val1 + node.val2
+                i += 1
+            return n
+        res = self.meta_interp(f, [32, 7])
+        assert res == f(32, 7)
+
+        # write same val to 2 locations
+        # read them
+        # write 2 differnt values from branch
+
+        # r=getfield
+        # assert r<0
+        # bridge violating assert
+        
+
+        
+
+        
 
 
 class TestOOtype(BasicTests, OOJitMixin):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.