diff options
author | alon@honor <none@none> | 2010-10-31 15:50:56 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-31 15:50:56 -0700 |
commit | db2dfd4026c5aaba0a4b1fc2778b1ca36bec8a62 (patch) | |
tree | eeffd846e36469148e66c7e1b58cfc8a19ca1248 /src/postamble.js | |
parent | 9343f81a117efd605ff274fd290d38d674c55d25 (diff) |
remove getters from global vars
Diffstat (limited to 'src/postamble.js')
-rw-r--r-- | src/postamble.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/postamble.js b/src/postamble.js index 142ee013..448ee0fb 100644 --- a/src/postamble.js +++ b/src/postamble.js @@ -4,6 +4,23 @@ function run(args) { __initializeRuntime__(); + var globalFuncs = []; + +{{GLOBAL_VARS}} + + var counter = Math.pow(globalFuncs.length,2)+1; + while (globalFuncs.length > 0 && counter >= 0) { + counter--; + var func = globalFuncs.pop(); + try { + func(); + } catch (e) { + globalFuncs.unshift(func); + // We will try again later. The global vars we depend on should be resolved by then + // XXX: We leak here, as we malloc, then fail and catch... + } + } + var argc = args.length+1; function pad() { for (var i = 0; i < QUANTUM_SIZE-1; i++) { |