aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-13 14:43:40 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-13 14:43:40 -0800
commit2e55061621e16964e244906c3236797408aee119 (patch)
tree676342deb4e9562880527556e8dcccd6ee0c637a /src/parseTools.js
parentc4978b6c248bc076850743df2ba6b9a6d9af24bb (diff)
emit numeric constants for global variables, using our knowledge of the fixed value of GLOBAL_BASE
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 1a7746e7..8bd8b796 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -414,7 +414,8 @@ function makeGlobalDef(ident) {
}
function makeGlobalUse(ident) {
- if (!NAMED_GLOBALS && isIndexableGlobal(ident)) return '(' + getFastValue('GLOBAL_BASE', '+', Variables.indexedGlobals[ident]) + ')';
+ // We assert on TOTAL_STACK being equal to GLOBAL_BASE
+ if (!NAMED_GLOBALS && isIndexableGlobal(ident)) return (TOTAL_STACK + Variables.indexedGlobals[ident]).toString();
return ident;
}