diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-03-22 16:22:16 -0700 |
commit | a8e4801c7d38033fff760ea26a4579aa324e303e (patch) | |
tree | 01c8c9862f7a6e1b60569aa9be97fd2751be8709 /src/jsifier.js | |
parent | 669c786e3554b280e31dcb7bd92931482547dae0 (diff) | |
parent | f99012f271c056ddc171f6a4ec011ad31ad936cd (diff) |
Merge branch 'incoming'
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 7db2ee70..c55072b4 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -495,10 +495,10 @@ function JSify(data, functionsOnly, givenFunctions) { EXPORTED_FUNCTIONS[ident] = 1; delete Functions.libraryFunctions[ident.substr(1)]; } - } else { - if (EXPORT_ALL || (ident in EXPORTED_FUNCTIONS)) { - contentText += '\nModule["' + ident + '"] = ' + ident + ';'; - } + } + if ((!ASM_JS || phase == 'pre') && + (EXPORT_ALL || (ident in EXPORTED_FUNCTIONS))) { + contentText += '\nModule["' + ident + '"] = ' + ident + ';'; } return depsText + contentText; } @@ -515,7 +515,7 @@ function JSify(data, functionsOnly, givenFunctions) { if (!(item.ident in DEAD_FUNCTIONS) && !UNRESOLVED_AS_DEAD) { item.JS = 'var ' + item.ident + '; // stub for ' + item.ident; if (ASM_JS) { - throw 'Unresolved symbol: ' + item.ident + ', this must be corrected for asm.js validation to succeed. Consider adding it to DEAD_FUNCTIONS.'; + error('Unresolved symbol: ' + item.ident + ', this must be corrected for asm.js validation to succeed. Consider adding it to DEAD_FUNCTIONS.'); } else if (WARN_ON_UNDEFINED_SYMBOLS) { warn('Unresolved symbol: ' + item.ident); } @@ -1167,6 +1167,11 @@ function JSify(data, functionsOnly, givenFunctions) { return ret + ';'; }); makeFuncLineActor('resume', function(item) { + if (item.ident == 0) { + // No exception to resume, so we can just bail. + // This is related to issue #917 and http://llvm.org/PR15518 + return (EXCEPTION_DEBUG ? 'Module.print("no exception to resume")' : '') + ';'; + } // If there is no current exception, set this one as it (during a resume, the current exception can be wiped out) var ptr = makeStructuralAccess(item.ident, 0); return (EXCEPTION_DEBUG ? 'Module.print("Resuming exception");' : '') + @@ -1566,6 +1571,8 @@ function JSify(data, functionsOnly, givenFunctions) { } } + if (abortExecution) throw 'Aborting compilation due to previous warnings'; + if (phase == 'pre' || phase == 'funcs') { PassManager.serialize(); return; |