Author: Tim Felgentreff <[email protected]>
Branch: 
Changeset: r86420:edea3287d97a
Date: 2016-08-22 11:34 +0200
http://bitbucket.org/pypy/pypy/changeset/edea3287d97a/

Log:    if code class for vmprof has attrs, extend that

diff --git a/rpython/rlib/rvmprof/rvmprof.py b/rpython/rlib/rvmprof/rvmprof.py
--- a/rpython/rlib/rvmprof/rvmprof.py
+++ b/rpython/rlib/rvmprof/rvmprof.py
@@ -90,6 +90,9 @@
         CodeClass._vmprof_unique_id = 0     # default value: "unknown"
         immut = CodeClass.__dict__.get('_immutable_fields_', [])
         CodeClass._immutable_fields_ = list(immut) + ['_vmprof_unique_id']
+        attrs = CodeClass.__dict__.get('_attrs_', None)
+        if attrs:
+            CodeClass._attrs_ = list(attrs) + ['_vmprof_unique_id']
         self._code_classes.add(CodeClass)
         #
         class WeakCodeObjectList(RWeakListMixin):
@@ -189,7 +192,7 @@
 
         def decorated_function(*args):
             unique_id = get_code_fn(*args)._vmprof_unique_id
-            unique_id = rffi.cast(lltype.Signed, unique_id) 
+            unique_id = rffi.cast(lltype.Signed, unique_id)
             # ^^^ removes the "known non-negative" hint for annotation
             if not jit.we_are_jitted():
                 x = enter_code(unique_id)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to