From 4846f7e3bb1397142ab0de808ae59c08db9832a6 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 16 Jul 2019 15:44:37 -0300 Subject: 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". --- lopcodes.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index 371cb3ae..26b1850d 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -338,10 +338,9 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ (*) All 'skips' (pc++) assume that next instruction is a jump. (*) In instructions OP_RETURN/OP_TAILCALL, 'k' specifies that the - function either builds upvalues, which may need to be closed, or is - vararg, which must be corrected before returning. When 'k' is true, - C > 0 means the function is vararg and (C - 1) is its number of - fixed parameters. + function builds upvalues, which may need to be closed. C > 0 means + the function is vararg, so that its 'func' must be corrected before + returning; in this case, (C - 1) is its number of fixed parameters. (*) In comparisons with an immediate operand, C signals whether the original operand was a float. -- cgit v1.2.3-55-g6feb