diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 11:56:53 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-31 11:56:53 -0800 |
commit | 2325baf34e144586d71251f31c01c7f2abfdb8b7 (patch) | |
tree | 6dec7e37e75040034d443786d4701e62b38a4d6d /src/jsifier.js | |
parent | 8aa6919b7acf0b4034735ac7ee597e946fefaf4d (diff) | |
parent | a55c2a24a50a93fcf9035eb2a809d13d3a8d3555 (diff) |
Merge branch 'incoming' into asm_js
Conflicts:
src/library_browser.js
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index a7b5a9ec..5499910a 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -431,8 +431,8 @@ function JSify(data, functionsOnly, givenFunctions) { // name the function; overwrite if it's already named snippet = snippet.replace(/function(?:\s+([^(]+))?\s*\(/, 'function _' + ident + '('); if (LIBRARY_DEBUG) { - snippet = snippet.replace('{', '{ var ret = (function() { if (Runtime.debug) Module.printErr("[library call:' + ident + ': " + Array.prototype.slice.call(arguments).map(Runtime.prettyPrint) + "]"); '); - snippet = snippet.substr(0, snippet.length-1) + '}).apply(this, arguments); if (Runtime.debug && typeof ret !== "undefined") Module.printErr(" [ return:" + Runtime.prettyPrint(ret)); return ret; }'; + snippet = snippet.replace('{', '{ var ret = (function() { if (Runtime.debug) Module.print("[library call:' + ident + ': " + Array.prototype.slice.call(arguments).map(Runtime.prettyPrint) + "]"); '); + snippet = snippet.substr(0, snippet.length-1) + '}).apply(this, arguments); if (Runtime.debug && typeof ret !== "undefined") Module.print(" [ return:" + Runtime.prettyPrint(ret)); return ret; }'; } if (ASM_JS) Functions.libraryFunctions[ident] = 1; } @@ -1390,6 +1390,7 @@ function JSify(data, functionsOnly, givenFunctions) { // Print out global variables and postsets TODO: batching if (phase == 'pre') { + var legalizedI64sDefault = legalizedI64s; legalizedI64s = false; var globalsData = analyzer(intertyper(data.unparsedGlobalss[0].lines, true), true); @@ -1412,9 +1413,13 @@ function JSify(data, functionsOnly, givenFunctions) { var generated = itemsDict.functionStub.concat(itemsDict.GlobalVariablePostSet); generated.forEach(function(item) { print(indentify(item.JS || '', 2)); }); + + legalizedI64s = legalizedI64sDefault; } else { - assert(data.unparsedGlobalss[0].lines.length == 0, dump([phase, data.unparsedGlobalss])); - assert(itemsDict.functionStub.length == 0, dump([phase, itemsDict.functionStub])); + if (singlePhase) { + assert(data.unparsedGlobalss[0].lines.length == 0, dump([phase, data.unparsedGlobalss])); + assert(itemsDict.functionStub.length == 0, dump([phase, itemsDict.functionStub])); + } } if (phase == 'pre' || phase == 'funcs') { |