new opcodes 'FORLOOP1'/'FORPREP1' for "basic for" (integer variable
with increment of 1)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lopcodes.h,v 1.178 2017/12/15 18:35:22 roberto Exp roberto $
|
||||
** $Id: lopcodes.h,v 1.179 2017/12/15 18:53:48 roberto Exp roberto $
|
||||
** Opcodes for Lua virtual machine
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -267,6 +267,10 @@ OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */
|
||||
OP_RETURN0,/* return */
|
||||
OP_RETURN1,/* A return R(A) */
|
||||
|
||||
OP_FORLOOP1,/* A Bx R(A)++;
|
||||
if R(A) <= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */
|
||||
OP_FORPREP1,/* A Bx R(A)--; pc+=Bx */
|
||||
|
||||
OP_FORLOOP,/* A Bx R(A)+=R(A+2);
|
||||
if R(A) <?= R(A+1) then { pc-=Bx; R(A+3)=R(A) } */
|
||||
OP_FORPREP,/* A Bx R(A)-=R(A+2); pc+=Bx */
|
||||
|
||||
Reference in New Issue
Block a user