diff options
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r-- | src/lj_trace.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c index ae88f844..3773cffe 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c | |||
@@ -163,6 +163,7 @@ static void trace_unpatch(jit_State *J, Trace *T) | |||
163 | BCOp op = bc_op(T->startins); | 163 | BCOp op = bc_op(T->startins); |
164 | MSize pcofs = T->snap[0].mapofs + T->snap[0].nent; | 164 | MSize pcofs = T->snap[0].mapofs + T->snap[0].nent; |
165 | BCIns *pc = ((BCIns *)snap_pc(T->snapmap[pcofs])) - 1; | 165 | BCIns *pc = ((BCIns *)snap_pc(T->snapmap[pcofs])) - 1; |
166 | UNUSED(J); | ||
166 | switch (op) { | 167 | switch (op) { |
167 | case BC_FORL: | 168 | case BC_FORL: |
168 | lua_assert(bc_op(*pc) == BC_JFORI); | 169 | lua_assert(bc_op(*pc) == BC_JFORI); |
@@ -181,8 +182,9 @@ static void trace_unpatch(jit_State *J, Trace *T) | |||
181 | lua_assert(bc_op(*pc) == BC_JITERL && J->trace[bc_d(*pc)] == T); | 182 | lua_assert(bc_op(*pc) == BC_JITERL && J->trace[bc_d(*pc)] == T); |
182 | *pc = T->startins; | 183 | *pc = T->startins; |
183 | break; | 184 | break; |
184 | case BC_CALL: | 185 | case BC_FUNCF: |
185 | lj_trace_err(J, LJ_TRERR_NYILNKF); | 186 | lua_assert(bc_op(*pc) == BC_JFUNCF && J->trace[bc_d(*pc)] == T); |
187 | *pc = T->startins; | ||
186 | break; | 188 | break; |
187 | case BC_JMP: /* No need to unpatch branches in parent traces (yet). */ | 189 | case BC_JMP: /* No need to unpatch branches in parent traces (yet). */ |
188 | default: | 190 | default: |
@@ -384,6 +386,7 @@ static void trace_stop(jit_State *J) | |||
384 | /* fallthrough */ | 386 | /* fallthrough */ |
385 | case BC_LOOP: | 387 | case BC_LOOP: |
386 | case BC_ITERL: | 388 | case BC_ITERL: |
389 | case BC_FUNCF: | ||
387 | /* Patch bytecode of starting instruction in root trace. */ | 390 | /* Patch bytecode of starting instruction in root trace. */ |
388 | setbc_op(pc, (int)op+(int)BC_JLOOP-(int)BC_LOOP); | 391 | setbc_op(pc, (int)op+(int)BC_JLOOP-(int)BC_LOOP); |
389 | setbc_d(pc, J->curtrace); | 392 | setbc_d(pc, J->curtrace); |
@@ -391,9 +394,6 @@ static void trace_stop(jit_State *J) | |||
391 | J->cur.nextroot = pt->trace; | 394 | J->cur.nextroot = pt->trace; |
392 | pt->trace = (TraceNo1)J->curtrace; | 395 | pt->trace = (TraceNo1)J->curtrace; |
393 | break; | 396 | break; |
394 | case BC_CALL: | ||
395 | lj_trace_err(J, LJ_TRERR_NYILNKF); | ||
396 | break; | ||
397 | case BC_JMP: | 397 | case BC_JMP: |
398 | /* Patch exit branch in parent to side trace entry. */ | 398 | /* Patch exit branch in parent to side trace entry. */ |
399 | lua_assert(J->parent != 0 && J->cur.root != 0); | 399 | lua_assert(J->parent != 0 && J->cur.root != 0); |