From c6bf7b8ec867f49907cc1945098db999b02b9d0f Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Thu, 3 Sep 2009 14:21:06 +0200 Subject: [PATCH] make Rakudo build on parrot after context_pmc3 branch merge Patch courtesy by bacek++ --- build/PARROT_REVISION | 2 +- src/ops/perl6.ops | 30 +++++++++++++++--------------- src/pmc/p6invocation.pmc | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/build/PARROT_REVISION b/build/PARROT_REVISION index 662bddf9811..68518f7dd96 100644 --- a/build/PARROT_REVISION +++ b/build/PARROT_REVISION @@ -1 +1 @@ -40789 +40958 diff --git a/src/ops/perl6.ops b/src/ops/perl6.ops index 6e333df7c5b..1c88ba46fdd 100644 --- a/src/ops/perl6.ops +++ b/src/ops/perl6.ops @@ -144,12 +144,12 @@ skips the current sub and starts looking immediately at its outers. */ inline op find_lex_skip_current(out PMC, in STR) :base_core { - Parrot_Context *ctx = CONTEXT(interp); + PMC *ctx = CURRENT_CONTEXT(interp); $1 = PMCNULL; - while (ctx->outer_ctx) { - Parrot_Context * const outer = ctx->outer_ctx; - PMC * const lex_pad = outer->lex_pad; + while (Parrot_pcc_get_outer_ctx(interp, ctx)) { + PMC * const outer = Parrot_pcc_get_outer_ctx(interp, ctx); + PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, outer); if (!PMC_IS_NULL(lex_pad) && VTABLE_exists_keyed_str(interp, lex_pad, $2)) { $1 = VTABLE_get_pmc_keyed_str(interp, lex_pad, $2); @@ -266,21 +266,21 @@ nextsame need. */ inline op get_next_candidate_info(out PMC, out PMC, out PMC) :base_core { - Parrot_Context *ctx = CONTEXT(interp)->caller_ctx; - STRING *name = string_from_literal(interp, "__CANDIDATE_LIST__"); - STRING *wrapper = string_from_literal(interp, "$!wrapper_block"); - PMC *last_lexpad = PMCNULL; - PMC *last_sub = PMCNULL; + PMC *ctx = Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp)); + STRING *name = string_from_literal(interp, "__CANDIDATE_LIST__"); + STRING *wrapper = string_from_literal(interp, "$!wrapper_block"); + PMC *last_lexpad = PMCNULL; + PMC *last_sub = PMCNULL; - while (ctx) { + while (!PMC_IS_NULL(ctx)) { /* See if we've found a candidate list. */ - PMC *lexpad = ctx->lex_pad; + PMC *lexpad = Parrot_pcc_get_lex_pad(interp, ctx); PMC *clist = VTABLE_get_pmc_keyed_str(interp, lexpad, name); if (!PMC_IS_NULL(clist)) { /* Found. Set results and we're done. */ $1 = clist; - if (PMC_IS_NULL(VTABLE_getprop(interp, ctx->current_sub, wrapper))) { - $2 = ctx->current_sub; + if (PMC_IS_NULL(VTABLE_getprop(interp, Parrot_pcc_get_sub(interp, ctx), wrapper))) { + $2 = Parrot_pcc_get_sub(interp, ctx); $3 = lexpad; } else { @@ -291,9 +291,9 @@ inline op get_next_candidate_info(out PMC, out PMC, out PMC) :base_core { } else { /* Not found; keep looking. */ - last_sub = ctx->current_sub; + last_sub = Parrot_pcc_get_sub(interp, ctx); last_lexpad = lexpad; - ctx = ctx->outer_ctx; + ctx = Parrot_pcc_get_outer_ctx(interp, ctx); } } if (!ctx) diff --git a/src/pmc/p6invocation.pmc b/src/pmc/p6invocation.pmc index 4df78bee60c..11e5921c413 100644 --- a/src/pmc/p6invocation.pmc +++ b/src/pmc/p6invocation.pmc @@ -244,7 +244,7 @@ pmclass P6Invocation need_ext dynpmc group perl6_group { first_candidate = VTABLE_get_pmc_keyed_str(interp, ns, CONST_STRING(interp, "!deferal_fail")); } addr = VTABLE_invoke(interp, first_candidate, next); - lexpad = CONTEXT(interp)->lex_pad; + lexpad = Parrot_pcc_get_lex_pad(INTERP, CURRENT_CONTEXT(interp)); if (!PMC_IS_NULL(lexpad) && VTABLE_exists_keyed_str(interp, lexpad, lexname)) VTABLE_set_pmc_keyed_str(interp, lexpad, lexname, SELF); return addr;