[pypy-commit] pypy new-jit-log: added function to access loop run counters of the assembler (instead of accessing the list directly)

plan_rich pypy.commits at gmail.com
Tue Jun 21 09:39:57 EDT 2016


Author: Richard Plangger <planrichi at gmail.com>
Branch: new-jit-log
Changeset: r85304:d37d1456081b
Date: 2016-06-21 15:39 +0200
http://bitbucket.org/pypy/pypy/changeset/d37d1456081b/

Log:	added function to access loop run counters of the assembler (instead
	of accessing the list directly)

diff --git a/rpython/jit/backend/llsupport/assembler.py b/rpython/jit/backend/llsupport/assembler.py
--- a/rpython/jit/backend/llsupport/assembler.py
+++ b/rpython/jit/backend/llsupport/assembler.py
@@ -332,6 +332,9 @@
         # Here we join Path A and Path B again
         self._call_assembler_patch_jmp(jmp_location)
 
+    def get_loop_run_counters(self, index):
+        return LOOP_RUN_COUNTERS[index]
+
     @specialize.argtype(1)
     def _inject_debugging_code(self, looptoken, operations, tp, number):
         if self._debug:
diff --git a/rpython/jit/backend/x86/test/test_runner.py b/rpython/jit/backend/x86/test/test_runner.py
--- a/rpython/jit/backend/x86/test/test_runner.py
+++ b/rpython/jit/backend/x86/test/test_runner.py
@@ -590,11 +590,11 @@
             self.cpu.compile_loop(ops.inputargs, ops.operations, looptoken)
             self.cpu.execute_token(looptoken, 0)
             # check debugging info
-            struct = self.cpu.assembler.loop_run_counters[0]
+            struct = self.cpu.assembler.get_loop_run_counters(0)
             assert struct.i == 1
-            struct = self.cpu.assembler.loop_run_counters[1]
+            struct = self.cpu.assembler.get_loop_run_counters(1)
             assert struct.i == 1
-            struct = self.cpu.assembler.loop_run_counters[2]
+            struct = self.cpu.assembler.get_loop_run_counters(2)
             assert struct.i == 9
             self.cpu.finish_once()
         finally:


More information about the pypy-commit mailing list