Remi Meier avatar Remi Meier committed 85b192f

write a test and fix

Comments (0)

Files changed (2)

rpython/jit/metainterp/pyjitpl.py

             funcaddr = llmemory.cast_ptr_to_adr(funcptr)
             mi._record_helper_nonpure_varargs(
                 rop.CALL, resbox, funcdescr,
-                [ConstInt(mi.cpu.cast_adr_to_int(funcaddr)),])
+                [ConstInt(heaptracker.adr2int(funcaddr)),])
             return resbox
         else:
             return ConstInt(0)
         if warmrunnerdesc:
             self.config = warmrunnerdesc.translator.config
         else:
-            from rpython.config.translationoption import get_combined_translation_config
-            self.config = get_combined_translation_config(translating=True)
+            self.config = cpu.rtyper.annotator.translator.config
+        # else:
+        #     from rpython.config.translationoption import get_combined_translation_config
+        #     self.config = get_combined_translation_config(translating=True)
 
         backendmodule = self.cpu.__module__
         backendmodule = backendmodule.split('.')[-2]
             self.stm_should_break_transaction = rffi.llexternal(
                 'stm_should_break_transaction',
                 [], lltype.Bool,
-                sandboxsafe=True, _nowrapper=True, transactionsafe=True)
+                sandboxsafe=True, _nowrapper=True, transactionsafe=True,
+                _callable=lambda : False)
             FUNC = lltype.typeOf(self.stm_should_break_transaction).TO
 
             ei = EffectInfo([], [], [], [],

rpython/jit/metainterp/test/test_stm.py

             return rstm.jit_stm_should_break_transaction(False)
         res = self.interp_operations(g, [])
         assert res == False
+        self.check_operations_history({})
+
+    def test_not_removed(self):
+        import time
+        def g():
+            time.sleep(0)
+            return rstm.jit_stm_should_break_transaction(False)
+        res = self.interp_operations(g, [], translationoptions={"stm":True})
+        assert res == False
+        self.check_operations_history(call=1, call_may_force=1)
+        
+            
+    
 
 class TestLLtype(STMTests, LLJitMixin):
     pass
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.