Skip to content

Commit 8ad0c4a

Browse files
authored
Merge branch 'main' into cw-audio-memory64
2 parents 047223a + 62304e2 commit 8ad0c4a

File tree

132 files changed

+314
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+314
-248
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ See docs/process.md for more on how version tagging works.
2020

2121
4.0.2 (in development)
2222
----------------------
23+
- The standard Wasm EH, enabled by `-sWASM_LEGACY_EXCEPTIONS=0`, now uses the
24+
LLVM backend implementation rather than the previously used Binaryen
25+
translator
26+
(https://github.com/WebAssembly/binaryen/blob/main/src/passes/TranslateEH.cpp).
27+
(#23469) No specific action from the user is required.
2328
- Added support for compiling AVX2 intrinsics, 256-bit wide intrinsic is emulated
2429
on top of 128-bit Wasm SIMD instruction set. (#23035). Pass `-msimd128 -mavx2`
2530
to enable targeting AVX2.

embuilder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
MINIMAL_TASKS = [
3333
'libcompiler_rt',
3434
'libcompiler_rt-legacysjlj',
35+
'libcompiler_rt-wasmsjlj',
3536
'libcompiler_rt-ww',
3637
'libc',
3738
'libc-debug',
@@ -40,13 +41,16 @@
4041
'libc_optz-debug',
4142
'libc++abi',
4243
'libc++abi-legacyexcept',
44+
'libc++abi-wasmexcept',
4345
'libc++abi-noexcept',
4446
'libc++abi-debug',
4547
'libc++abi-debug-legacyexcept',
48+
'libc++abi-debug-wasmexcept',
4649
'libc++abi-debug-noexcept',
4750
'libc++abi-debug-ww-noexcept',
4851
'libc++',
4952
'libc++-legacyexcept',
53+
'libc++-wasmexcept',
5054
'libc++-noexcept',
5155
'libc++-ww-noexcept',
5256
'libal',
@@ -80,6 +84,7 @@
8084
'crt1_proxy_main',
8185
'crtbegin',
8286
'libunwind-legacyexcept',
87+
'libunwind-wasmexcept',
8388
'libnoexit',
8489
'sqlite3',
8590
'sqlite3-mt',

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,8 @@ https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-
11651165
If false, emit instructions for the standardized exception handling proposal:
11661166
https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md
11671167

1168+
.. note:: Applicable during both linking and compilation
1169+
11681170
Default value: true
11691171

11701172
.. _nodejs_catch_exit:

src/cpuprofiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ var emscriptenCpuProfiler = {
225225
if (i != 2) cs += ' <- ';
226226
var fn = funcs[i];
227227
var at = fn.indexOf('@');
228-
if (at != -1) fn = fn.substr(0, at);
228+
if (at != -1) fn = fn.slice(0, at);
229229
fn = fn.trim();
230230
cs += '"' + fn + '"';
231231
}

src/emrun_prejs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Route URL GET parameters to argc+argv
1111
if (typeof window == 'object') {
12-
Module['arguments'] = window.location.search.substr(1).trim().split('&');
12+
Module['arguments'] = window.location.search.slice(1).trim().split('&');
1313
for (let i = 0; i < Module['arguments'].length; ++i) {
1414
Module['arguments'][i] = decodeURI(Module['arguments'][i]);
1515
}

src/lib/libbootstrap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ addToLibrary({
4343
// extra effort to support printf, even without a filesystem. very partial, very hackish
4444
var result = formatString(format, varargs);
4545
var string = intArrayToString(result);
46-
if (string[string.length-1] === '\n') string = string.substr(0, string.length-1); // remove a final \n, as Module.print will do that
46+
if (string.endsWith('\n')) string = string.slice(0, -1); // remove a final \n, as Module.print will do that
4747
out(string);
4848
return result.length;
4949
},
@@ -52,8 +52,8 @@ addToLibrary({
5252
puts: (s) => {
5353
// extra effort to support puts, even without a filesystem. very partial, very hackish
5454
var result = UTF8ToString(s);
55-
var string = result.substr(0);
56-
if (string[string.length-1] === '\n') string = string.substr(0, string.length-1); // remove a final \n, as Module.print will do that
55+
var string = result;
56+
if (string.endsWith('\n')) string = string.slice(0, -1); // remove a final \n, as Module.print will do that
5757
out(string);
5858
return result.length;
5959
},

src/lib/libbrowser.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ var LibraryBrowser = {
8888

8989
var audioPlugin = {};
9090
audioPlugin['canHandle'] = function audioPlugin_canHandle(name) {
91-
return !Module['noAudioDecoding'] && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
91+
return !Module['noAudioDecoding'] && name.slice(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
9292
};
9393
audioPlugin['handle'] = function audioPlugin_handle(byteArray, name, onload, onerror) {
9494
var done = false;
@@ -138,7 +138,7 @@ var LibraryBrowser = {
138138
}
139139
return ret;
140140
}
141-
audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
141+
audio.src = 'data:audio/x-' + name.slice(-3) + ';base64,' + encode64(byteArray);
142142
finish(audio); // we don't wait for confirmation this worked - but it's worth trying
143143
};
144144
audio.src = url;
@@ -348,7 +348,7 @@ var LibraryBrowser = {
348348
'ogg': 'audio/ogg',
349349
'wav': 'audio/wav',
350350
'mp3': 'audio/mpeg'
351-
}[name.substr(name.lastIndexOf('.')+1)];
351+
}[name.slice(name.lastIndexOf('.')+1)];
352352
},
353353

354354
getUserMedia(func) {
@@ -552,7 +552,7 @@ var LibraryBrowser = {
552552
}
553553
var w = wNative;
554554
var h = hNative;
555-
if (Module['forcedAspectRatio'] && Module['forcedAspectRatio'] > 0) {
555+
if (Module['forcedAspectRatio'] > 0) {
556556
if (w/h < Module['forcedAspectRatio']) {
557557
w = Math.round(h * Module['forcedAspectRatio']);
558558
} else {
@@ -732,7 +732,7 @@ var LibraryBrowser = {
732732
var styleSheet = document.styleSheets[0];
733733
var rules = styleSheet.cssRules;
734734
for (var i = 0; i < rules.length; i++) {
735-
if (rules[i].cssText.substr(0, 6) == 'canvas') {
735+
if (rules[i].cssText.startsWith('canvas')) {
736736
styleSheet.deleteRule(i);
737737
i--;
738738
}

src/lib/libc_preprocessor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ addToLibrary({
9696
}
9797
} else if (kind == 1/*operator symbol*/) {
9898
// Lookahead for two-character operators.
99-
var op2 = exprString.substr(i, 2);
99+
var op2 = exprString.slice(i, i + 2);
100100
if (['<=', '>=', '==', '!=', '&&', '||'].includes(op2)) {
101101
out.push(op2);
102102
++i;

src/lib/libembind_shared.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ var LibraryEmbindShared = {
128128
const argsIndex = signature.indexOf("(");
129129
if (argsIndex !== -1) {
130130
#if ASSERTIONS
131-
assert(signature[signature.length - 1] == ")", "Parentheses for argument names should match.");
131+
assert(signature.endsWith(")"), "Parentheses for argument names should match.");
132132
#endif
133-
return signature.substr(0, argsIndex);
133+
return signature.slice(0, argsIndex);
134134
} else {
135135
return signature;
136136
}
@@ -141,9 +141,9 @@ var LibraryEmbindShared = {
141141
const argsIndex = signature.indexOf("(") + 1;
142142
if (argsIndex !== 0) {
143143
#if ASSERTIONS
144-
assert(signature[signature.length - 1] == ")", "Parentheses for argument names should match.");
144+
assert(signature.endsWith(")"), "Parentheses for argument names should match.");
145145
#endif
146-
return signature.substr(argsIndex, signature.length - argsIndex - 1).replaceAll(" ", "").split(",").filter(n => n.length);
146+
return signature.slice(argsIndex, -1).replaceAll(" ", "").split(",").filter(n => n.length);
147147
} else {
148148
return [];
149149
}

src/lib/libeventloop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ LibraryJSEventLoop = {
489489
}
490490

491491
if (!noSetTiming) {
492-
if (fps && fps > 0) {
492+
if (fps > 0) {
493493
_emscripten_set_main_loop_timing({{{ cDefs.EM_TIMING_SETTIMEOUT }}}, 1000.0 / fps);
494494
} else {
495495
// Do rAF by rendering each frame (no decimating)

0 commit comments

Comments
 (0)