1. Pypy
  2. Untitled project
  3. pypy

Commits

Antonio Cuni  committed 60cf0cb

make sure that we cannot use autoreds with confirm_enter_jit

  • Participants
  • Parent commits 3d05b0c
  • Branches autoreds

Comments (0)

Files changed (3)

File pypy/jit/metainterp/warmspot.py

View file
                 jitdriver = op.args[1].value
                 if not jitdriver.autoreds:
                     continue
+                assert jitdriver.confirm_enter_jit is None
                 # compute the set of live variables before the jit_marker
                 alive_v = set(block.inputargs)
                 for op1 in block.operations:

File pypy/rlib/jit.py

View file
             self.autoreds = True
             self.reds = []
             self.numreds = None # see warmspot.autodetect_jit_markers_redvars
+            assert confirm_enter_jit is None, 'cannot use automatic reds if confirm_enter_jit is given'
         elif reds is not None:
             self.autoreds = False
             self.reds = reds

File pypy/rlib/test/test_jit.py

View file
         pass
     assert fn.oopspec == 'foobar'
 
+def test_jitdriver_autoreds():
+    driver = JitDriver(greens=['foo'], reds='auto')
+    assert driver.autoreds
+    assert driver.reds == []
+    assert driver.numreds is None
+    #
+    py.test.raises(AssertionError, "JitDriver(greens=['foo'], reds='auto', confirm_enter_jit='something')")
+    
+    
 
 class BaseTestJIT(BaseRtypingTest):
     def test_hint(self):