[pypy-commit] pypy vmprof: I'm getting so confused, count every FOUR so I know where we are

fijal noreply at buildbot.pypy.org
Tue Mar 31 22:42:19 CEST 2015


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: vmprof
Changeset: r76666:32000f6d787e
Date: 2015-03-31 22:42 +0200
http://bitbucket.org/pypy/pypy/changeset/32000f6d787e/

Log:	I'm getting so confused, count every FOUR so I know where we are

diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -129,7 +129,7 @@
 
         ec = self.space.getexecutioncontext()
         self._unique_id = ec._code_unique_id
-        ec._code_unique_id += 2 # so we have one bit that we can mark stuff
+        ec._code_unique_id += 4 # so we have two bits that we can mark stuff
         # with
 
     def _get_full_name(self):
diff --git a/pypy/module/_vmprof/interp_vmprof.py b/pypy/module/_vmprof/interp_vmprof.py
--- a/pypy/module/_vmprof/interp_vmprof.py
+++ b/pypy/module/_vmprof/interp_vmprof.py
@@ -96,7 +96,8 @@
             gc_frame = cast_instance_to_gcref(frame)
             gc_inputvalue = cast_instance_to_gcref(w_inputvalue)
             gc_operr = cast_instance_to_gcref(operr)
-            unique_id = frame.pycode._unique_id - 1
+            assert frame.pycode._unique_id & 3 == 0
+            unique_id = frame.pycode._unique_id | 1
             gc_result = pypy_execute_frame_trampoline(gc_frame, gc_inputvalue,
                                                       gc_operr, unique_id)
             return cast_base_ptr_to_instance(W_Root, gc_result)


More information about the pypy-commit mailing list