Skip to content

Commit 48c1f06

Browse files
committed
Merge branch 'main' into always-bulkmem
2 parents ec3483a + a90f70f commit 48c1f06

File tree

87 files changed

+899
-625
lines changed

Some content is hidden

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

87 files changed

+899
-625
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ jobs:
544544
test_targets: "
545545
lto2.test_dylink_syslibs_all
546546
lto2.test_float_builtins
547+
lto2.test_avx_nontrapping
547548
lto0.test_exceptions_allowed_uncaught
548549
lto0.test_longjmp_standalone_standalone
549550
lto0.test_embind_i64_val

ChangeLog.md

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

2121
3.1.72 (in development)
2222
-----------------------
23+
- The `MEMORY64` setting is no longer experimental. At time of writing all
24+
browsers still require a flag to run the resulting binaries but that should
25+
change in the coming months since the proposal is now at stage 4. (#22864)
2326

2427
3.1.71 - 11/04/24
2528
-----------------

site/source/docs/api_reference/html5.h.rst

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Struct
244244

245245
Maximum size 32 ``char`` (i.e. ``EM_UTF8 code[32]``).
246246

247-
.. c:member:: unsigned long location
247+
.. c:member:: unsigned int location
248248
249249
Indicates the location of the key on the keyboard. One of the :c:data:`DOM_KEY_LOCATION <DOM_KEY_LOCATION_STANDARD>` values.
250250

@@ -273,20 +273,20 @@ Struct
273273

274274
.. warning:: This attribute has been dropped from DOM Level 3 events.
275275

276-
.. c:member:: unsigned long charCode
276+
.. c:member:: unsigned int charCode
277277
278278
The Unicode reference number of the key; this attribute is used only by the keypress event. For keys whose ``char`` attribute contains multiple characters, this is the Unicode value of the first character in that attribute.
279279

280280
.. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available.
281281

282-
.. c:member:: unsigned long keyCode
282+
.. c:member:: unsigned int keyCode
283283
284284
A system and implementation dependent numerical code identifying the unmodified value of the pressed key.
285285

286286
.. warning:: This attribute is deprecated, you should use the field ``key`` instead, if available.
287287

288288

289-
.. c:member:: unsigned long which
289+
.. c:member:: unsigned int which
290290
291291
A system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as ``keyCode``.
292292

@@ -364,13 +364,13 @@ Struct
364364
365365
Absolute wallclock time when the data was recorded (milliseconds).
366366
367-
.. c:member:: long screenX
368-
long screenY
367+
.. c:member:: int screenX
368+
int screenY
369369
370370
The coordinates relative to the browser screen coordinate system.
371371
372-
.. c:member:: long clientX
373-
long clientY
372+
.. c:member:: int clientX
373+
int clientY
374374
375375
The coordinates relative to the viewport associated with the event.
376376
@@ -396,24 +396,24 @@ Struct
396396
397397
A bitmask that indicates which combinations of mouse buttons were being held down at the time of the event.
398398
399-
.. c:member:: long movementX
400-
long movementY;
399+
.. c:member:: int movementX
400+
int movementY;
401401
402402
If pointer lock is active, these two extra fields give relative mouse movement since the last event.
403403

404-
.. c:member:: long targetX
405-
long targetY
404+
.. c:member:: int targetX
405+
int targetY
406406

407407
These fields give the mouse coordinates mapped relative to the coordinate space of the target DOM element receiving the input events (Emscripten-specific extension; coordinates are rounded down to the nearest integer).
408408

409409

410-
.. c:member:: long canvasX
411-
long canvasY
410+
.. c:member:: int canvasX
411+
int canvasY
412412

413413
These fields give the mouse coordinates mapped to the Emscripten canvas client area (Emscripten-specific extension; coordinates are rounded down the nearest integer).
414414

415415

416-
.. c:member:: long padding
416+
.. c:member:: int padding
417417
418418
Internal, and can be ignored.
419419

@@ -517,7 +517,7 @@ Struct
517517
in scroll values of 0. The positive Y scroll direction is when scrolling the page downwards (page CSS pixel +Y direction), which corresponds to scrolling
518518
the mouse wheel downwards (away from the screen) on Windows, Linux, and also on macOS when the 'natural scroll' option is disabled.
519519
520-
.. c:member:: unsigned long deltaMode
520+
.. c:member:: unsigned int deltaMode
521521
522522
One of the :c:data:`DOM_DELTA_<DOM_DELTA_PIXEL>` values that indicates the units of measurement for the delta values.
523523
@@ -579,7 +579,7 @@ Struct
579579
The event structure passed in DOM element `UIEvent <https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#interface-UIEvent>`_ events: `resize <https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-resize>`_ and `scroll <https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#event-type-scroll>`_.
580580
581581
582-
.. c:member:: long detail
582+
.. c:member:: int detail
583583
584584
For resize and scroll events this is always zero.
585585
@@ -1487,22 +1487,22 @@ Struct
14871487
14881488
Specifies the status of a single `touch point <http://www.w3.org/TR/touch-events/#touch-interface>`_ on the page.
14891489
1490-
.. c:member:: long identifier
1490+
.. c:member:: int identifier
14911491
14921492
An identification number for each touch point.
14931493
1494-
.. c:member:: long screenX
1495-
long screenY
1494+
.. c:member:: int screenX
1495+
int screenY
14961496
14971497
The touch coordinate relative to the whole screen origin, in pixels.
14981498
1499-
.. c:member:: long clientX
1500-
long clientY
1499+
.. c:member:: int clientX
1500+
int clientY
15011501
15021502
The touch coordinate relative to the viewport, in pixels.
15031503
1504-
.. c:member:: long pageX
1505-
long pageY
1504+
.. c:member:: int pageX
1505+
int pageY
15061506
15071507
The touch coordinate relative to the viewport, in pixels, and including any scroll offset.
15081508
@@ -1514,13 +1514,13 @@ Struct
15141514
15151515
Specifies whether this touch point is still above the original target on which it was initially pressed.
15161516
1517-
.. c:member:: long targetX
1518-
long targetY
1517+
.. c:member:: int targetX
1518+
int targetY
15191519
15201520
These fields give the touch coordinates mapped relative to the coordinate space of the target DOM element receiving the input events (Emscripten-specific extension).
15211521
1522-
.. c:member:: long canvasX
1523-
long canvasY
1522+
.. c:member:: int canvasX
1523+
int canvasY
15241524
15251525
The touch coordinates mapped to the Emscripten canvas client area, in pixels (Emscripten-specific extension).
15261526
@@ -1643,7 +1643,7 @@ Struct
16431643
16441644
Specifies whether this gamepad is connected to the browser page.
16451645
1646-
.. c:member:: long index
1646+
.. c:member:: int index
16471647
16481648
An ordinal associated with this gamepad, zero-based.
16491649

site/source/docs/tools_reference/settings_reference.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,9 @@ Default value: true
32973297
RUNTIME_DEBUG
32983298
=============
32993299

3300-
If true, add tracing to core runtime functions.
3300+
If non-zero, add tracing to core runtime functions. Can be set to 2 for
3301+
extra tracing (for example, tracing that occurs on each turn of the event
3302+
loop or each user callback, which can flood the console).
33013303
This setting is enabled by default if any of the following debugging settings
33023304
are enabled:
33033305
- PTHREADS_DEBUG
@@ -3311,7 +3313,7 @@ are enabled:
33113313
- SOCKET_DEBUG
33123314
- FETCH_DEBUG
33133315

3314-
Default value: false
3316+
Default value: 0
33153317

33163318
.. _legacy_runtime:
33173319

src/library.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,16 +2046,12 @@ addToLibrary({
20462046
// at runtime.
20472047
$keepRuntimeAlive__deps: ['$runtimeKeepaliveCounter'],
20482048
$keepRuntimeAlive: () => noExitRuntime || runtimeKeepaliveCounter > 0,
2049-
#elif !EXIT_RUNTIME
2050-
// When `noExitRuntime` is not include and EXIT_RUNTIME=0 then we know the
2049+
#elif !EXIT_RUNTIME && !PTHREADS
2050+
// When `noExitRuntime` is not included and EXIT_RUNTIME=0 then we know the
20512051
// runtime can never exit (i.e. should always be kept alive).
2052-
// However for pthreads we always default to allowing the runtime to exit
2053-
// otherwise threads never exit and are not joinable.
2054-
#if PTHREADS
2055-
$keepRuntimeAlive: () => !ENVIRONMENT_IS_PTHREAD,
2056-
#else
2052+
// However, since pthreads themselves always need to be able to exit we
2053+
// have to track `runtimeKeepaliveCounter` in that case.
20572054
$keepRuntimeAlive: () => true,
2058-
#endif
20592055
#else
20602056
$keepRuntimeAlive__deps: ['$runtimeKeepaliveCounter'],
20612057
$keepRuntimeAlive: () => runtimeKeepaliveCounter > 0,
@@ -2128,7 +2124,7 @@ addToLibrary({
21282124
return;
21292125
}
21302126
#endif
2131-
#if RUNTIME_DEBUG
2127+
#if RUNTIME_DEBUG >= 2
21322128
dbg(`maybeExit: user callback done: runtimeKeepaliveCounter=${runtimeKeepaliveCounter}`);
21332129
#endif
21342130
if (!keepRuntimeAlive()) {

src/library_browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ var LibraryBrowser = {
192192
},
193193

194194
createContext(/** @type {HTMLCanvasElement} */ canvas, useWebGL, setInModule, webGLContextAttributes) {
195-
if (useWebGL && Module.ctx && canvas == Module.canvas) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas.
195+
if (useWebGL && Module.ctx && canvas == Module['canvas']) return Module.ctx; // no need to recreate GL context if it's already been created for this canvas.
196196

197197
var ctx;
198198
var contextHandle;

src/library_egl.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ var LibraryEGL = {
634634
eglGetCurrentDisplay: () => EGL.currentContext ? {{{ eglDefaultDisplay }}} : 0,
635635

636636
// EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
637+
eglSwapBuffers__deps: ['$GLctx'],
637638
eglSwapBuffers__proxy: 'sync',
638639
eglSwapBuffers: (dpy, surface) => {
639640
#if PROXY_TO_WORKER
@@ -642,9 +643,9 @@ var LibraryEGL = {
642643

643644
if (!EGL.defaultDisplayInitialized) {
644645
EGL.setErrorCode(0x3001 /* EGL_NOT_INITIALIZED */);
645-
} else if (!Module.ctx) {
646+
} else if (!GLctx) {
646647
EGL.setErrorCode(0x3002 /* EGL_BAD_ACCESS */);
647-
} else if (Module.ctx.isContextLost()) {
648+
} else if (GLctx.isContextLost()) {
648649
EGL.setErrorCode(0x300E /* EGL_CONTEXT_LOST */);
649650
} else {
650651
// According to documentation this does an implicit flush.

src/library_fs.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ FS.staticInit();
6363
trackingDelegate: {},
6464
#endif
6565
ErrnoError: null, // set during init
66-
genericErrors: {},
6766
filesystems: null,
6867
syncFSRequests: 0, // we warn if there are multiple in flight at once
6968
#if expectToReceiveOnModule('logReadFiles')
@@ -1435,12 +1434,6 @@ FS.staticInit();
14351434
#endif
14361435
},
14371436
staticInit() {
1438-
// Some errors may happen quite a bit, to avoid overhead we reuse them (and suffer a lack of stack info)
1439-
[{{{ cDefs.ENOENT }}}].forEach((code) => {
1440-
FS.genericErrors[code] = new FS.ErrnoError(code);
1441-
FS.genericErrors[code].stack = '<generic error, no stack>';
1442-
});
1443-
14441437
FS.nameTable = new Array(4096);
14451438

14461439
FS.mount(MEMFS, {}, '/');

src/library_glfw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ var LibraryGLFW = {
419419
// This logic comes directly from the sdl implementation. We cannot
420420
// call preventDefault on all keydown events otherwise onKeyPress will
421421
// not get called
422-
if (event.keyCode === 8 /* backspace */ || event.keyCode === 9 /* tab */) {
422+
if (event.key == 'Backspace' || event.key == 'Tab') {
423423
event.preventDefault();
424424
}
425425
},

src/library_glut.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ var LibraryGLUT = {
399399
var now = Date.now();
400400
return now - GLUT.initTime;
401401
case 0x0069: /* GLUT_WINDOW_STENCIL_SIZE */
402-
return Module.ctx.getContextAttributes().stencil ? 8 : 0;
402+
return GLctx.getContextAttributes().stencil ? 8 : 0;
403403
case 0x006A: /* GLUT_WINDOW_DEPTH_SIZE */
404-
return Module.ctx.getContextAttributes().depth ? 8 : 0;
404+
return GLctx.getContextAttributes().depth ? 8 : 0;
405405
case 0x006E: /* GLUT_WINDOW_ALPHA_SIZE */
406-
return Module.ctx.getContextAttributes().alpha ? 8 : 0;
406+
return GLctx.getContextAttributes().alpha ? 8 : 0;
407407
case 0x0078: /* GLUT_WINDOW_NUM_SAMPLES */
408-
return Module.ctx.getContextAttributes().antialias ? 1 : 0;
408+
return GLctx.getContextAttributes().antialias ? 1 : 0;
409409

410410
default:
411411
throw "glutGet(" + type + ") not implemented yet";

0 commit comments

Comments
 (0)