diff options
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 34 |
1 files changed, 0 insertions, 34 deletions
@@ -276,40 +276,6 @@ void luaK_patchtohere (FuncState *fs, int list) { | |||
276 | 276 | ||
277 | 277 | ||
278 | /* | 278 | /* |
279 | ** Correct a jump list to jump to 'target'. If 'hasclose' is true, | ||
280 | ** 'target' contains an OP_CLOSE instruction (see first assert). | ||
281 | ** Only the jumps with ('m' == true) need that close; other jumps | ||
282 | ** avoid it jumping to the next instruction. | ||
283 | */ | ||
284 | void luaK_patchgoto (FuncState *fs, int list, int target, int hasclose) { | ||
285 | lua_assert(!hasclose || GET_OPCODE(fs->f->code[target]) == OP_CLOSE); | ||
286 | while (list != NO_JUMP) { | ||
287 | int next = getjump(fs, list); | ||
288 | lua_assert(!GETARG_m(fs->f->code[list]) || hasclose); | ||
289 | patchtestreg(fs, list, NO_REG); /* do not generate values */ | ||
290 | if (!hasclose || GETARG_m(fs->f->code[list])) | ||
291 | fixjump(fs, list, target); | ||
292 | else /* there is a CLOSE instruction but jump does not need it */ | ||
293 | fixjump(fs, list, target + 1); /* avoid CLOSE instruction */ | ||
294 | list = next; | ||
295 | } | ||
296 | } | ||
297 | |||
298 | |||
299 | /* | ||
300 | ** Mark (using the 'm' arg) all jumps in 'list' to close upvalues. Mark | ||
301 | ** will instruct 'luaK_patchgoto' to make these jumps go to OP_CLOSE | ||
302 | ** instructions. | ||
303 | */ | ||
304 | void luaK_patchclose (FuncState *fs, int list) { | ||
305 | for (; list != NO_JUMP; list = getjump(fs, list)) { | ||
306 | lua_assert(GET_OPCODE(fs->f->code[list]) == OP_JMP); | ||
307 | SETARG_m(fs->f->code[list], 1); | ||
308 | } | ||
309 | } | ||
310 | |||
311 | |||
312 | /* | ||
313 | ** MAXimum number of successive Instructions WiTHout ABSolute line | 279 | ** MAXimum number of successive Instructions WiTHout ABSolute line |
314 | ** information. | 280 | ** information. |
315 | */ | 281 | */ |