diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-29 12:09:06 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-29 12:09:06 -0800 |
commit | 92d360734cb85851aaa3a328ebe3ffa67700cf06 (patch) | |
tree | 78d4bb7ebc9354f5fc8fe74bc6dc2e55103c9507 /src/jsifier.js | |
parent | 7b6798ecf48622d5c9fe9b20a5950bd5c3f13bb7 (diff) |
more memory debugging tools and minor optimizations
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 48fb7968..099fa4c6 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -99,12 +99,14 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { for (var i = 0; i < data.unparsedFunctions.length; i++) { var func = data.unparsedFunctions[i]; + // We don't need to save anything past here + data.unparsedFunctions[i] = null; dprint('unparsedFunctions', '====================\n// Processing |' + func.ident + '|, ' + i + '/' + data.unparsedFunctions.length); + if (DEBUG_MEMORY) MemoryDebugger.tick('pre-func ' + func.ident); JSify(analyzer(intertyper(func.lines, true, func.lineNum-1)), true, Functions, GLOBAL_VARIABLES); - // We don't need to save anything here, the function has printed itself out and can now be forgotten - data.unparsedFunctions[i] = null; - //if (DEBUG_MEMORY) MemoryDebugger.tick('func ' + i + '|' + func.ident + (i == 0 ? ' <first>' : '')); + if (DEBUG_MEMORY) MemoryDebugger.tick('func ' + func.ident); } + func = null; // Do not hold on to anything from inside that loop (JS function scoping..) // Actors |