Author: Richard Plangger <planri...@gmail.com>
Branch: vmprof-native
Changeset: r90017:b3fd68be4074
Date: 2017-02-09 11:12 +0100
http://bitbucket.org/pypy/pypy/changeset/b3fd68be4074/

Log:    check to not register more than one entry in _code_classes

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
@@ -94,6 +94,10 @@
         """
         if CodeClass in self._code_classes:
             return
+        assert len(self._code_classes) == 0, \
+                "native profiling currently prohibits " \
+                "to have more than one code class. see comment "\
+                "in vmprof_execute_code for details"
         CodeClass._vmprof_unique_id = 0     # default value: "unknown"
         immut = CodeClass.__dict__.get('_immutable_fields_', [])
         CodeClass._immutable_fields_ = list(immut) + ['_vmprof_unique_id']
@@ -180,8 +184,9 @@
     'result_class' is ignored (backward compatibility).
 
     NOTE Native profiling: this function can only be called once during
-    translation. To remove this restriction, one needs to extend the macro
-    IS_VMPROF_EVAL in the repo vmprof/vmprof-python.git.
+    translation. It would require the macro IS_VMPROF_EVAL to check
+    the IP agains several (not one) symbols. The current symbol is called
+    __vmprof_eval_vmprof.
     """
     if _hack_update_stack_untranslated:
         from rpython.rtyper.annlowlevel import llhelper
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to