[svn:parrot] r40902 - in branches/context_pmc3: compilers/imcc include/parrot lib/Parrot/OpTrans src src/call src/gc src/interp src/ops src/pmc src/runcore
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue Sep 1 09:22:33 UTC 2009
Author: bacek
Date: Tue Sep 1 09:22:28 2009
New Revision: 40902
URL: https://trac.parrot.org/parrot/changeset/40902
Log:
Reintroduce CURRENT_CONTEXT macro. Switch CONTEXT macro to return Parrot_Context structure back
Modified:
branches/context_pmc3/compilers/imcc/imcc.y
branches/context_pmc3/compilers/imcc/imcparser.c
branches/context_pmc3/compilers/imcc/pbc.c
branches/context_pmc3/include/parrot/interpreter.h
branches/context_pmc3/lib/Parrot/OpTrans/CGP.pm
branches/context_pmc3/lib/Parrot/OpTrans/CPrederef.pm
branches/context_pmc3/src/call/ops.c
branches/context_pmc3/src/call/pcc.c
branches/context_pmc3/src/debug.c
branches/context_pmc3/src/embed.c
branches/context_pmc3/src/exceptions.c
branches/context_pmc3/src/gc/alloc_register.c
branches/context_pmc3/src/gc/mark_sweep.c
branches/context_pmc3/src/global.c
branches/context_pmc3/src/global_setup.c
branches/context_pmc3/src/hll.c
branches/context_pmc3/src/interp/inter_create.c
branches/context_pmc3/src/interp/inter_misc.c
branches/context_pmc3/src/multidispatch.c
branches/context_pmc3/src/oo.c
branches/context_pmc3/src/ops/core.ops
branches/context_pmc3/src/ops/debug.ops
branches/context_pmc3/src/ops/object.ops
branches/context_pmc3/src/ops/pic.ops
branches/context_pmc3/src/ops/var.ops
branches/context_pmc3/src/packfile.c
branches/context_pmc3/src/pic.c
branches/context_pmc3/src/pmc.c
branches/context_pmc3/src/pmc/class.pmc
branches/context_pmc3/src/pmc/continuation.pmc
branches/context_pmc3/src/pmc/coroutine.pmc
branches/context_pmc3/src/pmc/exporter.pmc
branches/context_pmc3/src/pmc/nci.pmc
branches/context_pmc3/src/pmc/object.pmc
branches/context_pmc3/src/pmc/parrotinterpreter.pmc
branches/context_pmc3/src/pmc/role.pmc
branches/context_pmc3/src/pmc/sub.pmc
branches/context_pmc3/src/runcore/cores.c
branches/context_pmc3/src/runcore/main.c
branches/context_pmc3/src/scheduler.c
branches/context_pmc3/src/sub.c
branches/context_pmc3/src/warnings.c
Modified: branches/context_pmc3/compilers/imcc/imcc.y
==============================================================================
--- branches/context_pmc3/compilers/imcc/imcc.y Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/compilers/imcc/imcc.y Tue Sep 1 09:22:28 2009 (r40902)
@@ -1210,7 +1210,7 @@
HLL STRINGC
{
STRING * const hll_name = Parrot_str_unescape(interp, $2 + 1, '"', NULL);
- Parrot_pcc_set_HLL(interp, CONTEXT(interp),
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
Parrot_register_HLL(interp, hll_name));
IMCC_INFO(interp)->cur_namespace = NULL;
Modified: branches/context_pmc3/compilers/imcc/imcparser.c
==============================================================================
--- branches/context_pmc3/compilers/imcc/imcparser.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/compilers/imcc/imcparser.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -3318,7 +3318,7 @@
#line 1211 "compilers/imcc/imcc.y"
{
STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
- Parrot_pcc_set_HLL(interp, CONTEXT(interp),
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp),
Parrot_register_HLL(interp, hll_name));
IMCC_INFO(interp)->cur_namespace = NULL;
Modified: branches/context_pmc3/compilers/imcc/pbc.c
==============================================================================
--- branches/context_pmc3/compilers/imcc/pbc.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/compilers/imcc/pbc.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -1280,7 +1280,7 @@
}
/* could be eval too; check if :outer is the current sub */
- current = Parrot_pcc_get_sub(interp, CONTEXT(interp));
+ current = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
if (PMC_IS_NULL(current))
IMCC_fatal(interp, 1, "Undefined :outer sub '%s'.\n",
@@ -1434,7 +1434,7 @@
sub->namespace_name = ns_pmc;
sub->start_offs = offs;
sub->end_offs = end;
- sub->HLL_id = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ sub->HLL_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
for (i = 0; i < 4; ++i)
sub->n_regs_used[i] = unit->n_regs_used[i];
Modified: branches/context_pmc3/include/parrot/interpreter.h
==============================================================================
--- branches/context_pmc3/include/parrot/interpreter.h Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/include/parrot/interpreter.h Tue Sep 1 09:22:28 2009 (r40902)
@@ -196,8 +196,7 @@
/*
* Get Context from interpeter.
*/
-#define CONTEXT(interp) ((interp)->ctx)
-
+#define CONTEXT(interp) Parrot_pcc_get_context_struct((interp), (interp)->ctx)
/*
* Helper macros to fetch fields from context.
@@ -205,6 +204,7 @@
* Not considered as part of public API. Should be replaced with proper accessor
* functions to manipulate Context.
*/
+#define CURRENT_CONTEXT(interp) ((interp)->ctx)
#define CONTEXT_FIELD(interp, ctx, name) ((Parrot_pcc_get_context_struct((interp), (ctx)))->name)
#define CURRENT_CONTEXT_FIELD(interp, name) CONTEXT_FIELD((interp), (interp)->ctx, name)
Modified: branches/context_pmc3/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- branches/context_pmc3/lib/Parrot/OpTrans/CGP.pm Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/lib/Parrot/OpTrans/CGP.pm Tue Sep 1 09:22:28 2009 (r40902)
@@ -107,7 +107,7 @@
my ( $self, $offset ) = @_;
# this must be a single expression, in case it's in a single-statement if
- return "do {\nParrot_pcc_set_pc(interp, CONTEXT(interp), CUR_OPCODE + $offset);\n"
+ return "do {\nParrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), CUR_OPCODE + $offset);\n"
. "goto **(void **)(cur_opcode += $offset);\n} while (1)";
}
Modified: branches/context_pmc3/lib/Parrot/OpTrans/CPrederef.pm
==============================================================================
--- branches/context_pmc3/lib/Parrot/OpTrans/CPrederef.pm Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/lib/Parrot/OpTrans/CPrederef.pm Tue Sep 1 09:22:28 2009 (r40902)
@@ -38,7 +38,7 @@
/* defines - $0 -> $type */
#define REL_PC ((size_t)(cur_opcode - (opcode_t*)interp->code->prederef.code))
#define CUR_OPCODE \\
- ((opcode_t*)cur_opcode + Parrot_pcc_get_pred_offset(interp, CONTEXT(interp)))
+ ((opcode_t*)cur_opcode + Parrot_pcc_get_pred_offset(interp, CURRENT_CONTEXT(interp)))
#define OP_AS_OFFS(o) (_reg_base + ((opcode_t*)cur_opcode)[o])
END
Modified: branches/context_pmc3/src/call/ops.c
==============================================================================
--- branches/context_pmc3/src/call/ops.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/call/ops.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -169,7 +169,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"Subroutine returned a NULL address");
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
offset = dest - interp->code->base.data;
runops(interp, offset);
return ctx;
@@ -212,7 +212,7 @@
char new_sig[10];
const char *sig_p;
- PMC * const old_ctx = CONTEXT(interp);
+ PMC * const old_ctx = CURRENT_CONTEXT(interp);
interp->current_cont = new_ret_continuation_pmc(interp, NULL);
interp->current_object = obj;
@@ -264,7 +264,7 @@
"no get_params in sub");
*/
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
offset = dest - interp->code->base.data;
runops(interp, offset);
return ctx;
@@ -304,7 +304,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"Subroutine returned a NULL address");
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
offset = dest - interp->code->base.data;
runops(interp, offset);
return set_retval(interp, 0, ctx);
Modified: branches/context_pmc3/src/call/pcc.c
==============================================================================
--- branches/context_pmc3/src/call/pcc.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/call/pcc.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -478,13 +478,13 @@
init_call_stats(st);
if (PMC_IS_NULL(interp->args_signature))
- Parrot_init_arg_op(interp, CONTEXT(interp), interp->current_args,
+ Parrot_init_arg_op(interp, CURRENT_CONTEXT(interp), interp->current_args,
&st->src);
else
- Parrot_init_arg_indexes_and_sig_pmc(interp, CONTEXT(interp),
+ Parrot_init_arg_indexes_and_sig_pmc(interp, CURRENT_CONTEXT(interp),
interp->current_args, interp->args_signature, &st->src);
- Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL, &st->dest);
+ Parrot_init_arg_sig(interp, CURRENT_CONTEXT(interp), sig, NULL, &st->dest);
}
@@ -505,7 +505,7 @@
Parrot_init_ret_nci(PARROT_INTERP, ARGOUT(call_state *st), ARGIN(const char *sig))
{
ASSERT_ARGS(Parrot_init_ret_nci)
- PMC *ctx = CONTEXT(interp);
+ PMC *ctx = CURRENT_CONTEXT(interp);
PMC * const current_cont = Parrot_pcc_get_continuation(interp, ctx);
/* if this NCI call was a taicall, return results to caller's get_results
@@ -514,7 +514,7 @@
ctx = PMC_cont(current_cont)->to_ctx;
/* TODO simplify all */
- Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL, &st->src);
+ Parrot_init_arg_sig(interp, CURRENT_CONTEXT(interp), sig, NULL, &st->src);
/* Non-constant signatures are stored in ctx->results_signature instead of
* in the constants table. */
@@ -770,7 +770,7 @@
break;
case PARROT_ARG_PMC:
if (st->src.u.sig.sig[st->src.i] == 'O')
- UVal_pmc(st->val) = Parrot_pcc_get_object(interp, CONTEXT(interp));
+ UVal_pmc(st->val) = Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp));
else {
UVal_pmc(st->val) = va_arg(*ap, PMC *);
}
@@ -1922,7 +1922,7 @@
ASSERT_ARGS(parrot_pass_args_fromc)
call_state st;
- Parrot_init_arg_op(interp, CONTEXT(interp), dest, &st.dest);
+ Parrot_init_arg_op(interp, CURRENT_CONTEXT(interp), dest, &st.dest);
Parrot_init_arg_sig(interp, old_ctxp, sig, PARROT_VA_TO_VAPTR(ap), &st.src);
Parrot_process_args(interp, &st, PARROT_PASS_PARAMS);
return dest + st.dest.n + 2;
@@ -1952,7 +1952,7 @@
interp->current_returns = NULL;
if (todo) {
- todo = Parrot_init_arg_sig(interp, CONTEXT(interp), sig, NULL,
+ todo = Parrot_init_arg_sig(interp, CURRENT_CONTEXT(interp), sig, NULL,
&st->dest);
if (todo) {
Modified: branches/context_pmc3/src/debug.c
==============================================================================
--- branches/context_pmc3/src/debug.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/debug.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -2211,7 +2211,7 @@
PDB_check_condition(PARROT_INTERP, ARGIN(const PDB_condition_t *condition))
{
ASSERT_ARGS(PDB_check_condition)
- PMC *ctx = CONTEXT(interp);
+ PMC *ctx = CURRENT_CONTEXT(interp);
TRACEDEB_MSG("PDB_check_condition");
@@ -3512,7 +3512,7 @@
/* information about the current sub */
PMC *sub = interpinfo_p(interp, CURRENT_SUB);
- PMC *ctx = CONTEXT(interp);
+ PMC *ctx = CURRENT_CONTEXT(interp);
if (!PMC_IS_NULL(sub)) {
str = Parrot_Context_infostr(interp, ctx);
@@ -3634,7 +3634,7 @@
ASSERT_ARGS(GDB_print_reg)
char * string;
- if (n >= 0 && n < Parrot_pcc_get_regs_used(interp, CONTEXT(interp), t)) {
+ if (n >= 0 && n < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), t)) {
switch (t) {
case REGNO_INT:
return Parrot_str_from_int(interp, IREG(n))->strstart;
@@ -3699,7 +3699,7 @@
}
if (! s[1]) {
/* Print all registers of this type. */
- const int max_reg = Parrot_pcc_get_regs_used(interp, CONTEXT(interp), t);
+ const int max_reg = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), t);
int n;
for (n = 0; n < max_reg; n++) {
Modified: branches/context_pmc3/src/embed.c
==============================================================================
--- branches/context_pmc3/src/embed.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/embed.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -910,8 +910,8 @@
const size_t offs = sub->start_offs;
if (offs == interp->resume_offset) {
- Parrot_pcc_set_sub(interp, CONTEXT(interp), sub_pmc);
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), sub->HLL_id);
+ Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id);
return sub_pmc;
}
@@ -925,7 +925,7 @@
sub_pmc = pmc_new(interp, enum_class_Sub);
PMC_get_sub(interp, sub_pmc, sub_pmc_sub);
sub_pmc_sub->start_offs = 0;
- Parrot_pcc_set_sub(interp, CONTEXT(interp), sub_pmc);
+ Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
return sub_pmc;
}
@@ -970,14 +970,14 @@
Parrot_on_exit(interp, print_profile, NULL);
/* Let's kick the tires and light the fires--call interpreter.c:runops. */
- main_sub = Parrot_pcc_get_sub(interp, CONTEXT(interp));
+ main_sub = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
/* if no sub was marked being :main, we create a dummy sub with offset 0 */
if (!main_sub)
main_sub = set_current_sub(interp);
- Parrot_pcc_set_sub(interp, CONTEXT(interp), NULL);
+ Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
Parrot_pcc_set_constants(interp, interp->ctx, interp->code->const_table->constants);
Parrot_runops_fromc_args(interp, main_sub, "vP", userargv);
Modified: branches/context_pmc3/src/exceptions.c
==============================================================================
--- branches/context_pmc3/src/exceptions.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/exceptions.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -253,7 +253,7 @@
/* Set up the continuation context of the handler in the interpreter. */
else if (PMC_cont(handler)->current_results)
address = pass_exception_args(interp, "P", address,
- CONTEXT(interp), exception);
+ CURRENT_CONTEXT(interp), exception);
if (PObj_get_FLAGS(handler) & SUB_FLAG_C_HANDLER) {
/* it's a C exception handler */
@@ -390,7 +390,7 @@
/* Note the thrower.
* XXX TT#596 - pass in current context instead when we have context PMCs. */
/* Don't split line. It will break CONST_STRING handling */
- VTABLE_set_attr_str(interp, exception, CONST_STRING(interp, "thrower"), Parrot_pcc_get_continuation(interp, CONTEXT(interp)));
+ VTABLE_set_attr_str(interp, exception, CONST_STRING(interp, "thrower"), Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp)));
/* it's a C exception handler */
if (PObj_get_FLAGS(handler) & SUB_FLAG_C_HANDLER) {
@@ -403,7 +403,7 @@
address = VTABLE_invoke(interp, handler, NULL);
if (PMC_cont(handler)->current_results)
address = pass_exception_args(interp, "P", address,
- CONTEXT(interp), exception);
+ CURRENT_CONTEXT(interp), exception);
PARROT_ASSERT(return_point->handler_start == NULL);
return_point->handler_start = address;
longjmp(return_point->resume, 2);
Modified: branches/context_pmc3/src/gc/alloc_register.c
==============================================================================
--- branches/context_pmc3/src/gc/alloc_register.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/gc/alloc_register.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -319,7 +319,7 @@
Parrot_push_context(PARROT_INTERP, ARGIN(const INTVAL *n_regs_used))
{
ASSERT_ARGS(Parrot_push_context)
- PMC * const old = CONTEXT(interp);
+ PMC * const old = CURRENT_CONTEXT(interp);
PMC * const ctx = Parrot_set_new_context(interp, n_regs_used);
Parrot_pcc_set_caller_ctx(interp, ctx, old);
@@ -348,11 +348,11 @@
Parrot_pop_context(PARROT_INTERP)
{
ASSERT_ARGS(Parrot_pop_context)
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
PMC * const old = Parrot_pcc_get_caller_ctx(interp, ctx);
/* restore old, set cached interpreter base pointers */
- CONTEXT(interp) = old;
+ CURRENT_CONTEXT(interp) = old;
}
@@ -434,10 +434,10 @@
Parrot_set_new_context(PARROT_INTERP, ARGIN(const INTVAL *number_regs_used))
{
ASSERT_ARGS(Parrot_set_new_context)
- PMC *old = CONTEXT(interp);
+ PMC *old = CURRENT_CONTEXT(interp);
PMC *ctx = Parrot_alloc_context(interp, number_regs_used, old);
- CONTEXT(interp) = ctx;
+ CURRENT_CONTEXT(interp) = ctx;
return ctx;
}
@@ -467,7 +467,7 @@
{
ASSERT_ARGS(Parrot_clear_i)
int i;
- for (i = 0; i < Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_INT); ++i)
+ for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_INT); ++i)
REG_INT(interp, i) = 0;
}
@@ -488,7 +488,7 @@
{
ASSERT_ARGS(Parrot_clear_s)
int i;
- for (i = 0; i < Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_STR); ++i)
+ for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_STR); ++i)
REG_STR(interp, i) = NULL;
}
@@ -509,7 +509,7 @@
{
ASSERT_ARGS(Parrot_clear_p)
int i;
- for (i = 0; i < Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_PMC); ++i)
+ for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_PMC); ++i)
REG_PMC(interp, i) = PMCNULL;
}
@@ -530,7 +530,7 @@
{
ASSERT_ARGS(Parrot_clear_n)
int i;
- for (i = 0; i < Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_NUM); ++i)
+ for (i = 0; i < Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_NUM); ++i)
REG_NUM(interp, i) = 0.0;
}
Modified: branches/context_pmc3/src/gc/mark_sweep.c
==============================================================================
--- branches/context_pmc3/src/gc/mark_sweep.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/gc/mark_sweep.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -199,7 +199,7 @@
Parrot_gc_mark_PObj_alive(interp, obj);
/* mark the current context. */
- Parrot_gc_mark_PObj_alive(interp, (PObj*)CONTEXT(interp));
+ Parrot_gc_mark_PObj_alive(interp, (PObj*)CURRENT_CONTEXT(interp));
/* mark the dynamic environment. */
Parrot_gc_mark_PObj_alive(interp, (PObj*)interp->dynamic_env);
Modified: branches/context_pmc3/src/global.c
==============================================================================
--- branches/context_pmc3/src/global.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/global.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -375,10 +375,10 @@
ASSERT_ARGS(Parrot_make_namespace_autobase)
PMC *base_ns;
if (VTABLE_isa(interp, key, CONST_STRING(interp, "String")))
- base_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ base_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
else
base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
- Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
return Parrot_make_namespace_keyed(interp, base_ns, key);
}
@@ -531,7 +531,7 @@
Parrot_find_global_cur(PARROT_INTERP, ARGIN_NULLOK(STRING *globalname))
{
ASSERT_ARGS(Parrot_find_global_cur)
- PMC * const ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
return Parrot_find_global_n(interp, ns, globalname);
}
@@ -678,7 +678,7 @@
Parrot_find_name_op(PARROT_INTERP, ARGIN(STRING *name), SHIM(void *next))
{
ASSERT_ARGS(Parrot_find_name_op)
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
PMC * const lex_pad = Parrot_find_pad(interp, name, ctx);
PMC *g;
@@ -788,7 +788,7 @@
Parrot_store_sub_in_namespace(PARROT_INTERP, ARGIN(PMC *sub_pmc))
{
ASSERT_ARGS(Parrot_store_sub_in_namespace)
- const INTVAL cur_id = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ const INTVAL cur_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
PMC *ns;
Parrot_Sub_attributes *sub;
@@ -798,7 +798,7 @@
/* store relative to HLL namespace */
PMC_get_sub(interp, sub_pmc, sub);
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), sub->HLL_id);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), sub->HLL_id);
ns = get_namespace_pmc(interp, sub_pmc);
@@ -824,7 +824,7 @@
}
/* restore HLL_id */
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), cur_id);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_id);
Parrot_unblock_GC_mark(interp);
}
Modified: branches/context_pmc3/src/global_setup.c
==============================================================================
--- branches/context_pmc3/src/global_setup.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/global_setup.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -215,7 +215,7 @@
interp->root_namespace = pmc_new(interp, enum_class_NameSpace);
Parrot_init_HLL(interp);
- Parrot_pcc_set_namespace(interp, CONTEXT(interp),
+ Parrot_pcc_set_namespace(interp, CURRENT_CONTEXT(interp),
VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0));
/* We need a class hash */
Modified: branches/context_pmc3/src/hll.c
==============================================================================
--- branches/context_pmc3/src/hll.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/hll.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -446,7 +446,7 @@
Parrot_get_ctx_HLL_type(PARROT_INTERP, INTVAL core_type)
{
ASSERT_ARGS(Parrot_get_ctx_HLL_type)
- const INTVAL hll_id = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ const INTVAL hll_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
return Parrot_get_HLL_type(interp, hll_id, core_type);
}
@@ -468,7 +468,7 @@
Parrot_get_ctx_HLL_namespace(PARROT_INTERP)
{
ASSERT_ARGS(Parrot_get_ctx_HLL_namespace)
- return Parrot_get_HLL_namespace(interp, Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ return Parrot_get_HLL_namespace(interp, Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
}
/*
Modified: branches/context_pmc3/src/interp/inter_create.c
==============================================================================
--- branches/context_pmc3/src/interp/inter_create.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/interp/inter_create.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -215,9 +215,9 @@
CURRENT_CONTEXT_FIELD(interp, recursion_depth) = (UINTVAL)-1;
/* clear context introspection vars */
- Parrot_pcc_set_sub(interp, CONTEXT(interp), NULL);
- Parrot_pcc_set_continuation(interp, CONTEXT(interp), NULL); /* TODO Use PMCNULL */
- Parrot_pcc_set_object(interp, CONTEXT(interp), NULL);
+ Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), NULL);
+ Parrot_pcc_set_continuation(interp, CURRENT_CONTEXT(interp), NULL); /* TODO Use PMCNULL */
+ Parrot_pcc_set_object(interp, CURRENT_CONTEXT(interp), NULL);
/* Load the core op func and info tables */
interp->op_lib = PARROT_CORE_OPLIB_INIT(1);
Modified: branches/context_pmc3/src/interp/inter_misc.c
==============================================================================
--- branches/context_pmc3/src/interp/inter_misc.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/interp/inter_misc.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -282,19 +282,19 @@
ASSERT_ARGS(interpinfo_p)
switch (what) {
case CURRENT_SUB:
- return Parrot_pcc_get_sub(interp, CONTEXT(interp));
+ return Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
case CURRENT_CONT:
{
- PMC * const cont = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ PMC * const cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
if (!PMC_IS_NULL(cont) && cont->vtable->base_type ==
enum_class_RetContinuation)
return VTABLE_clone(interp, cont);
return cont;
}
case CURRENT_OBJECT:
- return Parrot_pcc_get_object(interp, CONTEXT(interp));
+ return Parrot_pcc_get_object(interp, CURRENT_CONTEXT(interp));
case CURRENT_LEXPAD:
- return Parrot_pcc_get_lex_pad(interp, CONTEXT(interp));
+ return Parrot_pcc_get_lex_pad(interp, CURRENT_CONTEXT(interp));
default: /* or a warning only? */
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
"illegal argument in interpinfo");
Modified: branches/context_pmc3/src/multidispatch.c
==============================================================================
--- branches/context_pmc3/src/multidispatch.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/multidispatch.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -1229,7 +1229,8 @@
{
ASSERT_ARGS(mmd_add_multi_to_namespace)
PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
- interp->HLL_namespace, Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ interp->HLL_namespace,
+ Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
PMC * const ns = Parrot_make_namespace_keyed_str(interp, hll_ns, ns_name);
PMC *multi_sub = Parrot_get_global(interp, ns, sub_name);
Modified: branches/context_pmc3/src/oo.c
==============================================================================
--- branches/context_pmc3/src/oo.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/oo.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -209,7 +209,7 @@
{
PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
interp->HLL_namespace,
- Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
PMC * const ns = Parrot_get_namespace_keyed(interp,
hll_ns, key);
@@ -422,7 +422,7 @@
/* First check in current HLL namespace */
PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
- Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
PMC * const ns = Parrot_get_namespace_keyed_str(interp, hll_ns, name);
PMC * const _class = PMC_IS_NULL(ns)
? PMCNULL : VTABLE_get_class(interp, ns);
Modified: branches/context_pmc3/src/ops/core.ops
==============================================================================
--- branches/context_pmc3/src/ops/core.ops Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/ops/core.ops Tue Sep 1 09:22:28 2009 (r40902)
@@ -447,7 +447,7 @@
inline op yield() :flow {
opcode_t *dest = expr NEXT();
- PMC * const p = Parrot_pcc_get_sub(interp, CONTEXT(interp));
+ PMC * const p = Parrot_pcc_get_sub(interp, CURRENT_CONTEXT(interp));
dest = (opcode_t *)p->vtable->invoke(interp, p, dest);
goto ADDRESS(dest);
}
@@ -456,14 +456,14 @@
opcode_t *dest;
PMC * const p = $1;
dest = expr NEXT();
- interp->current_cont = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
dest = (opcode_t *)p->vtable->invoke(interp, p, dest);
goto ADDRESS(dest);
}
inline op returncc() :flow {
- PMC * const p = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ PMC * const p = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
opcode_t * const dest = (opcode_t *)p->vtable->invoke(interp,
p, expr NEXT());
goto ADDRESS(dest);
@@ -527,7 +527,7 @@
PMC * const signature = $1;
INTVAL argc;
- Parrot_pcc_set_results(interp, CONTEXT(interp), _this);
+ Parrot_pcc_set_results(interp, CURRENT_CONTEXT(interp), _this);
argc = VTABLE_elements(interp, signature);
goto OFFSET(argc + 2);
}
@@ -541,7 +541,7 @@
opcode_t *src_indexes, *dst_indexes;
interp->current_params = _this;
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
ccont = Parrot_pcc_get_continuation(interp, ctx);
caller_ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
@@ -573,7 +573,7 @@
opcode_t *src_indexes, *dest_indexes;
interp->current_returns = _this;
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
caller_ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
ccont = Parrot_pcc_get_continuation(interp, ctx);
@@ -614,7 +614,7 @@
inline op result_info(out PMC) {
/* Get context of callee from return continuation. */
- PMC * const cc = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ PMC * const cc = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PMC *sig = NULL;
if (cc && PMC_cont(cc)->to_ctx) {
/* caller context has results */
@@ -1466,3 +1466,5 @@
* End:
* vim: expandtab shiftwidth=4:
*/
+
+
Modified: branches/context_pmc3/src/ops/debug.ops
==============================================================================
--- branches/context_pmc3/src/ops/debug.ops Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/ops/debug.ops Tue Sep 1 09:22:28 2009 (r40902)
@@ -121,7 +121,7 @@
inline op getline(out INT) {
Parrot_Context_info info;
- Parrot_Context_get_info(interp, CONTEXT(interp), &info);
+ Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info);
$1 = info.line;
}
@@ -133,7 +133,7 @@
inline op getfile(out STR) {
Parrot_Context_info info;
- Parrot_Context_get_info(interp, CONTEXT(interp), &info);
+ Parrot_Context_get_info(interp, CURRENT_CONTEXT(interp), &info);
$1 = info.file;
}
Modified: branches/context_pmc3/src/ops/object.ops
==============================================================================
--- branches/context_pmc3/src/ops/object.ops Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/ops/object.ops Tue Sep 1 09:22:28 2009 (r40902)
@@ -142,7 +142,7 @@
VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
else {
- interp->current_cont = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
interp->current_object = object;
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
@@ -157,7 +157,7 @@
opcode_t *dest;
- interp->current_cont = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ interp->current_cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
interp->current_object = object;
dest = (opcode_t *)VTABLE_invoke(interp, method_pmc, next);
Modified: branches/context_pmc3/src/ops/pic.ops
==============================================================================
--- branches/context_pmc3/src/ops/pic.ops Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/ops/pic.ops Tue Sep 1 09:22:28 2009 (r40902)
@@ -138,7 +138,7 @@
/* avoid load dependencies - intermix derefs
* - yes, confusing but faster
*/
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
src_pc = interp->current_args;
mic = (Parrot_MIC *) cur_opcode[1];
caller_ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
@@ -187,7 +187,7 @@
Parrot_cont *cc;
int n;
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
mic = (Parrot_MIC *) cur_opcode[1];
ccont = Parrot_pcc_get_continuation(interp, ctx);
cc = PMC_cont(ccont);
@@ -245,7 +245,7 @@
INTVAL i, n_args, *sig_bits;
PMC *sig;
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
mic = (Parrot_MIC *) cur_opcode[1];
/* get_results */
pc = Parrot_pcc_get_results(interp, ctx);
Modified: branches/context_pmc3/src/ops/var.ops
==============================================================================
--- branches/context_pmc3/src/ops/var.ops Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/ops/var.ops Tue Sep 1 09:22:28 2009 (r40902)
@@ -37,7 +37,7 @@
=cut
op store_lex(in STR, invar PMC) {
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
STRING * const lex_name = $1;
PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx);
@@ -62,7 +62,7 @@
=cut
op find_lex(out PMC, in STR) {
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
STRING * const lex_name = $2;
PMC * const lex_pad = Parrot_find_pad(interp, lex_name, ctx);
@@ -92,7 +92,7 @@
op find_caller_lex(out PMC, in STR) {
STRING * const lex_name = $2;
- PMC * ctx = CONTEXT(interp);
+ PMC * ctx = CURRENT_CONTEXT(interp);
PMC * result = PMCNULL;
for (ctx = Parrot_pcc_get_caller_ctx(interp, ctx);
@@ -130,12 +130,12 @@
=cut
op get_namespace(out PMC) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
$1 = cur_ns;
}
op get_namespace(out PMC, in PMC) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
PMC * const ns = Parrot_get_namespace_keyed(interp, cur_ns, $2);
$1 = PMC_IS_NULL(ns) ? PMCNULL : ns;
@@ -218,12 +218,12 @@
=cut
op get_global(out PMC, in STR) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
$1 = Parrot_find_global_op(interp, cur_ns, $2, expr NEXT());
}
op get_global(out PMC, in PMC, in STR) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
if (PMC_IS_NULL(cur_ns)) {
$1 = PMCNULL;
}
@@ -322,12 +322,12 @@
=cut
op set_global(in STR, invar PMC) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
Parrot_set_global(interp, cur_ns, $1, $2);
}
op set_global(in PMC, in STR, invar PMC) {
- PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CONTEXT(interp));
+ PMC * const cur_ns = Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp));
PMC * const ns = Parrot_make_namespace_keyed(interp, cur_ns, $1);
Parrot_set_global(interp, ns, $2, $3);
Modified: branches/context_pmc3/src/packfile.c
==============================================================================
--- branches/context_pmc3/src/packfile.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/packfile.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -681,7 +681,8 @@
&& interp->run_core != PARROT_FAST_CORE)
interp->run_core = PARROT_FAST_CORE;
- Parrot_pcc_set_constants(interp, CONTEXT(interp), interp->code->const_table->constants);
+ Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp),
+ interp->code->const_table->constants);
retval = (PMC *)Parrot_runops_fromc_args(interp, sub_pmc, "P");
interp->run_core = old;
@@ -759,7 +760,7 @@
/ sizeof (opcode_t *);
PObj_get_FLAGS(sub_pmc) &= ~SUB_FLAG_PF_MAIN;
- Parrot_pcc_set_sub(interp, CONTEXT(interp), sub_pmc);
+ Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc);
}
else {
Parrot_warn(interp, PARROT_WARNINGS_ALL_FLAG,
@@ -3083,12 +3084,12 @@
}
interp->code = new_cs;
- Parrot_pcc_set_constants(interp, CONTEXT(interp), really
+ Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), really
? find_constants(interp, new_cs->const_table)
: new_cs->const_table->constants);
/* new_cs->const_table->constants; */
- Parrot_pcc_set_pred_offset(interp, CONTEXT(interp),
+ Parrot_pcc_set_pred_offset(interp, CURRENT_CONTEXT(interp),
new_cs->base.data - (opcode_t*) new_cs->prederef.code);
if (really)
Modified: branches/context_pmc3/src/pic.c
==============================================================================
--- branches/context_pmc3/src/pic.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pic.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -698,7 +698,7 @@
PMC *caller_ctx;
opcode_t *args;
PMC * const sig1 = (PMC *)(pc[1]);
- PMC *ctx = CONTEXT(interp);
+ PMC *ctx = CURRENT_CONTEXT(interp);
int type = 0;
/* check params */
@@ -799,7 +799,7 @@
opcode_t *op, n;
int flags;
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
PMC * const sig_args = (PMC *)(pc[1]);
ASSERT_SIG_PMC(sig_args);
Modified: branches/context_pmc3/src/pmc.c
==============================================================================
--- branches/context_pmc3/src/pmc.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -889,7 +889,7 @@
/* anchor at parent, aka current_namespace, that is 'parrot' */
VTABLE_set_pmc_keyed_str(interp,
- Parrot_pcc_get_namespace(interp, CONTEXT(interp)), class_name, ns);
+ Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)), class_name, ns);
}
_class = vtable->pmc_class;
Modified: branches/context_pmc3/src/pmc/class.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/class.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/class.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -197,7 +197,7 @@
}
else {
PMC * const hll_ns = VTABLE_get_pmc_keyed_int(interp,
- interp->HLL_namespace, Parrot_pcc_get_HLL(interp, CONTEXT(interp)));
+ interp->HLL_namespace, Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp)));
new_namespace = Parrot_make_namespace_keyed(interp, hll_ns, name_arg);
}
@@ -1168,13 +1168,13 @@
/* Check that we have all methods listed in resolve list. */
const int resolve_count = VTABLE_elements(interp,
_class->resolve_method);
- const INTVAL cur_hll = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ const INTVAL cur_hll = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
const INTVAL num_parents = VTABLE_elements(interp, _class->parents);
INTVAL mro_length;
int i;
/* don't use HLL mappings for internal-only data */
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), 0);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), 0);
for (i = 0; i < resolve_count; i++) {
STRING * const check_meth =
@@ -1211,7 +1211,7 @@
}
}
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), cur_hll);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
}
/* Set instantiated flag. */
Modified: branches/context_pmc3/src/pmc/continuation.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/continuation.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/continuation.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -221,7 +221,7 @@
VTABLE opcode_t *invoke(void *next) {
Parrot_cont *cc = PMC_cont(SELF);
- PMC *from_ctx = CONTEXT(interp);
+ PMC *from_ctx = CURRENT_CONTEXT(interp);
PMC *to_ctx = cc->to_ctx;
opcode_t *pc = cc->address;
UNUSED(next)
Modified: branches/context_pmc3/src/pmc/coroutine.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/coroutine.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/coroutine.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -143,7 +143,7 @@
"tail call to coro not allowed");
/* first time set current sub, cont, object */
- caller_ctx = CONTEXT(interp);
+ caller_ctx = CURRENT_CONTEXT(interp);
ctx = Parrot_set_new_context(INTERP, co->n_regs_used);
co->ctx = ctx;
@@ -186,11 +186,11 @@
/* and the recent call context */
ccont = Parrot_pcc_get_continuation(INTERP, ctx);
- PMC_cont(ccont)->to_ctx = CONTEXT(interp);
- Parrot_pcc_set_caller_ctx(interp, ctx, CONTEXT(interp));
+ PMC_cont(ccont)->to_ctx = CURRENT_CONTEXT(interp);
+ Parrot_pcc_set_caller_ctx(interp, ctx, CURRENT_CONTEXT(interp));
/* set context to coro context */
- CONTEXT(interp) = ctx;
+ CURRENT_CONTEXT(interp) = ctx;
}
else {
PMC *ccont;
@@ -213,7 +213,7 @@
"Cannot resume dead coroutine.");
}
- CONTEXT(interp) = ctx;
+ CURRENT_CONTEXT(interp) = ctx;
}
/* toggle address */
Modified: branches/context_pmc3/src/pmc/exporter.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/exporter.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/exporter.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -109,7 +109,7 @@
VTABLE void init() {
/* Set up the object. */
SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
- SET_ATTR_ns_dest(INTERP, SELF, Parrot_pcc_get_namespace(INTERP, CONTEXT(INTERP)));
+ SET_ATTR_ns_dest(INTERP, SELF, Parrot_pcc_get_namespace(INTERP, CURRENT_CONTEXT(INTERP)));
SET_ATTR_globals(INTERP, SELF, PMCNULL);
/* Set flags for custom GC mark and destroy. */
Modified: branches/context_pmc3/src/pmc/nci.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/nci.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/nci.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -346,7 +346,7 @@
*/
if (cont && cont != NEED_CONTINUATION
&& (PObj_get_FLAGS(cont) & SUB_FLAG_TAILCALL)) {
- cont = Parrot_pcc_get_continuation(interp, CONTEXT(interp));
+ cont = Parrot_pcc_get_continuation(interp, CURRENT_CONTEXT(interp));
next = VTABLE_invoke(INTERP, cont, next);
}
Modified: branches/context_pmc3/src/pmc/object.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/object.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/object.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -27,11 +27,11 @@
get_attrib_index(PARROT_INTERP, PMC *self, STRING *name)
{
Parrot_Class_attributes * const _class = PARROT_CLASS(self);
- const INTVAL cur_hll = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ const INTVAL cur_hll = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
int num_classes, i;
INTVAL retval;
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), 0);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), 0);
/* First see if we can find it in the cache. */
retval = VTABLE_get_integer_keyed_str(interp,
@@ -40,7 +40,7 @@
/* there's a semi-predicate problem with a retval of 0 */
if (retval
|| VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) {
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), cur_hll);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
return retval;
}
@@ -65,12 +65,12 @@
VTABLE_set_integer_keyed_str(interp, _class->attrib_cache, name,
index);
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), cur_hll);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
return index;
}
}
- Parrot_pcc_set_HLL(interp, CONTEXT(interp), cur_hll);
+ Parrot_pcc_set_HLL(interp, CURRENT_CONTEXT(interp), cur_hll);
return -1;
}
Modified: branches/context_pmc3/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/parrotinterpreter.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/parrotinterpreter.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -478,7 +478,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, CONTROL_ERROR,
"No such caller depth");
- ctx = CONTEXT(interp);
+ ctx = CURRENT_CONTEXT(interp);
if (outer) {
for (; level; --level) {
@@ -531,7 +531,7 @@
if (Parrot_str_equal(interp, item, s)) {
PMC *sub_pmc = Parrot_pcc_get_sub(interp, ctx);
- if (ctx == CONTEXT(interp)) {
+ if (ctx == CURRENT_CONTEXT(interp)) {
/* We can't know the current program counter for the currently
* executing sub, so can't return annotations for that. */
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -802,7 +802,7 @@
METHOD hll_map(PMC *core_type, PMC *hll_type) {
INTVAL core_type_id = VTABLE_type(INTERP, core_type);
INTVAL hll_type_id = VTABLE_type(INTERP, hll_type);
- INTVAL hll_id = Parrot_pcc_get_HLL(interp, CONTEXT(interp));
+ INTVAL hll_id = Parrot_pcc_get_HLL(interp, CURRENT_CONTEXT(interp));
Parrot_register_HLL_type(INTERP, hll_id, core_type_id, hll_type_id);
}
@@ -844,3 +844,5 @@
* End:
* vim: expandtab shiftwidth=4:
*/
+
+
Modified: branches/context_pmc3/src/pmc/role.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/role.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/role.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -102,7 +102,7 @@
/* Namespace is nested in the current namespace and with the name of
* the role. */
role->_namespace = Parrot_make_namespace_keyed_str(interp,
- Parrot_pcc_get_namespace(interp, CONTEXT(interp)), role->name);
+ Parrot_pcc_get_namespace(interp, CURRENT_CONTEXT(interp)), role->name);
}
/* Otherwise, we may just have a namespace. */
Modified: branches/context_pmc3/src/pmc/sub.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/sub.pmc Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/pmc/sub.pmc Tue Sep 1 09:22:28 2009 (r40902)
@@ -265,7 +265,7 @@
*
*/
pc = sub->seg->base.data + sub->start_offs;
- caller_ctx = CONTEXT(interp);
+ caller_ctx = CURRENT_CONTEXT(interp);
ccont = INTERP->current_cont;
INTERP->current_cont = NULL;
@@ -962,7 +962,7 @@
/* XXX This code looks very suspicious. */
/* (CONTEXT(interp)->caller_ctx->caller_ctx->current_sub */
- tmp1 = Parrot_pcc_get_caller_ctx(interp, CONTEXT(interp));
+ tmp1 = Parrot_pcc_get_caller_ctx(interp, CURRENT_CONTEXT(interp));
tmp2 = Parrot_pcc_get_caller_ctx(interp, tmp1);
if (Parrot_pcc_get_sub(interp, tmp2) == outer)
sub->outer_ctx = tmp2;
Modified: branches/context_pmc3/src/runcore/cores.c
==============================================================================
--- branches/context_pmc3/src/runcore/cores.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/runcore/cores.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -292,7 +292,7 @@
ASSERT_ARGS(runops_fast_core)
/* disable pc */
- Parrot_pcc_set_pc(interp, CONTEXT(interp), NULL);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), NULL);
while (pc) {
if (pc < code_start || pc >= code_end)
@@ -328,7 +328,7 @@
ASSERT_ARGS(runops_cgoto_core)
/* disable pc */
- Parrot_pcc_set_pc(interp, CONTEXT(interp), NULL);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), NULL);
#ifdef HAVE_COMPUTED_GOTO
pc = cg_core(pc, interp);
@@ -407,7 +407,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"attempt to access code outside of current code segment");
- Parrot_pcc_set_pc(interp, CONTEXT(interp), pc);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
DO_OP(pc, interp);
trace_op(interp, code_start, code_end, pc);
@@ -461,7 +461,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, 1,
"attempt to access code outside of current code segment");
- Parrot_pcc_set_pc(interp, CONTEXT(interp), pc);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
DO_OP(pc, interp);
}
@@ -494,7 +494,7 @@
"attempt to access code outside of current code segment");
Parrot_gc_mark_and_sweep(interp, GC_TRACE_FULL);
- Parrot_pcc_set_pc(interp, CONTEXT(interp), pc);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
DO_OP(pc, interp);
}
@@ -534,7 +534,7 @@
while (pc) {/* && pc >= code_start && pc < code_end) */
opcode_t cur_op;
- Parrot_pcc_set_pc(interp, CONTEXT(interp), pc);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
profile->cur_op = cur_op = *pc + PARROT_PROF_EXTRA;
profile->starttime = Parrot_floatval_time();
profile->data[cur_op].numcalls++;
@@ -595,7 +595,7 @@
pc);
}
- Parrot_pcc_set_pc(interp, CONTEXT(interp), pc);
+ Parrot_pcc_set_pc(interp, CURRENT_CONTEXT(interp), pc);
DO_OP(pc, interp);
if (interp->pdb->state & PDB_STOPPED) {
Modified: branches/context_pmc3/src/runcore/main.c
==============================================================================
--- branches/context_pmc3/src/runcore/main.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/runcore/main.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -188,10 +188,10 @@
ASSERT_ARGS(prederef_args)
const PackFile_ConstTable * const const_table = interp->code->const_table;
- const int regs_n = Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_NUM);
- const int regs_i = Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_INT);
- const int regs_p = Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_PMC);
- const int regs_s = Parrot_pcc_get_regs_used(interp, CONTEXT(interp), REGNO_STR);
+ const int regs_n = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_NUM);
+ const int regs_i = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_INT);
+ const int regs_p = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_PMC);
+ const int regs_s = Parrot_pcc_get_regs_used(interp, CURRENT_CONTEXT(interp), REGNO_STR);
/* prederef var part too */
const int m = opinfo->op_count;
@@ -541,7 +541,7 @@
N * sizeof (void *));
#endif
/* calc and remember pred_offset */
- Parrot_pcc_set_pred_offset(interp, CONTEXT(interp), pc - (opcode_t *)temp);
+ Parrot_pcc_set_pred_offset(interp, CURRENT_CONTEXT(interp), pc - (opcode_t *)temp);
/* fill with the prederef__ opcode function */
if (which == PARROT_SWITCH_CORE || which == PARROT_SWITCH_JIT_CORE)
Modified: branches/context_pmc3/src/scheduler.c
==============================================================================
--- branches/context_pmc3/src/scheduler.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/scheduler.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -883,7 +883,7 @@
context = (PMC *)VTABLE_get_pointer(interp, task);
}
else {
- context = CONTEXT(interp);
+ context = CURRENT_CONTEXT(interp);
if (!PMC_IS_NULL(Parrot_pcc_get_handlers(interp, context)))
iter = VTABLE_get_iter(interp, Parrot_pcc_get_handlers(interp, context));
}
Modified: branches/context_pmc3/src/sub.c
==============================================================================
--- branches/context_pmc3/src/sub.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/sub.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -66,10 +66,10 @@
{
ASSERT_ARGS(new_continuation)
Parrot_cont * const cc = mem_allocate_typed(Parrot_cont);
- PMC * const to_ctx = to ? to->to_ctx : CONTEXT(interp);
+ PMC * const to_ctx = to ? to->to_ctx : CURRENT_CONTEXT(interp);
cc->to_ctx = to_ctx;
- cc->from_ctx = CONTEXT(interp);
+ cc->from_ctx = CURRENT_CONTEXT(interp);
cc->runloop_id = 0;
if (to) {
cc->seg = to->seg;
@@ -102,8 +102,8 @@
ASSERT_ARGS(new_ret_continuation)
Parrot_cont * const cc = mem_allocate_typed(Parrot_cont);
- cc->to_ctx = CONTEXT(interp);
- cc->from_ctx = CONTEXT(interp); /* filled in during a call */
+ cc->to_ctx = CURRENT_CONTEXT(interp);
+ cc->from_ctx = CURRENT_CONTEXT(interp); /* filled in during a call */
cc->runloop_id = 0;
cc->seg = interp->code;
cc->current_results = NULL;
@@ -346,7 +346,7 @@
ASSERT_ARGS(Parrot_Context_infostr)
Parrot_Context_info info;
STRING *res = NULL;
- const char * const msg = (CONTEXT(interp) == ctx)
+ const char * const msg = (CURRENT_CONTEXT(interp) == ctx)
? "current instr.:"
: "called from Sub";
@@ -408,7 +408,7 @@
Parrot_capture_lex(PARROT_INTERP, ARGMOD(PMC *sub_pmc))
{
ASSERT_ARGS(Parrot_capture_lex)
- PMC * const ctx = CONTEXT(interp);
+ PMC * const ctx = CURRENT_CONTEXT(interp);
Parrot_Sub_attributes *current_sub;
Parrot_Sub_attributes *sub;
@@ -504,7 +504,7 @@
{
ASSERT_ARGS(Parrot_continuation_check)
PMC *to_ctx = cc->to_ctx;
- PMC *from_ctx = CONTEXT(interp);
+ PMC *from_ctx = CURRENT_CONTEXT(interp);
if (PMC_IS_NULL(to_ctx))
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
@@ -540,7 +540,7 @@
}
/* set context */
- CONTEXT(interp) = to_ctx;
+ CURRENT_CONTEXT(interp) = to_ctx;
}
Modified: branches/context_pmc3/src/warnings.c
==============================================================================
--- branches/context_pmc3/src/warnings.c Tue Sep 1 01:10:50 2009 (r40901)
+++ branches/context_pmc3/src/warnings.c Tue Sep 1 09:22:28 2009 (r40902)
@@ -53,7 +53,7 @@
interp->pdb->debugger :
interp;
Parrot_io_eprintf(tracer, "%Ss\n",
- Parrot_Context_infostr(interp, CONTEXT(interp)));
+ Parrot_Context_infostr(interp, CURRENT_CONTEXT(interp)));
}
/*
More information about the parrot-commits
mailing list