diff options
| author | Li Jin <dragon-fly@qq.com> | 2021-08-17 23:09:27 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2021-08-17 23:09:27 +0800 |
| commit | 38908616d0e08b72e6b00d18490ed917fa643e4f (patch) | |
| tree | 4311b80a505f4c3819c8cb2c3c937296fef0356f /src/3rdParty/lua/lopcodes.h | |
| parent | 792e942f5269655ee03c48400999f3604b84396c (diff) | |
| download | yuescript-38908616d0e08b72e6b00d18490ed917fa643e4f.tar.gz yuescript-38908616d0e08b72e6b00d18490ed917fa643e4f.tar.bz2 yuescript-38908616d0e08b72e6b00d18490ed917fa643e4f.zip | |
reset Yuescript version since it's a minor version with new feature. update Lua lib.
Diffstat (limited to 'src/3rdParty/lua/lopcodes.h')
| -rw-r--r-- | src/3rdParty/lua/lopcodes.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/3rdParty/lua/lopcodes.h b/src/3rdParty/lua/lopcodes.h index d6a47e5..7c27451 100644 --- a/src/3rdParty/lua/lopcodes.h +++ b/src/3rdParty/lua/lopcodes.h | |||
| @@ -190,7 +190,8 @@ enum OpMode {iABC, iABx, iAsBx, iAx, isJ}; /* basic instruction formats */ | |||
| 190 | 190 | ||
| 191 | 191 | ||
| 192 | /* | 192 | /* |
| 193 | ** grep "ORDER OP" if you change these enums | 193 | ** Grep "ORDER OP" if you change these enums. Opcodes marked with a (*) |
| 194 | ** has extra descriptions in the notes after the enumeration. | ||
| 194 | */ | 195 | */ |
| 195 | 196 | ||
| 196 | typedef enum { | 197 | typedef enum { |
| @@ -203,7 +204,7 @@ OP_LOADF,/* A sBx R[A] := (lua_Number)sBx */ | |||
| 203 | OP_LOADK,/* A Bx R[A] := K[Bx] */ | 204 | OP_LOADK,/* A Bx R[A] := K[Bx] */ |
| 204 | OP_LOADKX,/* A R[A] := K[extra arg] */ | 205 | OP_LOADKX,/* A R[A] := K[extra arg] */ |
| 205 | OP_LOADFALSE,/* A R[A] := false */ | 206 | OP_LOADFALSE,/* A R[A] := false */ |
| 206 | OP_LFALSESKIP,/*A R[A] := false; pc++ */ | 207 | OP_LFALSESKIP,/*A R[A] := false; pc++ (*) */ |
| 207 | OP_LOADTRUE,/* A R[A] := true */ | 208 | OP_LOADTRUE,/* A R[A] := true */ |
| 208 | OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ | 209 | OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ |
| 209 | OP_GETUPVAL,/* A B R[A] := UpValue[B] */ | 210 | OP_GETUPVAL,/* A B R[A] := UpValue[B] */ |
| @@ -254,7 +255,7 @@ OP_BXOR,/* A B C R[A] := R[B] ~ R[C] */ | |||
| 254 | OP_SHL,/* A B C R[A] := R[B] << R[C] */ | 255 | OP_SHL,/* A B C R[A] := R[B] << R[C] */ |
| 255 | OP_SHR,/* A B C R[A] := R[B] >> R[C] */ | 256 | OP_SHR,/* A B C R[A] := R[B] >> R[C] */ |
| 256 | 257 | ||
| 257 | OP_MMBIN,/* A B C call C metamethod over R[A] and R[B] */ | 258 | OP_MMBIN,/* A B C call C metamethod over R[A] and R[B] (*) */ |
| 258 | OP_MMBINI,/* A sB C k call C metamethod over R[A] and sB */ | 259 | OP_MMBINI,/* A sB C k call C metamethod over R[A] and sB */ |
| 259 | OP_MMBINK,/* A B C k call C metamethod over R[A] and K[B] */ | 260 | OP_MMBINK,/* A B C k call C metamethod over R[A] and K[B] */ |
| 260 | 261 | ||
| @@ -280,7 +281,7 @@ OP_GTI,/* A sB k if ((R[A] > sB) ~= k) then pc++ */ | |||
| 280 | OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ | 281 | OP_GEI,/* A sB k if ((R[A] >= sB) ~= k) then pc++ */ |
| 281 | 282 | ||
| 282 | OP_TEST,/* A k if (not R[A] == k) then pc++ */ | 283 | OP_TEST,/* A k if (not R[A] == k) then pc++ */ |
| 283 | OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] */ | 284 | OP_TESTSET,/* A B k if (not R[B] == k) then pc++ else R[A] := R[B] (*) */ |
| 284 | 285 | ||
| 285 | OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ | 286 | OP_CALL,/* A B C R[A], ... ,R[A+C-2] := R[A](R[A+1], ... ,R[A+B-1]) */ |
| 286 | OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ | 287 | OP_TAILCALL,/* A B C k return R[A](R[A+1], ... ,R[A+B-1]) */ |
| @@ -315,6 +316,18 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | |||
| 315 | 316 | ||
| 316 | /*=========================================================================== | 317 | /*=========================================================================== |
| 317 | Notes: | 318 | Notes: |
| 319 | |||
| 320 | (*) Opcode OP_LFALSESKIP is used to convert a condition to a boolean | ||
| 321 | value, in a code equivalent to (not cond ? false : true). (It | ||
| 322 | produces false and skips the next instruction producing true.) | ||
| 323 | |||
| 324 | (*) Opcodes OP_MMBIN and variants follow each arithmetic and | ||
| 325 | bitwise opcode. If the operation succeeds, it skips this next | ||
| 326 | opcode. Otherwise, this opcode calls the corresponding metamethod. | ||
| 327 | |||
| 328 | (*) Opcode OP_TESTSET is used in short-circuit expressions that need | ||
| 329 | both to jump and to produce a value, such as (a = b or c). | ||
| 330 | |||
| 318 | (*) In OP_CALL, if (B == 0) then B = top - A. If (C == 0), then | 331 | (*) In OP_CALL, if (B == 0) then B = top - A. If (C == 0), then |
| 319 | 'top' is set to last_result+1, so next open instruction (OP_CALL, | 332 | 'top' is set to last_result+1, so next open instruction (OP_CALL, |
| 320 | OP_RETURN*, OP_SETLIST) may use 'top'. | 333 | OP_RETURN*, OP_SETLIST) may use 'top'. |
