Skip to content

Commit 94c4160

Browse files
authored
Merge branch 'main' into arsnyder16-fcoverage
2 parents 10bbd61 + ce1fdec commit 94c4160

File tree

14 files changed

+76
-43
lines changed

14 files changed

+76
-43
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ jobs:
546546
asan.test_dlfcn_basic
547547
asan.test_async_hello_jspi
548548
asan.test_cubescript
549-
asan.test_wasm_worker_hello
550549
asan.test_externref_emjs_dynlink
551550
asan.test_asyncify_longjmp
552551
asan.test_pthread_run_on_main_thread

site/source/docs/api_reference/wasm_audio_worklets.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ which resumes the audio context when the user clicks on the DOM Canvas element t
165165
return true; // Keep the graph output going
166166
}
167167
168-
And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET=1 -sWASM_WORKERS=1`` to enable targeting AudioWorklets.
168+
And that's it! Compile the code with the linker flags ``-sAUDIO_WORKLET -sWASM_WORKERS`` to enable targeting AudioWorklets.
169169

170170
Synchronizing audio thread with the main thread
171171
===============================================

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Emscripten Compiler Settings
55
============================
66

7-
The following is a complete list of settings that can be passed
8-
to emscripten via ``-s`` on the command line. For example
9-
``-sASSERTIONS`` or ``-sASSERTIONS=0``. For more details see the
10-
:ref:`emcc <emcc-s-option-value>` documentation.
7+
The following is a complete list of settings that can be passed to emscripten
8+
via ``-s`` on the command line. For example ``-sASSERTIONS`` or
9+
``-sASSERTIONS=0``. For more details see the :ref:`emcc <emcc-s-option-value>`
10+
documentation.
1111

12-
Unless otherwise noted these settings only apply when linking
13-
and have no effect during compilation.
12+
Unless otherwise noted these settings only apply when linking and have no effect
13+
during compilation.
1414

1515
.. Auto-generated by update_settings_docs.py. **DO NOT EDIT**
1616
@@ -467,9 +467,8 @@ sent value to memory and loaded the received type from the same memory (using
467467
truncs/extends/ reinterprets). This means that when types do not match the
468468
emulated values may not match (this is true of native too, for that matter -
469469
this is all undefined behavior). This approaches appears good enough to
470-
support Python, which is the main use case motivating this feature.
471-
472-
.. note:: This setting is deprecated
470+
support Python (the original motiviation for this feature) and Glib (the
471+
continued motivation).
473472

474473
Default value: false
475474

@@ -3355,3 +3354,17 @@ Experimental support for wasm ESM integration.
33553354
Requires EXPORT_ES6 and MODULARIZE=instance
33563355

33573356
Default value: false
3357+
3358+
.. _js_base64_api:
3359+
3360+
JS_BASE64_API
3361+
=============
3362+
3363+
Enable use of the JS arraybuffer-base64 API:
3364+
https://github.com/tc39/proposal-arraybuffer-base64
3365+
To run the resulting code currently requires passing `--js_base_64` to node
3366+
or chrome.
3367+
3368+
.. note:: This is an experimental setting
3369+
3370+
Default value: false

src/audio_worklet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file is the main bootstrap script for Wasm Audio Worklets loaded in an
2-
// Emscripten application. Build with -sAUDIO_WORKLET=1 linker flag to enable
2+
// Emscripten application. Build with -sAUDIO_WORKLET linker flag to enable
33
// targeting Audio Worklets.
44

55
// AudioWorkletGlobalScope does not have a onmessage/postMessage() functionality

src/lib/libbase64.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ addToLibrary({
2222
`,
2323
$base64Decode__docs: '/** @noinline */',
2424
$base64Decode: (b64) => {
25+
#if JS_BASE64_API
26+
return Uint8Array.fromBase64(b64);
27+
#else
2528
#if ENVIRONMENT_MAY_BE_NODE
2629
if (ENVIRONMENT_IS_NODE) {
2730
var buf = Buffer.from(b64, 'base64');
@@ -42,5 +45,6 @@ addToLibrary({
4245
output[j+2] = b2 << 6 | base64ReverseLookup[b64.charCodeAt(i+3)];
4346
}
4447
return output;
48+
#endif
4549
},
4650
});

src/lib/libpthread.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,16 @@ var LibraryPThread = {
9696
) {
9797
t = _pthread_self();
9898
}
99-
return `w:${workerID},t:${ptrToString(t)}: `;
99+
return `w:${workerID},t:${ptrToString(t)}:`;
100100
}
101101

102102
// Prefix all err()/dbg() messages with the calling thread ID.
103103
var origDbg = dbg;
104-
dbg = (...args) => origDbg(pthreadLogPrefix() + args.join(' '));
104+
dbg = (...args) => origDbg(pthreadLogPrefix(), ...args);
105105
#if PTHREADS_DEBUG
106106
// With PTHREADS_DEBUG also prefix all err() messages.
107107
var origErr = err;
108-
err = (...args) => origErr(pthreadLogPrefix() + args.join(' '));
108+
err = (...args) => origErr(pthreadLogPrefix(), ...args);
109109
#endif
110110
},
111111
#endif

src/lib/libwasm_worker.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ if (ENVIRONMENT_IS_WASM_WORKER
204204
#endif
205205
'sb': stackLowestAddress, // sb = stack bottom (lowest stack address, SP points at this when stack is full)
206206
'sz': stackSize, // sz = stack size
207-
#if USE_OFFSET_CONVERTER
208-
'wasmOffsetData': wasmOffsetConverter,
209-
#endif
210-
#if LOAD_SOURCE_MAP
211-
'wasmSourceMapData': wasmSourceMap,
212-
#endif
213207
});
214208
worker.onmessage = _wasmWorkerRunPostMessage;
215209
#if ENVIRONMENT_MAY_BE_NODE

src/settings.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ var SAFE_HEAP_LOG = false;
342342
// truncs/extends/ reinterprets). This means that when types do not match the
343343
// emulated values may not match (this is true of native too, for that matter -
344344
// this is all undefined behavior). This approaches appears good enough to
345-
// support Python, which is the main use case motivating this feature.
345+
// support Python (the original motiviation for this feature) and Glib (the
346+
// continued motivation).
346347
// [link]
347-
// [deprecated]
348348
var EMULATE_FUNCTION_POINTER_CASTS = false;
349349

350350
// Print out exceptions in emscriptened code.
@@ -2193,6 +2193,14 @@ var SOURCE_PHASE_IMPORTS = false;
21932193
// [link]
21942194
var WASM_ESM_INTEGRATION = false;
21952195

2196+
// Enable use of the JS arraybuffer-base64 API:
2197+
// https://github.com/tc39/proposal-arraybuffer-base64
2198+
// To run the resulting code currently requires passing `--js_base_64` to node
2199+
// or chrome.
2200+
// [experimental]
2201+
// [link]
2202+
var JS_BASE64_API = false;
2203+
21962204
// For renamed settings the format is:
21972205
// [OLD_NAME, NEW_NAME]
21982206
// For removed settings (which now effectively have a fixed value and can no

src/settings_internal.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ var WASM_BINARY_FILE = '';
137137
// name of the file containing the Wasm Worker *.ww.js, if relevant
138138
var WASM_WORKER_FILE = '';
139139

140-
// name of the file containing the Audio Worklet *.aw.js, if relevant
141-
var AUDIO_WORKLET_FILE = '';
142-
143140
// Base URL the source mapfile, if relevant
144141
var SOURCE_MAP_BASE = '';
145142

test/test_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ def test_longjmp_standalone(self):
886886
def test_longjmp(self):
887887
self.do_core_test('test_longjmp.c')
888888

889+
@no_asan('ASan does not support WASM_WORKERS')
889890
def test_longjmp_wasm_workers(self):
890891
self.do_core_test('test_longjmp.c', emcc_args=['-sWASM_WORKERS'])
891892

@@ -9592,14 +9593,17 @@ def test_emscripten_async_load_script(self):
95929593
self.do_runf('test_emscripten_async_load_script.c', emcc_args=['-sFORCE_FILESYSTEM'])
95939594

95949595
@node_pthreads
9596+
@no_asan('ASan does not support WASM_WORKERS')
95959597
def test_wasm_worker_hello(self):
95969598
self.do_run_in_out_file_test('wasm_worker/hello_wasm_worker.c', emcc_args=['-sWASM_WORKERS'])
95979599

95989600
@node_pthreads
9601+
@no_asan('ASan does not support WASM_WORKERS')
95999602
def test_wasm_worker_malloc(self):
96009603
self.do_run_in_out_file_test('wasm_worker/malloc_wasm_worker.c', emcc_args=['-sWASM_WORKERS'])
96019604

96029605
@node_pthreads
9606+
@no_asan('ASan does not support WASM_WORKERS')
96039607
def test_wasm_worker_wait_async(self):
96049608
self.do_runf('atomic/test_wait_async.c', emcc_args=['-sWASM_WORKERS'])
96059609

0 commit comments

Comments
 (0)