Ticket #365: nci_jit_fix_tt365.patch
| File nci_jit_fix_tt365.patch, 2.9 KB (added by cotto, 4 years ago) |
|---|
-
src/pmc/nci.pmc
171 171 PObj_flag_SET(private2, SELF); 172 172 } 173 173 174 VTABLE void *get_pointer() { 175 return PARROT_NCI(SELF)->orig_func; 176 } 177 174 178 VTABLE void set_pointer_keyed_str(STRING *key, void *func) { 175 179 Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF); 176 180 int jitted = 0; … … 260 264 nci_info_ret->pcc_params_signature = nci_info_self->pcc_params_signature; 261 265 nci_info_ret->arity = nci_info_self->arity; 262 266 nci_info_ret->jitted = nci_info_self->jitted; 263 PObj_get_FLAGS(ret) |= (PObj_get_FLAGS(SELF) & 0x7);267 PObj_get_FLAGS(ret) |= (PObj_get_FLAGS(SELF) & 0x7); 264 268 265 269 return ret; 266 270 } … … 312 316 313 317 nci_jit_sub_t jit_func = (nci_jit_sub_t) D2FPTR(nci_info->func); 314 318 315 /* TT #365 - Some i386 jit code depends on this. If t/pmc/nci.t316 * passes without it, the next line is safe to remove. */317 PMC_struct_val(SELF) = nci_info->orig_func;318 319 319 /* Parrot_eprintf(interp, "JITTED %S\n", nci_info->signature); */ 320 jit_func(INTERP, SELF, 321 (char *) nci_info->pcc_params_signature->strstart); 320 jit_func(INTERP, SELF, (char *) nci_info->pcc_params_signature->strstart); 322 321 } 323 322 else { 324 323 if (PObj_flag_TEST(private2, SELF)) { -
src/jit/i386/jit_defs.c
2314 2314 sig++; 2315 2315 } 2316 2316 2317 /* prepare to call VTABLE_get_pointer, set up args */ 2318 /* interpreter - movl 8(%ebp), %eax */ 2319 emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 8); 2320 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 0); 2321 2322 /* pmc - movl 12(%ebp), %eax */ 2323 emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 12); 2324 emitm_movl_r_m(interp, pc, emit_EAX, emit_EBP, 0, 1, temp_calls_offset + 4); 2325 2326 /* get the get_pointer() pointer from the pmc's vtable */ 2327 emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(PMC, vtable)); 2328 emitm_movl_m_r(interp, pc, emit_EAX, emit_EAX, 0, 1, offsetof(VTABLE, get_pointer)); 2329 2330 /* call get_pointer(), result goes into eax */ 2331 emitm_callr(pc, emit_EAX); 2317 2332 emitm_addl_i_r(pc, 16, emit_ESP); 2318 /* get the pmc from stack - movl 12(%ebp), %eax */ 2319 emitm_movl_m_r(interp, pc, emit_EAX, emit_EBP, 0, 1, 12);2320 emitm_call m(pc, emit_EAX, emit_None, emit_None, 0);2333 2334 /* call the resulting function pointer */ 2335 emitm_callr(pc, emit_EAX); 2321 2336 emitm_subl_i_r(pc, 16, emit_ESP); 2322 2337 2323 2338 /* SAVE OFF EAX */
