Author: chromatic
Date: Thu Mar 20 17:05:28 2008
New Revision: 26507
Modified:
trunk/src/jit/ppc/core.jit
Log:
[JIT] Applied CONTEXT() macro changes to PPC JIT, which I somehow missed in
r26491. This patch fixes RT #51912.
Modified: trunk/src/jit/ppc/core.jit
==============================================================================
--- trunk/src/jit/ppc/core.jit (original)
+++ trunk/src/jit/ppc/core.jit Thu Mar 20 17:05:28 2008
@@ -1258,30 +1258,28 @@
}
Parrot_pic_callr___pc {
- int offset, here, op_i;
- PackFile_Constant ** constants;
- PMC *sig_params, *sig_result;
- opcode_t *params;
- int skip;
-
- constants = CONTEXT(interp->ctx)->constants;
- params = jit_info->optimizer->sections->begin;
- sig_params = constants[params[1]]->u.key;
- op_i = 2 + SIG_ELEMS(sig_params);
+ PackFile_Constant **constants = CONTEXT(interp)->constants;
+ PMC *sig_result = constants[CUR_OPCODE[1]]->u.key;
+ opcode_t *params = jit_info->optimizer->sections->begin;
+ PMC *sig_params = constants[params[1]]->u.key;
+ int op_i = SIG_ELEMS(sig_params) + 2;
+ int offset = jit_info->arena.op_map[op_i].offset;
+ int here = NATIVECODE - jit_info->arena.start;
+ int skip;
- offset = jit_info->arena.op_map[op_i].offset;
/* TODO preserve necessary regs */
assert(*CUR_OPCODE == PARROT_OP_get_results_pc);
- constants = CONTEXT(interp->ctx)->constants;
- sig_result = constants[CUR_OPCODE[1]]->u.key;
+
if (!SIG_ELEMS(sig_result))
- skip = -1;
+ skip = -1;
+ /* skip result - save rest */
else
- skip = MAP(2); /* skip result - save rest */
+ skip = MAP(2);
- here = NATIVECODE - jit_info->arena.start;
offset -= here;
- _emit_bx(NATIVECODE, 1, offset); /* bl */
+
+ /* bl */
+ _emit_bx(NATIVECODE, 1, offset);
jit_restore_regs_call(jit_info, interp, skip);
}
@@ -1302,13 +1300,12 @@
offsetof(parrot_context_t, current_results), ISR2);
}
else {
- PackFile_Constant ** constants;
- PMC *sig_result;
+ PackFile_Constant **constants = CONTEXT(interp)->constants;
+ PMC *sig_result = constants[CUR_OPCODE[1]]->u.key;
- constants = CONTEXT(interp->ctx)->constants;
- sig_result = constants[CUR_OPCODE[1]]->u.key;
if (!SIG_ELEMS(sig_result))
return;
+
/* result is r3 TODO Nums */
jit_emit_mov_rr(NATIVECODE, MAP(2), r3);
}