[svn:parrot] r48734 - trunk/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Tue Aug 31 11:55:32 UTC 2010


Author: NotFound
Date: Tue Aug 31 11:55:31 2010
New Revision: 48734
URL: https://trac.parrot.org/parrot/changeset/48734

Log:
avoid duplicated CONST_STRING in backtrace method

Modified:
   trunk/src/pmc/exception.pmc

Modified: trunk/src/pmc/exception.pmc
==============================================================================
--- trunk/src/pmc/exception.pmc	Tue Aug 31 08:02:19 2010	(r48733)
+++ trunk/src/pmc/exception.pmc	Tue Aug 31 11:55:31 2010	(r48734)
@@ -787,6 +787,7 @@
 */
 
     METHOD backtrace() {
+        STRING * const meth_backtrace = CONST_STRING(INTERP, "backtrace");
         PMC *result = PMCNULL;
         PMC *resume;
 
@@ -795,7 +796,8 @@
         if (!PMC_IS_NULL(resume)) {
             /* We have a resume continuation, so we can get the address from that. */
             const Parrot_Continuation_attributes * const cont = PARROT_CONTINUATION(resume);
-            Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, CONST_STRING(INTERP, "backtrace"), "P->P", resume, &result);
+            Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, meth_backtrace,
+                    "P->P", resume, &result);
         }
         else {
             /* Hopefully we have a thrower set - our most epic fail fallback is
@@ -804,7 +806,8 @@
             GET_ATTR_thrower(INTERP, SELF, cur_ctx);
             if (PMC_IS_NULL(cur_ctx))
                 cur_ctx = CURRENT_CONTEXT(INTERP);
-            Parrot_pcc_invoke_method_from_c_args(INTERP, cur_ctx, CONST_STRING(INTERP, "backtrace"), "->P", &result);
+            Parrot_pcc_invoke_method_from_c_args(INTERP, cur_ctx, meth_backtrace,
+                    "->P", &result);
         }
 
         RETURN(PMC *result);


More information about the parrot-commits mailing list