diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-05 18:05:02 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-05 18:05:02 +1000 |
commit | c7b6fa63459d411cd7b20ea0de3dc2f4cf7e2a2f (patch) | |
tree | 9fee378f33aae9941e9ca8b80ac0ba57d01ab0cb | |
parent | f6a4dcf3871c6c5a4f9bdbfe699042dddbb8a62a (diff) | |
download | fengari-c7b6fa63459d411cd7b20ea0de3dc2f4cf7e2a2f.tar.gz fengari-c7b6fa63459d411cd7b20ea0de3dc2f4cf7e2a2f.tar.bz2 fengari-c7b6fa63459d411cd7b20ea0de3dc2f4cf7e2a2f.zip |
src/lvm.js: Optimise variable declarations
Oddly 'const' on OCi helps, but on anything else dramatically increases runtime
Otherwise the reduced scope for other variables is a tiny bit faster
-rw-r--r-- | src/lvm.js | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -98,28 +98,26 @@ const RKC = function(L, base, k, i) { }; const luaV_execute = function(L) { - let OCi = OC.OpCodesI; + const OCi = OC.OpCodesI; let ci = L.ci; - let opcode, k, base, i, ra; - var cl; ci.callstatus |= lstate.CIST_FRESH; newframe: for (;;) { assert(ci === L.ci); - cl = ci.func.value; - k = cl.p.k; - base = ci.l_base; + let cl = ci.func.value; + let k = cl.p.k; + let base = ci.l_base; - i = ci.l_savedpc[ci.pcOff++]; + let i = ci.l_savedpc[ci.pcOff++]; if (L.hookmask & (defs.LUA_MASKLINE | defs.LUA_MASKCOUNT)) { ldebug.luaG_traceexec(L); base = ci.l_base; } - ra = RA(L, base, i); - opcode = i.opcode; + let ra = RA(L, base, i); + let opcode = i.opcode; if (i.breakpoint) // TODO: remove, used until lapi return; |