Ticket #1635: loopunroll.patch
| File loopunroll.patch, 2.0 KB (added by NotFound, 3 years ago) |
|---|
-
src/pmc/exceptionhandler.pmc
32 32 ATTR PMC *handled_types_except; 33 33 ATTR INTVAL min_severity; 34 34 ATTR INTVAL max_severity; 35 ATTR void *runloop_from; 35 36 36 37 /* 37 38 … … 112 113 return PARROT_CONTINUATION(SELF)->invoked; 113 114 } 114 115 116 VTABLE void set_pointer(void *value) { 117 SUPER(value); 118 SET_ATTR_runloop_from(INTERP, SELF, INTERP->current_runloop); 119 } 120 115 121 /* 116 122 117 123 =item C<opcode_t *invoke(void *next)> … … 300 306 : PMCNULL; 301 307 } 302 308 309 310 METHOD rewind(INTVAL pos) { 311 INTVAL cid = INTERP->current_runloop_id; 312 INTVAL rid; 313 GET_ATTR_runloop_id(INTERP, SELF, rid); 314 if (rid != cid) { 315 void *vrl; 316 Parrot_runloop *rl, *cur, *old; 317 Parrot_eprintf(INTERP, "rid: %d cid: %d\n", rid, cid); 318 GET_ATTR_runloop_from(INTERP, SELF, vrl); 319 rl = (Parrot_runloop *)vrl; 320 while (INTERP->current_runloop != rl) 321 free_runloop_jump_point(INTERP); 322 rl->handler_start = (opcode_t *)pos; 323 longjmp(rl->resume, 3); 324 } 325 } 326 303 327 } 304 328 305 329 /* -
src/call/ops.c
105 105 offset = interp->current_runloop->handler_start - interp->code->base.data; 106 106 /* Prevent incorrect reuse */ 107 107 goto reenter; 108 case 3: 109 /* runloop rewind from exception handling */ 110 offset = interp->current_runloop->handler_start - interp->code->base.data; 111 interp->current_runloop_level = our_runloop_level; 112 interp->current_runloop_id = our_runloop_id; 113 goto reenter; 108 114 default: 109 115 break; 110 116 }
