[svn:parrot] r47117 - trunk/src/ops

jonathan at svn.parrot.org jonathan at svn.parrot.org
Sat May 29 23:34:50 UTC 2010


Author: jonathan
Date: Sat May 29 23:34:49 2010
New Revision: 47117
URL: https://trac.parrot.org/parrot/changeset/47117

Log:
[core] First step towards trying to get some better annotations returned by .backtrace(). We rely on the context's ->current_pc pointer to know a context's current code location but never actually update it (unless we're in the profiling core) other that at sub entry. Makes some sense, since it'd cost us to do it every op. Doing it before an invoke, however, is enough to ensure that we know the callsite location, which is a big improvement to the backtraces we can produce.

Modified:
   trunk/src/ops/core.ops
   trunk/src/ops/core_ops.c

Modified: trunk/src/ops/core.ops
==============================================================================
--- trunk/src/ops/core.ops	Sat May 29 19:46:29 2010	(r47116)
+++ trunk/src/ops/core.ops	Sat May 29 23:34:49 2010	(r47117)
@@ -379,9 +379,11 @@
     PMC      * const signature = Parrot_pcc_get_signature(interp,
                                     CURRENT_CONTEXT(interp));
 
+    Parrot_pcc_set_pc_func(interp, CURRENT_CONTEXT(interp), dest);
+
     if (!PMC_IS_NULL(signature))
         Parrot_pcc_set_object(interp, signature, NULL);
-    interp->current_cont   = NEED_CONTINUATION;
+    interp->current_cont   = NEED_CONTINUATION;    
     dest                   = VTABLE_invoke(interp, p, dest);
 
     goto ADDRESS(dest);
@@ -393,6 +395,8 @@
     PMC * const signature  = Parrot_pcc_get_signature(interp,
                                     CURRENT_CONTEXT(interp));
 
+    Parrot_pcc_set_pc_func(interp, CURRENT_CONTEXT(interp), dest);
+
     if (!PMC_IS_NULL(signature))
         Parrot_pcc_set_object(interp, signature, NULL);
     interp->current_cont   = $2;

Modified: trunk/src/ops/core_ops.c
==============================================================================
--- trunk/src/ops/core_ops.c	Sat May 29 19:46:29 2010	(r47116)
+++ trunk/src/ops/core_ops.c	Sat May 29 23:34:49 2010	(r47117)
@@ -14338,9 +14338,11 @@
     PMC      * const signature = Parrot_pcc_get_signature(interp,
                                     CURRENT_CONTEXT(interp));
 
+    Parrot_pcc_set_pc_func(interp, CURRENT_CONTEXT(interp), dest);
+
     if (!PMC_IS_NULL(signature))
         Parrot_pcc_set_object(interp, signature, NULL);
-    interp->current_cont   = NEED_CONTINUATION;
+    interp->current_cont   = NEED_CONTINUATION;    
     dest                   = VTABLE_invoke(interp, p, dest);return (opcode_t *)dest;
 }
 
@@ -14352,6 +14354,8 @@
     PMC * const signature  = Parrot_pcc_get_signature(interp,
                                     CURRENT_CONTEXT(interp));
 
+    Parrot_pcc_set_pc_func(interp, CURRENT_CONTEXT(interp), dest);
+
     if (!PMC_IS_NULL(signature))
         Parrot_pcc_set_object(interp, signature, NULL);
     interp->current_cont   = PREG(2);


More information about the parrot-commits mailing list