Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/lib/libcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1630,16 +1630,11 @@ addToLibrary({
dynCalls[name.substr(8)] = exportedSymbol;
}
#endif
// Globals are currently statically enumerated into the output JS.
// TODO: If the number of Globals grows large, consider giving them a
// similar DECLARE_ASM_MODULE_EXPORTS = 0 treatment.
if (typeof exportedSymbol.value === 'undefined') {
#if MINIMAL_RUNTIME
globalThis[name] = exportedSymbol;
globalThis[name] = exportedSymbol;
#else
globalThis[name] = Module[name] = exportedSymbol;
globalThis[name] = Module[name] = exportedSymbol;
#endif
}
}
exportAliases(wasmExports);
},
Expand Down
3 changes: 0 additions & 3 deletions src/settings_internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
// underscore.
var WASM_EXPORTS = [];

// Similar to above but only includes the data symbols (address exports).
var DATA_EXPORTS = [];

// An array of all symbols exported from all the side modules specified on the
// command line.
// These are raw symbol names and are not mangled to include the leading
Expand Down
15 changes: 8 additions & 7 deletions test/codesize/test_codesize_minimal_64.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2595,
"a.out.js.gz": 1243,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2657,
"total_gz": 1319,
"a.out.js": 2596,
"a.out.js.gz": 1244,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 88,
"total": 2671,
"total_gz": 1332,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
5 changes: 3 additions & 2 deletions test/codesize/test_codesize_minimal_O0.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,7 @@ var __emscripten_stack_restore = makeInvalidEarlyAccess('__emscripten_stack_rest
var __emscripten_stack_alloc = makeInvalidEarlyAccess('__emscripten_stack_alloc');
var _emscripten_stack_get_current = makeInvalidEarlyAccess('_emscripten_stack_get_current');
var memory = makeInvalidEarlyAccess('memory');
var _global_val = Module['_global_val'] = makeInvalidEarlyAccess('_global_val');
var __indirect_function_table = makeInvalidEarlyAccess('__indirect_function_table');
var wasmMemory = makeInvalidEarlyAccess('wasmMemory');

Expand All @@ -1340,12 +1341,12 @@ function assignWasmExports(wasmExports) {
_emscripten_stack_get_current = wasmExports['emscripten_stack_get_current'];
assert(wasmExports['memory'], 'missing Wasm export: memory');
memory = wasmMemory = wasmExports['memory'];
assert(wasmExports['global_val'], 'missing Wasm export: global_val');
_global_val = Module['_global_val'] = wasmExports['global_val'].value;
assert(wasmExports['__indirect_function_table'], 'missing Wasm export: __indirect_function_table');
__indirect_function_table = wasmExports['__indirect_function_table'];
}

var _global_val = Module['_global_val'] = 65536;

var wasmImports = {

};
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_minimal_O0.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19262,
"a.out.js.gz": 6966,
"a.out.js": 19365,
"a.out.js.gz": 6982,
"a.out.nodebug.wasm": 1136,
"a.out.nodebug.wasm.gz": 659,
"total": 20398,
"total_gz": 7625,
"total": 20501,
"total_gz": 7641,
"sent": [],
"imports": [],
"exports": [
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_minimal_O1.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 3049,
"a.out.js.gz": 1301,
"a.out.js": 3061,
"a.out.js.gz": 1300,
"a.out.nodebug.wasm": 449,
"a.out.nodebug.wasm.gz": 337,
"total": 3498,
"total_gz": 1638,
"total": 3510,
"total_gz": 1637,
"sent": [],
"imports": [],
"exports": [
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_minimal_O2.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"a.out.js": 2342,
"a.out.js": 2352,
"a.out.js.gz": 1171,
"a.out.nodebug.wasm": 280,
"a.out.nodebug.wasm.gz": 226,
"total": 2622,
"total": 2632,
"total_gz": 1397,
"sent": [],
"imports": [],
Expand Down
13 changes: 7 additions & 6 deletions test/codesize/test_codesize_minimal_O3.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2292,
"a.out.js": 2293,
"a.out.js.gz": 1137,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2354,
"total_gz": 1213,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 2368,
"total_gz": 1224,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
13 changes: 7 additions & 6 deletions test/codesize/test_codesize_minimal_Os.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2292,
"a.out.js": 2293,
"a.out.js.gz": 1137,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2354,
"total_gz": 1213,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 2368,
"total_gz": 1224,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
11 changes: 6 additions & 5 deletions test/codesize/test_codesize_minimal_Os_mr.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 497,
"a.out.js.gz": 297,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 559,
"total_gz": 373,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 572,
"total_gz": 384,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
13 changes: 7 additions & 6 deletions test/codesize/test_codesize_minimal_Oz-ctors.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"a.out.js": 2271,
"a.out.js": 2272,
"a.out.js.gz": 1122,
"a.out.nodebug.wasm": 51,
"a.out.nodebug.wasm.gz": 68,
"total": 2322,
"total_gz": 1190,
"a.out.nodebug.wasm": 64,
"a.out.nodebug.wasm.gz": 80,
"total": 2336,
"total_gz": 1202,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (add)"
"b (add)",
"c (global_val)"
],
"funcs": [
"$add"
Expand Down
13 changes: 7 additions & 6 deletions test/codesize/test_codesize_minimal_Oz.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2292,
"a.out.js": 2293,
"a.out.js.gz": 1137,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2354,
"total_gz": 1213,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 2368,
"total_gz": 1224,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
15 changes: 8 additions & 7 deletions test/codesize/test_codesize_minimal_esm.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2427,
"a.out.js.gz": 1169,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2489,
"total_gz": 1245,
"a.out.js": 2429,
"a.out.js.gz": 1168,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 2504,
"total_gz": 1255,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
41 changes: 21 additions & 20 deletions test/codesize/test_codesize_minimal_pthreads.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 7609,
"a.out.js.gz": 3762,
"a.out.nodebug.wasm": 19599,
"a.out.nodebug.wasm.gz": 9063,
"total": 27208,
"total_gz": 12825,
"a.out.js": 7611,
"a.out.js.gz": 3764,
"a.out.nodebug.wasm": 19609,
"a.out.nodebug.wasm.gz": 9071,
"total": 27220,
"total_gz": 12835,
"sent": [
"a (memory)",
"b (emscripten_get_now)",
Expand Down Expand Up @@ -40,23 +40,24 @@
"o (__pthread_create_js)"
],
"exports": [
"A (_emscripten_thread_exit)",
"B (_emscripten_check_mailbox)",
"C (emscripten_stack_set_limits)",
"D (_emscripten_stack_restore)",
"E (_emscripten_stack_alloc)",
"F (emscripten_stack_get_current)",
"A (_emscripten_thread_free_data)",
"B (_emscripten_thread_exit)",
"C (_emscripten_check_mailbox)",
"D (emscripten_stack_set_limits)",
"E (_emscripten_stack_restore)",
"F (_emscripten_stack_alloc)",
"G (emscripten_stack_get_current)",
"p (__wasm_call_ctors)",
"q (add)",
"r (main)",
"s (__indirect_function_table)",
"t (_emscripten_tls_init)",
"u (pthread_self)",
"v (_emscripten_proxy_main)",
"w (_emscripten_thread_init)",
"x (_emscripten_thread_crashed)",
"y (_emscripten_run_js_on_main_thread)",
"z (_emscripten_thread_free_data)"
"s (global_val)",
"t (__indirect_function_table)",
"u (_emscripten_tls_init)",
"v (pthread_self)",
"w (_emscripten_proxy_main)",
"x (_emscripten_thread_init)",
"y (_emscripten_thread_crashed)",
"z (_emscripten_run_js_on_main_thread)"
],
"funcs": [
"$__emscripten_stdout_seek",
Expand Down
41 changes: 21 additions & 20 deletions test/codesize/test_codesize_minimal_pthreads_memgrowth.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 8036,
"a.out.js.gz": 3962,
"a.out.nodebug.wasm": 19600,
"a.out.nodebug.wasm.gz": 9064,
"total": 27636,
"total_gz": 13026,
"a.out.js": 8038,
"a.out.js.gz": 3964,
"a.out.nodebug.wasm": 19610,
"a.out.nodebug.wasm.gz": 9072,
"total": 27648,
"total_gz": 13036,
"sent": [
"a (memory)",
"b (emscripten_get_now)",
Expand Down Expand Up @@ -40,23 +40,24 @@
"o (__pthread_create_js)"
],
"exports": [
"A (_emscripten_thread_exit)",
"B (_emscripten_check_mailbox)",
"C (emscripten_stack_set_limits)",
"D (_emscripten_stack_restore)",
"E (_emscripten_stack_alloc)",
"F (emscripten_stack_get_current)",
"A (_emscripten_thread_free_data)",
"B (_emscripten_thread_exit)",
"C (_emscripten_check_mailbox)",
"D (emscripten_stack_set_limits)",
"E (_emscripten_stack_restore)",
"F (_emscripten_stack_alloc)",
"G (emscripten_stack_get_current)",
"p (__wasm_call_ctors)",
"q (add)",
"r (main)",
"s (__indirect_function_table)",
"t (_emscripten_tls_init)",
"u (pthread_self)",
"v (_emscripten_proxy_main)",
"w (_emscripten_thread_init)",
"x (_emscripten_thread_crashed)",
"y (_emscripten_run_js_on_main_thread)",
"z (_emscripten_thread_free_data)"
"s (global_val)",
"t (__indirect_function_table)",
"u (_emscripten_tls_init)",
"v (pthread_self)",
"w (_emscripten_proxy_main)",
"x (_emscripten_thread_init)",
"y (_emscripten_thread_crashed)",
"z (_emscripten_run_js_on_main_thread)"
],
"funcs": [
"$__emscripten_stdout_seek",
Expand Down
13 changes: 7 additions & 6 deletions test/codesize/test_codesize_minimal_wasmfs.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"a.out.js": 2292,
"a.out.js": 2293,
"a.out.js.gz": 1137,
"a.out.nodebug.wasm": 62,
"a.out.nodebug.wasm.gz": 76,
"total": 2354,
"total_gz": 1213,
"a.out.nodebug.wasm": 75,
"a.out.nodebug.wasm.gz": 87,
"total": 2368,
"total_gz": 1224,
"sent": [],
"imports": [],
"exports": [
"a (memory)",
"b (__wasm_call_ctors)",
"c (add)"
"c (add)",
"d (global_val)"
],
"funcs": [
"$__wasm_call_ctors",
Expand Down
Loading