aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2025-09-24 18:33:08 -0300
committerRoberto I <roberto@inf.puc-rio.br>2025-09-24 18:33:08 -0300
commit25c54fe60e22d05cdfaa48c64372d354efa59547 (patch)
tree3ccaeded5e4363db358f73b7c8fc6b9f414a2f2a /lopcodes.h
parent0cc3c9447cca9abae9738ee77c24d88801c3916c (diff)
downloadlua-25c54fe60e22d05cdfaa48c64372d354efa59547.tar.gz
lua-25c54fe60e22d05cdfaa48c64372d354efa59547.tar.bz2
lua-25c54fe60e22d05cdfaa48c64372d354efa59547.zip
Optimization for vararg tables
A vararg table can be virtual. If the vararg table is used only as a base in indexing expressions, the code does not need to create an actual table for it. Instead, it compiles the indexing expressions into direct accesses to the internal vararg data.
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lopcodes.h b/lopcodes.h
index c3f7f64d..82bba721 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -338,6 +338,8 @@ OP_CLOSURE,/* A Bx R[A] := closure(KPROTO[Bx]) */
338 338
339OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */ 339OP_VARARG,/* A C R[A], R[A+1], ..., R[A+C-2] = vararg */
340 340
341OP_GETVARG, /* A B C R[A] := R[B][R[C]], R[B] is vararg parameter */
342
341OP_VARARGPREP,/* (adjust vararg parameters) */ 343OP_VARARGPREP,/* (adjust vararg parameters) */
342 344
343OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ 345OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */