diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-18 15:53:50 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-12-18 15:53:50 -0200 |
commit | d388c165ef79cb9c668e28fa92242ffbc0430e54 (patch) | |
tree | c10d2aee1d049d9c430ac9bebe810e9e733a8acb /lopcodes.h | |
parent | ab07005568a399f2e97996677472d9e6e69c9f4f (diff) | |
download | lua-d388c165ef79cb9c668e28fa92242ffbc0430e54.tar.gz lua-d388c165ef79cb9c668e28fa92242ffbc0430e54.tar.bz2 lua-d388c165ef79cb9c668e28fa92242ffbc0430e54.zip |
new opcodes 'FORLOOP1'/'FORPREP1' for "basic for" (integer variable
with increment of 1)
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.178 2017/12/15 18:35:22 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.179 2017/12/15 18:53:48 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -267,6 +267,10 @@ OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ | |||
267 | OP_RETURN0,/* return */ | 267 | OP_RETURN0,/* return */ |
268 | OP_RETURN1,/* A return R(A) */ | 268 | OP_RETURN1,/* A return R(A) */ |
269 | 269 | ||
270 | OP_FORLOOP1,/* A Bx R(A)++; | ||
271 | if R(A) <= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */ | ||
272 | OP_FORPREP1,/* A Bx R(A)--; pc+=Bx */ | ||
273 | |||
270 | OP_FORLOOP,/* A Bx R(A)+=R(A+2); | 274 | OP_FORLOOP,/* A Bx R(A)+=R(A+2); |
271 | if R(A) <?= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */ | 275 | if R(A) <?= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */ |
272 | OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */ | 276 | OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */ |