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
17 changes: 4 additions & 13 deletions src/postamble.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function stackCheckInit() {
}
#endif

{{{ asyncIf(MODULARIZE) }}}function run({{{ MAIN_READS_PARAMS ? 'args = programArgs' : '' }}}) {
{{{ asyncIf(MODULARIZE || expectToReceiveOnModule('setStatus')) }}}function run({{{ MAIN_READS_PARAMS ? 'args = programArgs' : '' }}}) {

#if '$runDependencies' in addedLibraryItems
if (runDependencies > 0) {
Expand Down Expand Up @@ -203,25 +203,16 @@ function stackCheckInit() {
Module['setStatus']('Running...');
// Yield the main thread to allow the browser to paint "Running...", then clear
// the status text after the synchronous doRun() completes.
#if MODULARIZE
await new Promise((resolve) => {
setTimeout(() => {
setTimeout(() => Module['setStatus'](''), 1);
doRun();
resolve();
}, 1);
});
#else
setTimeout(() => {
setTimeout(() => Module['setStatus'](''), 1);
doRun();
}, 1);
#endif
} else
#endif
{
doRun();
}
#endif

doRun();
#if STACK_OVERFLOW_CHECK
checkStackCookie();
#endif
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_ctors1.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19196,
"a.out.js.gz": 7943,
"a.out.js": 19260,
"a.out.js.gz": 7961,
"a.out.nodebug.wasm": 132666,
"a.out.nodebug.wasm.gz": 49962,
"total": 151862,
"total_gz": 57905,
"total": 151926,
"total_gz": 57923,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_ctors2.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19173,
"a.out.js.gz": 7930,
"a.out.js": 19237,
"a.out.js.gz": 7942,
"a.out.nodebug.wasm": 132092,
"a.out.nodebug.wasm.gz": 49625,
"total": 151265,
"total_gz": 57555,
"total": 151329,
"total_gz": 57567,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 23170,
"a.out.js.gz": 8928,
"a.out.js": 23233,
"a.out.js.gz": 8948,
"a.out.nodebug.wasm": 172586,
"a.out.nodebug.wasm.gz": 57501,
"total": 195756,
"total_gz": 66429,
"total": 195819,
"total_gz": 66449,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except_wasm.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 18995,
"a.out.js.gz": 7862,
"a.out.js": 19059,
"a.out.js.gz": 7883,
"a.out.nodebug.wasm": 147991,
"a.out.nodebug.wasm.gz": 55370,
"total": 166986,
"total_gz": 63232,
"total": 167050,
"total_gz": 63253,
"sent": [
"_abort_js",
"_tzset_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_except_wasm_legacy.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19073,
"a.out.js.gz": 7886,
"a.out.js": 19137,
"a.out.js.gz": 7904,
"a.out.nodebug.wasm": 145797,
"a.out.nodebug.wasm.gz": 54992,
"total": 164870,
"total_gz": 62878,
"total": 164934,
"total_gz": 62896,
"sent": [
"_abort_js",
"_tzset_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_lto.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 18536,
"a.out.js.gz": 7636,
"a.out.js": 18599,
"a.out.js.gz": 7649,
"a.out.nodebug.wasm": 102168,
"a.out.nodebug.wasm.gz": 39572,
"total": 120704,
"total_gz": 47208,
"total": 120767,
"total_gz": 47221,
"sent": [
"a (emscripten_resize_heap)",
"b (_setitimer_js)",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_mangle.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 23220,
"a.out.js.gz": 8948,
"a.out.js": 23283,
"a.out.js.gz": 8970,
"a.out.nodebug.wasm": 239015,
"a.out.nodebug.wasm.gz": 79854,
"total": 262235,
"total_gz": 88802,
"total": 262298,
"total_gz": 88824,
"sent": [
"__cxa_begin_catch",
"__cxa_end_catch",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_noexcept.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 19196,
"a.out.js.gz": 7943,
"a.out.js": 19260,
"a.out.js.gz": 7961,
"a.out.nodebug.wasm": 134666,
"a.out.nodebug.wasm.gz": 50806,
"total": 153862,
"total_gz": 58749,
"total": 153926,
"total_gz": 58767,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_cxx_wasmfs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 6934,
"a.out.js.gz": 3252,
"a.out.js": 6980,
"a.out.js.gz": 3268,
"a.out.nodebug.wasm": 172677,
"a.out.nodebug.wasm.gz": 63357,
"total": 179611,
"total_gz": 66609,
"total": 179657,
"total_gz": 66625,
"sent": [
"__cxa_throw",
"_abort_js",
Expand Down
4 changes: 1 addition & 3 deletions test/codesize/test_codesize_file_preload.expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -3199,9 +3199,7 @@ function run() {
if (!noInitialRun) callMain();
postRun();
}
{
doRun();
}
doRun();
}

var wasmExports;
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_files_js_fs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 17844,
"a.out.js.gz": 7285,
"a.out.js": 17908,
"a.out.js.gz": 7297,
"a.out.nodebug.wasm": 381,
"a.out.nodebug.wasm.gz": 260,
"total": 18225,
"total_gz": 7545,
"total": 18289,
"total_gz": 7557,
"sent": [
"a (fd_write)",
"b (fd_read)",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_files_wasmfs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 5368,
"a.out.js.gz": 2526,
"a.out.js": 5414,
"a.out.js.gz": 2537,
"a.out.nodebug.wasm": 58324,
"a.out.nodebug.wasm.gz": 18215,
"total": 63692,
"total_gz": 20741,
"total": 63738,
"total_gz": 20752,
"sent": [
"a (emscripten_date_now)",
"b (emscripten_err)",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_O0.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 23344,
"a.out.js.gz": 8443,
"a.out.js": 23304,
"a.out.js.gz": 8455,
"a.out.nodebug.wasm": 15115,
"a.out.nodebug.wasm.gz": 7464,
"total": 38459,
"total_gz": 15907,
"total": 38419,
"total_gz": 15919,
"sent": [
"fd_write"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_O1.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 6164,
"a.out.js.gz": 2386,
"a.out.js": 6154,
"a.out.js.gz": 2381,
"a.out.nodebug.wasm": 2544,
"a.out.nodebug.wasm.gz": 1436,
"total": 8708,
"total_gz": 3822,
"total": 8698,
"total_gz": 3817,
"sent": [
"fd_write"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_O2.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 4220,
"a.out.js.gz": 2070,
"a.out.js": 4266,
"a.out.js.gz": 2081,
"a.out.nodebug.wasm": 1912,
"a.out.nodebug.wasm.gz": 1129,
"total": 6132,
"total_gz": 3199,
"total": 6178,
"total_gz": 3210,
"sent": [
"fd_write"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_O3.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 4161,
"a.out.js.gz": 2030,
"a.out.js": 4208,
"a.out.js.gz": 2043,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
"total": 5827,
"total_gz": 2975,
"total": 5874,
"total_gz": 2988,
"sent": [
"a (fd_write)"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_Os.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 4161,
"a.out.js.gz": 2030,
"a.out.js": 4208,
"a.out.js.gz": 2043,
"a.out.nodebug.wasm": 1654,
"a.out.nodebug.wasm.gz": 953,
"total": 5815,
"total_gz": 2983,
"total": 5862,
"total_gz": 2996,
"sent": [
"a (fd_write)"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_Oz.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 3800,
"a.out.js.gz": 1836,
"a.out.js": 3843,
"a.out.js.gz": 1850,
"a.out.nodebug.wasm": 1188,
"a.out.nodebug.wasm.gz": 731,
"total": 4988,
"total_gz": 2567,
"total": 5031,
"total_gz": 2581,
"sent": [
"a (fd_write)"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_dylink.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 26269,
"a.out.js.gz": 11182,
"a.out.js": 26313,
"a.out.js.gz": 11200,
"a.out.nodebug.wasm": 17861,
"a.out.nodebug.wasm.gz": 9019,
"total": 44130,
"total_gz": 20201,
"total": 44174,
"total_gz": 20219,
"sent": [
"__syscall_stat64",
"emscripten_resize_heap",
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_dylink_all.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"a.out.js": 268278,
"a.out.js": 268331,
"a.out.nodebug.wasm": 587640,
"total": 855918,
"total": 855971,
"sent": [
"IMG_Init",
"IMG_Load",
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_export_nothing.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 3076,
"a.out.js.gz": 1423,
"a.out.js": 3102,
"a.out.js.gz": 1433,
"a.out.nodebug.wasm": 43,
"a.out.nodebug.wasm.gz": 59,
"total": 3119,
"total_gz": 1482,
"total": 3145,
"total_gz": 1492,
"sent": [],
"imports": [],
"exports": [
Expand Down
4 changes: 2 additions & 2 deletions test/codesize/test_codesize_hello_single_file.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"a.out.js": 5139,
"a.out.js.gz": 2826,
"a.out.js": 5183,
"a.out.js.gz": 2842,
"sent": [
"a (fd_write)"
]
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_hello_wasmfs.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 4161,
"a.out.js.gz": 2030,
"a.out.js": 4208,
"a.out.js.gz": 2043,
"a.out.nodebug.wasm": 1666,
"a.out.nodebug.wasm.gz": 945,
"total": 5827,
"total_gz": 2975,
"total": 5874,
"total_gz": 2988,
"sent": [
"a (fd_write)"
],
Expand Down
8 changes: 4 additions & 4 deletions test/codesize/test_codesize_libcxxabi_message_O3.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 3427,
"a.out.js.gz": 1605,
"a.out.js": 3470,
"a.out.js.gz": 1618,
"a.out.nodebug.wasm": 89,
"a.out.nodebug.wasm.gz": 98,
"total": 3516,
"total_gz": 1703,
"total": 3559,
"total_gz": 1716,
"sent": [],
"imports": [],
"exports": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.out.js": 3474,
"a.out.js.gz": 1638,
"a.out.js": 3517,
"a.out.js.gz": 1655,
"a.out.nodebug.wasm": 222,
"a.out.nodebug.wasm.gz": 206,
"total": 3696,
"total_gz": 1844,
"total": 3739,
"total_gz": 1861,
"sent": [
"proc_exit"
],
Expand Down
Loading
Loading