From d388c165ef79cb9c668e28fa92242ffbc0430e54 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Dec 2017 15:53:50 -0200 Subject: new opcodes 'FORLOOP1'/'FORPREP1' for "basic for" (integer variable with increment of 1) --- lopcodes.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index c3269dff..ec880703 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -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)