diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 16:13:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-07-12 16:13:50 -0300 |
commit | 1fb4d539254b67e7e35ed698250c66d1edff0e08 (patch) | |
tree | 8f48b7ca736a7fb02834bcfac1415cd43307f529 /testes/code.lua | |
parent | f6aab3ec1f111cd8d968bdcb7ca800e93b819d24 (diff) | |
download | lua-1fb4d539254b67e7e35ed698250c66d1edff0e08.tar.gz lua-1fb4d539254b67e7e35ed698250c66d1edff0e08.tar.bz2 lua-1fb4d539254b67e7e35ed698250c66d1edff0e08.zip |
OP_NEWTABLE keeps exact size of arrays
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep
the exact size of the array part of the table to be created.
(Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
Diffstat (limited to 'testes/code.lua')
-rw-r--r-- | testes/code.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testes/code.lua b/testes/code.lua index 49d682f8..b2702c61 100644 --- a/testes/code.lua +++ b/testes/code.lua | |||
@@ -93,11 +93,13 @@ end | |||
93 | -- some basic instructions | 93 | -- some basic instructions |
94 | check(function () -- function does not create upvalues | 94 | check(function () -- function does not create upvalues |
95 | (function () end){f()} | 95 | (function () end){f()} |
96 | end, 'CLOSURE', 'NEWTABLE', 'GETTABUP', 'CALL', 'SETLIST', 'CALL', 'RETURN0') | 96 | end, 'CLOSURE', 'NEWTABLE', 'EXTRAARG', 'GETTABUP', 'CALL', |
97 | 'SETLIST', 'CALL', 'RETURN0') | ||
97 | 98 | ||
98 | check(function (x) -- function creates upvalues | 99 | check(function (x) -- function creates upvalues |
99 | (function () return x end){f()} | 100 | (function () return x end){f()} |
100 | end, 'CLOSURE', 'NEWTABLE', 'GETTABUP', 'CALL', 'SETLIST', 'CALL', 'RETURN') | 101 | end, 'CLOSURE', 'NEWTABLE', 'EXTRAARG', 'GETTABUP', 'CALL', |
102 | 'SETLIST', 'CALL', 'RETURN') | ||
101 | 103 | ||
102 | 104 | ||
103 | -- sequence of LOADNILs | 105 | -- sequence of LOADNILs |