[svn:parrot] r41045 - branches/pluggable_runcore/src
bacek at svn.parrot.org
bacek at svn.parrot.org
Sun Sep 6 06:54:56 UTC 2009
Author: bacek
Date: Sun Sep 6 06:54:55 2009
New Revision: 41045
URL: https://trac.parrot.org/parrot/changeset/41045
Log:
[cage] Cache Sub PMC in Parrot_Context_get_info
Modified:
branches/pluggable_runcore/src/sub.c
Modified: branches/pluggable_runcore/src/sub.c
==============================================================================
--- branches/pluggable_runcore/src/sub.c Sun Sep 6 06:50:15 2009 (r41044)
+++ branches/pluggable_runcore/src/sub.c Sun Sep 6 06:54:55 2009 (r41045)
@@ -189,6 +189,7 @@
ARGOUT(Parrot_Context_info *info))
{
ASSERT_ARGS(Parrot_Context_get_info)
+ PMC *subpmc;
Parrot_Sub_attributes *sub;
/* set file/line/pc defaults */
@@ -199,8 +200,10 @@
info->subname = NULL;
info->fullname = NULL;
+ subpmc = Parrot_pcc_get_sub(interp, ctx);
+
/* is the current sub of the specified context valid? */
- if (PMC_IS_NULL(Parrot_pcc_get_sub(interp, ctx))) {
+ if (PMC_IS_NULL(subpmc)) {
info->subname = Parrot_str_new(interp, "???", 3);
info->nsname = info->subname;
info->fullname = Parrot_str_new(interp, "??? :: ???", 10);
@@ -209,10 +212,10 @@
}
/* fetch Parrot_sub of the current sub in the given context */
- if (!VTABLE_isa(interp, Parrot_pcc_get_sub(interp, ctx), CONST_STRING(interp, "Sub")))
+ if (!VTABLE_isa(interp, subpmc, CONST_STRING(interp, "Sub")))
return 1;
- PMC_get_sub(interp, Parrot_pcc_get_sub(interp, ctx), sub);
+ PMC_get_sub(interp, subpmc, sub);
/* set the sub name */
info->subname = sub->name;
@@ -223,7 +226,7 @@
}
else {
info->nsname = VTABLE_get_string(interp, sub->namespace_name);
- info->fullname = Parrot_full_sub_name(interp, Parrot_pcc_get_sub(interp, ctx));
+ info->fullname = Parrot_full_sub_name(interp, subpmc);
}
/* return here if there is no current pc */
More information about the parrot-commits
mailing list