Skip to content

Commit 54dd918

Browse files
authored
Remove remaining checks for the WASM setting. NFC. (#12247)
1 parent 1c6ed82 commit 54dd918

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

src/library_dylink.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,6 @@ var LibraryDylink = {
490490
return;
491491
}
492492
// if we can load dynamic libraries synchronously, do so, otherwise, preload
493-
#if WASM
494493
if (!readBinary) {
495494
// we can't read binary data synchronously, so preload
496495
addRunDependency('preloadDylibs');
@@ -502,7 +501,6 @@ var LibraryDylink = {
502501
});
503502
return;
504503
}
505-
#endif
506504
libs.forEach(function(lib) {
507505
// libraries linked to main never go away
508506
loadDynamicLibrary(lib, {global: true, nodelete: true});
@@ -607,7 +605,7 @@ var LibraryDylink = {
607605
return result;
608606
}
609607

610-
#if WASM && EMULATE_FUNCTION_POINTER_CASTS
608+
#if EMULATE_FUNCTION_POINTER_CASTS
611609
// for wasm with emulated function pointers, the i64 ABI is used for all
612610
// function calls, so we can't just call addFunction on something JS
613611
// can call (which does not use that ABI), as the function pointer would
@@ -623,19 +621,12 @@ var LibraryDylink = {
623621
assert(typeof result === 'number', 'could not find function pointer for ' + symbol);
624622
#endif // ASSERTIONS
625623
return result;
626-
#else // WASM && EMULATE_FUNCTION_POINTER_CASTS
627-
628-
#if WASM
624+
#else // EMULATE_FUNCTION_POINTER_CASTS
629625
// Insert the function into the wasm table. Since we know the function
630626
// comes directly from the loaded wasm module we can insert it directly
631627
// into the table, avoiding any JS interaction.
632628
return addFunctionWasm(result);
633-
#else
634-
// convert the exported function into a function pointer using our generic
635-
// JS mechanism.
636-
return addFunction(result);
637-
#endif // WASM
638-
#endif // WASM && EMULATE_FUNCTION_POINTER_CASTS
629+
#endif // EMULATE_FUNCTION_POINTER_CASTS
639630
},
640631

641632
// char* dlerror(void);

src/modules.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,7 @@ function exportRuntime() {
489489
// Module for closure compiler, and also for MODULARIZE (so worker.js can
490490
// access them).
491491
var threadExports = ['PThread', '_pthread_self'];
492-
if (WASM) {
493-
threadExports.push('wasmMemory');
494-
}
492+
threadExports.push('wasmMemory');
495493
if (!MINIMAL_RUNTIME) {
496494
threadExports.push('ExitStatus');
497495
}

0 commit comments

Comments
 (0)