Skip to content

MEMORY64 + pthreads support in browser #19959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl2_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 379,
"a.js": 4700,
"a.js.gz": 2417,
"a.wasm": 10479,
"a.wasm.gz": 6713,
"total": 15748,
"total_gz": 9509
"a.wasm": 10474,
"a.wasm.gz": 6697,
"total": 15743,
"total_gz": 9493
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl2_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.html": 567,
"a.html.gz": 379,
"a.js": 17975,
"a.js.gz": 8044,
"a.js": 17955,
"a.js.gz": 8048,
"a.mem": 3171,
"a.mem.gz": 2713,
"total": 21713,
"total_gz": 11136
"total": 21693,
"total_gz": 11140
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl_wasm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"a.html.gz": 379,
"a.js": 4186,
"a.js.gz": 2244,
"a.wasm": 10479,
"a.wasm.gz": 6713,
"total": 15234,
"total_gz": 9336
"a.wasm": 10474,
"a.wasm.gz": 6697,
"total": 15229,
"total_gz": 9320
}
8 changes: 4 additions & 4 deletions test/code_size/hello_webgl_wasm2js.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"a.html": 567,
"a.html.gz": 379,
"a.js": 17454,
"a.js.gz": 7873,
"a.js": 17434,
"a.js.gz": 7876,
"a.mem": 3171,
"a.mem.gz": 2713,
"total": 21192,
"total_gz": 10965
"total": 21172,
"total_gz": 10968
}
10 changes: 10 additions & 0 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4151,11 +4151,13 @@ def test_pthread_custom_pthread_main_url(self):
self.run_browser('test2.html', '/report_result?exit:0')

# Test that if the main thread is performing a futex wait while a pthread needs it to do a proxied operation (before that pthread would wake up the main thread), that it's not a deadlock.
@also_with_wasm64
@requires_threads
def test_pthread_proxying_in_futex_wait(self):
self.btest_exit('pthread/test_pthread_proxying_in_futex_wait.cpp', args=['-O3', '-pthread', '-sPTHREAD_POOL_SIZE'])

# Test that sbrk() operates properly in multithreaded conditions
@also_with_wasm64
@requires_threads
def test_pthread_sbrk(self):
for aborting_malloc in [0, 1]:
Expand All @@ -4181,11 +4183,13 @@ def test_pthread_run_on_main_thread(self):
self.btest_exit('pthread/test_pthread_run_on_main_thread.cpp', args=['-O3', '-pthread', '-sPTHREAD_POOL_SIZE'])

# Test how a lot of back-to-back called proxying operations behave.
@also_with_wasm64
@requires_threads
def test_pthread_run_on_main_thread_flood(self):
self.btest_exit('pthread/test_pthread_run_on_main_thread_flood.cpp', args=['-O3', '-pthread', '-sPTHREAD_POOL_SIZE'])

# Test that it is possible to asynchronously call a JavaScript function on the main thread.
@also_with_wasm64
@requires_threads
def test_pthread_call_async(self):
self.btest_exit('pthread/call_async.c', args=['-pthread'])
Expand Down Expand Up @@ -4228,6 +4232,7 @@ def test_pthread_global_data_initialization_in_sync_compilation_mode(self):
def test_pthread_clock_drift(self):
self.btest_exit('pthread/test_pthread_clock_drift.cpp', args=['-O3', '-pthread', '-sPROXY_TO_PTHREAD'])

@also_with_wasm64
@requires_threads
def test_pthread_utf8_funcs(self):
self.btest_exit('pthread/test_pthread_utf8_funcs.cpp', args=['-pthread', '-sPTHREAD_POOL_SIZE'])
Expand All @@ -4239,16 +4244,19 @@ def test_pthread_wake_all(self):
self.btest_exit('pthread/test_futex_wake_all.cpp', args=['-O3', '-pthread', '-sINITIAL_MEMORY=64MB'])

# Test that stack base and max correctly bound the stack on pthreads.
@also_with_wasm64
@requires_threads
def test_pthread_stack_bounds(self):
self.btest_exit('pthread/test_pthread_stack_bounds.cpp', args=['-pthread'])

# Test that real `thread_local` works.
@also_with_wasm64
@requires_threads
def test_pthread_tls(self):
self.btest_exit('pthread/test_pthread_tls.cpp', args=['-sPROXY_TO_PTHREAD', '-pthread'])

# Test that real `thread_local` works in main thread without PROXY_TO_PTHREAD.
@also_with_wasm64
@requires_threads
def test_pthread_tls_main(self):
self.btest_exit('pthread/test_pthread_tls_main.cpp', args=['-pthread'])
Expand Down Expand Up @@ -4991,6 +4999,7 @@ def test_single_file_worker_js(self):
# program can run either on the main thread (normal tests) or when we start it in
# a Worker in this test (in that case, both the main application thread and the worker threads
# are all inside Web Workers).
@also_with_wasm64
@requires_threads
def test_pthreads_started_in_worker(self):
self.set_setting('EXIT_RUNTIME')
Expand Down Expand Up @@ -5120,6 +5129,7 @@ def test_emscripten_set_interval(self):
self.btest_exit('emscripten_set_interval.c', args=['-pthread', '-sPROXY_TO_PTHREAD'])

# Test emscripten_performance_now() and emscripten_date_now()
@also_with_wasm64
@requires_threads
def test_emscripten_performance_now(self):
self.btest('emscripten_performance_now.c', '0', args=['-pthread', '-sPROXY_TO_PTHREAD'])
Expand Down