From df13f259487459f3a28d31d76c890aa6c2d061e0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Aug 2019 13:59:39 -0300 Subject: First version of OP_MMBIN opcodes In arithmetic/bitwise operators, the call to metamethods is made in a separate opcode following the main one. (The main opcode skips this next one when the operation succeeds.) This change reduces slightly the size of the binary and the complexity of the arithmetic/bitwise opcodes. It also simplfies the treatment of errors and yeld/resume in these operations, as there are much fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK, instead of all variants of all arithmetic/bitwise operators.) --- ljumptab.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ljumptab.h') diff --git a/ljumptab.h b/ljumptab.h index 2d4cf28b..1832c809 100644 --- a/ljumptab.h +++ b/ljumptab.h @@ -75,6 +75,9 @@ static void *disptab[NUM_OPCODES] = { &&L_OP_BXOR, &&L_OP_SHL, &&L_OP_SHR, +&&L_OP_MMBIN, +&&L_OP_MMBINI, +&&L_OP_MMBINK, &&L_OP_UNM, &&L_OP_BNOT, &&L_OP_NOT, -- cgit v1.2.3-55-g6feb