From 69e4e98245a2629dbd5b49127538c3abc9a955cb Mon Sep 17 00:00:00 2001
From: Moritz Lenz <moritz@faui2k3.org>
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 662bddf..68518f7 100644
diff --git a/src/ops/perl6.ops b/src/ops/perl6.ops
index 6e333df..1c88ba4 100644
a
|
b
|
|
144 | 144 | |
145 | 145 | */ |
146 | 146 | inline op find_lex_skip_current(out PMC, in STR) :base_core { |
147 | | Parrot_Context *ctx = CONTEXT(interp); |
| 147 | PMC *ctx = CURRENT_CONTEXT(interp); |
148 | 148 | $1 = PMCNULL; |
149 | 149 | |
150 | | while (ctx->outer_ctx) { |
151 | | Parrot_Context * const outer = ctx->outer_ctx; |
152 | | PMC * const lex_pad = outer->lex_pad; |
| 150 | while (Parrot_pcc_get_outer_ctx(interp, ctx)) { |
| 151 | PMC * const outer = Parrot_pcc_get_outer_ctx(interp, ctx); |
| 152 | PMC * const lex_pad = Parrot_pcc_get_lex_pad(interp, outer); |
153 | 153 | |
154 | 154 | if (!PMC_IS_NULL(lex_pad) && VTABLE_exists_keyed_str(interp, lex_pad, $2)) { |
155 | 155 | $1 = VTABLE_get_pmc_keyed_str(interp, lex_pad, $2); |
… |
… |
|
266 | 266 | |
267 | 267 | */ |
268 | 268 | inline op get_next_candidate_info(out PMC, out PMC, out PMC) :base_core { |
269 | | Parrot_Context *ctx = CONTEXT(interp)->caller_ctx; |
270 | | STRING *name = string_from_literal(interp, "__CANDIDATE_LIST__"); |
271 | | STRING *wrapper = string_from_literal(interp, "$!wrapper_block"); |
272 | | PMC *last_lexpad = PMCNULL; |
273 | | PMC *last_sub = PMCNULL; |
| 269 | PMC *ctx = Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp)); |
| 270 | STRING *name = string_from_literal(interp, "__CANDIDATE_LIST__"); |
| 271 | STRING *wrapper = string_from_literal(interp, "$!wrapper_block"); |
| 272 | PMC *last_lexpad = PMCNULL; |
| 273 | PMC *last_sub = PMCNULL; |
274 | 274 | |
275 | | while (ctx) { |
| 275 | while (!PMC_IS_NULL(ctx)) { |
276 | 276 | /* See if we've found a candidate list. */ |
277 | | PMC *lexpad = ctx->lex_pad; |
| 277 | PMC *lexpad = Parrot_pcc_get_lex_pad(interp, ctx); |
278 | 278 | PMC *clist = VTABLE_get_pmc_keyed_str(interp, lexpad, name); |
279 | 279 | if (!PMC_IS_NULL(clist)) { |
280 | 280 | /* Found. Set results and we're done. */ |
281 | 281 | $1 = clist; |
282 | | if (PMC_IS_NULL(VTABLE_getprop(interp, ctx->current_sub, wrapper))) { |
283 | | $2 = ctx->current_sub; |
| 282 | if (PMC_IS_NULL(VTABLE_getprop(interp, Parrot_pcc_get_sub(interp, ctx), wrapper))) { |
| 283 | $2 = Parrot_pcc_get_sub(interp, ctx); |
284 | 284 | $3 = lexpad; |
285 | 285 | } |
286 | 286 | else { |
… |
… |
|
291 | 291 | } |
292 | 292 | else { |
293 | 293 | /* Not found; keep looking. */ |
294 | | last_sub = ctx->current_sub; |
| 294 | last_sub = Parrot_pcc_get_sub(interp, ctx); |
295 | 295 | last_lexpad = lexpad; |
296 | | ctx = ctx->outer_ctx; |
| 296 | ctx = Parrot_pcc_get_outer_ctx(interp, ctx); |
297 | 297 | } |
298 | 298 | } |
299 | 299 | if (!ctx) |
diff --git a/src/pmc/p6invocation.pmc b/src/pmc/p6invocation.pmc
index 4df78be..11e5921 100644
a
|
b
|
|
244 | 244 | first_candidate = VTABLE_get_pmc_keyed_str(interp, ns, CONST_STRING(interp, "!deferal_fail")); |
245 | 245 | } |
246 | 246 | addr = VTABLE_invoke(interp, first_candidate, next); |
247 | | lexpad = CONTEXT(interp)->lex_pad; |
| 247 | lexpad = Parrot_pcc_get_lex_pad(INTERP, CURRENT_CONTEXT(interp)); |
248 | 248 | if (!PMC_IS_NULL(lexpad) && VTABLE_exists_keyed_str(interp, lexpad, lexname)) |
249 | 249 | VTABLE_set_pmc_keyed_str(interp, lexpad, lexname, SELF); |
250 | 250 | return addr; |