diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-16 15:44:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-16 15:44:37 -0300 |
commit | 4846f7e3bb1397142ab0de808ae59c08db9832a6 (patch) | |
tree | de10475ba2b2f0713edc91f5bff801bd7eaa0b3d /lopcodes.h | |
parent | c220b0a5d099372e58e517b9f13eaa7bb0bec45c (diff) | |
download | lua-4846f7e3bb1397142ab0de808ae59c08db9832a6.tar.gz lua-4846f7e3bb1397142ab0de808ae59c08db9832a6.tar.bz2 lua-4846f7e3bb1397142ab0de808ae59c08db9832a6.zip |
Micro optimization in OP_RETURN and OP_TAILCALL
Many functions are vararg but create no upvalues, so it is better
to separate the tests for these two kinds of "extra work".
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -338,10 +338,9 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | |||
338 | (*) All 'skips' (pc++) assume that next instruction is a jump. | 338 | (*) All 'skips' (pc++) assume that next instruction is a jump. |
339 | 339 | ||
340 | (*) In instructions OP_RETURN/OP_TAILCALL, 'k' specifies that the | 340 | (*) In instructions OP_RETURN/OP_TAILCALL, 'k' specifies that the |
341 | function either builds upvalues, which may need to be closed, or is | 341 | function builds upvalues, which may need to be closed. C > 0 means |
342 | vararg, which must be corrected before returning. When 'k' is true, | 342 | the function is vararg, so that its 'func' must be corrected before |
343 | C > 0 means the function is vararg and (C - 1) is its number of | 343 | returning; in this case, (C - 1) is its number of fixed parameters. |
344 | fixed parameters. | ||
345 | 344 | ||
346 | (*) In comparisons with an immediate operand, C signals whether the | 345 | (*) In comparisons with an immediate operand, C signals whether the |
347 | original operand was a float. | 346 | original operand was a float. |