diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-05 20:39:12 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-02-05 20:39:12 -0200 |
| commit | 38b0e6128da7796300e2e8621e87835e16539f5b (patch) | |
| tree | 5b0a7ad2b0fb850d47f0566fd06b8cda013bbc8b /lcode.c | |
| parent | addbe8c8b0587fd316f33fb013034e035f9217ed (diff) | |
| download | lua-38b0e6128da7796300e2e8621e87835e16539f5b.tar.gz lua-38b0e6128da7796300e2e8621e87835e16539f5b.tar.bz2 lua-38b0e6128da7796300e2e8621e87835e16539f5b.zip | |
simpler implementation for `for' loops
Diffstat (limited to 'lcode.c')
| -rw-r--r-- | lcode.c | 11 |
1 files changed, 0 insertions, 11 deletions
| @@ -77,17 +77,6 @@ static void luaK_fixjump (FuncState *fs, int pc, int dest) { | |||
| 77 | 77 | ||
| 78 | 78 | ||
| 79 | /* | 79 | /* |
| 80 | ** prep-for instructions (OP_FORPREP & OP_TFORPREP) have a negated jump, | ||
| 81 | ** as they simulate the real jump... | ||
| 82 | */ | ||
| 83 | void luaK_fixfor (FuncState *fs, int pc, int dest) { | ||
| 84 | Instruction *jmp = &fs->f->code[pc]; | ||
| 85 | int offset = dest-(pc+1); | ||
| 86 | SETARG_sBc(*jmp, -offset); | ||
| 87 | } | ||
| 88 | |||
| 89 | |||
| 90 | /* | ||
| 91 | ** returns current `pc' and marks it as a jump target (to avoid wrong | 80 | ** returns current `pc' and marks it as a jump target (to avoid wrong |
| 92 | ** optimizations with consecutive instructions not in the same basic block). | 81 | ** optimizations with consecutive instructions not in the same basic block). |
| 93 | ** discharge list of jumps to last target. | 82 | ** discharge list of jumps to last target. |
