Permalink
Browse files

The compreg hash is autovivified in the Parrot_interp_set_compiler fu…

…nction. Make sure we use that function (and Parrot_interp_get_compiler) for accessing the compreg hash in the compreg_s_p and compreg_p_s ops for cases where the only compiler get/set operations are done from the pbc level. brrt++ for the find.
  • Loading branch information...
1 parent db9fc12 commit 22d7d59b80c12719651373135c9a5acb503d9331 @Whiteknight Whiteknight committed Jun 2, 2012
Showing with 6 additions and 18 deletions.
  1. +2 −6 src/ops/core.ops
  2. +4 −12 src/ops/core_ops.c
View
@@ -1409,15 +1409,11 @@ op dlvar(out PMC, invar PMC, in STR) {
}
inline op compreg(in STR, invar PMC) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp,
- interp->iglobals, IGLOBALS_COMPREG_HASH);
- VTABLE_set_pmc_keyed_str(interp, compreg_hash, $1, $2);
+ Parrot_interp_set_compiler(interp, $1, $2);
}
inline op compreg(out PMC, in STR) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp,
- interp->iglobals, IGLOBALS_COMPREG_HASH);
- $1 = VTABLE_get_pmc_keyed_str(interp, compreg_hash, $2);
+ $1 = Parrot_interp_get_compiler(interp, $2);
}
op new_callback(out PMC, invar PMC, invar PMC, in STR) {
View
@@ -14949,34 +14949,26 @@ Parrot_dlvar_p_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
opcode_t *
Parrot_compreg_s_p(opcode_t *cur_opcode, PARROT_INTERP) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH);
-
- VTABLE_set_pmc_keyed_str(interp, compreg_hash, SREG(1), PREG(2));
+ Parrot_interp_set_compiler(interp, SREG(1), PREG(2));
return cur_opcode + 3;
}
opcode_t *
Parrot_compreg_sc_p(opcode_t *cur_opcode, PARROT_INTERP) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH);
-
- VTABLE_set_pmc_keyed_str(interp, compreg_hash, SCONST(1), PREG(2));
+ Parrot_interp_set_compiler(interp, SCONST(1), PREG(2));
return cur_opcode + 3;
}
opcode_t *
Parrot_compreg_p_s(opcode_t *cur_opcode, PARROT_INTERP) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH);
-
- PREG(1) = VTABLE_get_pmc_keyed_str(interp, compreg_hash, SREG(2));
+ PREG(1) = Parrot_interp_get_compiler(interp, SREG(2));
PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
return cur_opcode + 3;
}
opcode_t *
Parrot_compreg_p_sc(opcode_t *cur_opcode, PARROT_INTERP) {
- PMC * const compreg_hash = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_COMPREG_HASH);
-
- PREG(1) = VTABLE_get_pmc_keyed_str(interp, compreg_hash, SCONST(2));
+ PREG(1) = Parrot_interp_get_compiler(interp, SCONST(2));
PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
return cur_opcode + 3;
}

0 comments on commit 22d7d59

Please sign in to comment.