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/analyzer.js | |
parent | 518031af3274ba14eb0efdbd994d0986b61ee4f1 (diff) |
do not wind/unwind stacks if initial stack size is 0; 20% speedup
Diffstat (limited to 'src/analyzer.js')
-rw-r--r-- | src/analyzer.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index 2a0ee701..8d77b13d 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -313,10 +313,11 @@ function analyzer(data) { var total = 0; var lines = func.labels[0].lines; for (var i = 0; i < lines.length; i++) { - var item = lines[i].value; + var line = lines[i]; + var item = line.value; if (!item || item.intertype != 'alloca') break; - // FIXME: This ignores nativized variables, but probably negligible - item.allocatedSize = calcAllocatedSize(item.allocatedType, data.types); + item.allocatedSize = func.variables[line.ident].impl === VAR_EMULATED ? + calcAllocatedSize(item.allocatedType, data.types) : 0; total += item.allocatedSize; } func.initialStack = total; |