diff options
author | alon@honor <none@none> | 2010-10-15 21:22:52 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-15 21:22:52 -0700 |
commit | 5c33e208873515258c577350f2e006c1563b12af (patch) | |
tree | a6dd5dd23a4e77d1240c3c19ed2fbf899dcef3e3 /src/jsifier.js | |
parent | 518031af3274ba14eb0efdbd994d0986b61ee4f1 (diff) |
do not wind/unwind stacks if initial stack size is 0; 20% speedup
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 597b0c31..32b284ad 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -546,7 +546,7 @@ function JSify(data) { return ret; }); makeFuncLineZyme('return', function(item) { - var ret = RuntimeGenerator.stackExit() + '\n'; + var ret = RuntimeGenerator.stackExit(item.funcData.initialStack) + ';\n'; if (LABEL_DEBUG) ret += "INDENT = INDENT.substr(0, INDENT.length-2);\n"; ret += 'return'; if (item.value) { @@ -583,6 +583,7 @@ function JSify(data) { }); makeFuncLineZyme('alloca', function(item) { assert(typeof item.allocatedIndex === 'number'); // or, return RuntimeGenerator.stackAlloc(calcAllocatedSize(item.allocatedType, TYPES)); + if (item.allocatedSize === 0) return ''; // This will not actually be shown - it's nativized return getFastValue('STACKTOP', '-', item.allocatedIndex.toString()); }); makeFuncLineZyme('phi', function(item) { |