aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-15 12:15:44 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-15 12:15:44 -0800
commitfc97a98e22712ebc9ba2d0c7b44c8ec8321fb5bd (patch)
treed80c57d41244a08355b28d4929bbf21769eb45af
parentb6d2f109d2910cf7ea250f9ea557b2b8842f4c2b (diff)
do not kill asm library functions with DEAD_FUNCTIONS, as they perform fundamental things we cannot easily remove, and there are not many of them anyhow; fixes asm1.test_asm_pgo
-rw-r--r--src/jsifier.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 22a230ca..acfb6365 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -491,9 +491,13 @@ function JSify(data, functionsOnly, givenFunctions) {
// If this is not linkable, anything not in the library is definitely missing
var cancel = false;
if (item.ident in DEAD_FUNCTIONS) {
- LibraryManager.library[shortident] = new Function("Module['printErr']('dead function: " + shortident + "'); abort(-1);");
- delete LibraryManager.library[shortident + '__inline'];
- delete LibraryManager.library[shortident + '__deps'];
+ if (LibraryManager.library[shortident + '__asm']) {
+ warn('cannot kill asm library function ' + item.ident);
+ } else {
+ LibraryManager.library[shortident] = new Function("Module['printErr']('dead function: " + shortident + "'); abort(-1);");
+ delete LibraryManager.library[shortident + '__inline'];
+ delete LibraryManager.library[shortident + '__deps'];
+ }
}
if (!LINKABLE && !LibraryManager.library.hasOwnProperty(shortident) && !LibraryManager.library.hasOwnProperty(shortident + '__inline')) {
if (ERROR_ON_UNDEFINED_SYMBOLS) error('unresolved symbol: ' + shortident);