aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-18 15:53:50 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-12-18 15:53:50 -0200
commitd388c165ef79cb9c668e28fa92242ffbc0430e54 (patch)
treec10d2aee1d049d9c430ac9bebe810e9e733a8acb /lopcodes.h
parentab07005568a399f2e97996677472d9e6e69c9f4f (diff)
downloadlua-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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lopcodes.h b/lopcodes.h
index c3269dff..ec880703 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -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) */
267OP_RETURN0,/* return */ 267OP_RETURN0,/* return */
268OP_RETURN1,/* A return R(A) */ 268OP_RETURN1,/* A return R(A) */
269 269
270OP_FORLOOP1,/* A Bx R(A)++;
271 if R(A) <= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */
272OP_FORPREP1,/* A Bx R(A)--; pc+=Bx */
273
270OP_FORLOOP,/* A Bx R(A)+=R(A+2); 274OP_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) } */
272OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */ 276OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */