Upgrade to SpiderMonkey 140. (#38563)

Upgrade to use the latest mozjs upgrade.

Testing: Covered by existing WPT.

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-08-20 03:35:35 -04:00 committed by GitHub
parent b6cb57287f
commit 604b6ea26d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 29 deletions

View file

@ -81,7 +81,7 @@ jobs:
uses: nttld/setup-ndk@v1 uses: nttld/setup-ndk@v1
id: setup-ndk id: setup-ndk
with: with:
ndk-version: r28 ndk-version: r28b
- name: Setup Gradle caches - name: Setup Gradle caches
uses: gradle/actions/setup-gradle@v4 uses: gradle/actions/setup-gradle@v4
- name: Trigger initial download of Gradle with retries - name: Trigger initial download of Gradle with retries

22
Cargo.lock generated
View file

@ -2384,7 +2384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -3045,7 +3045,7 @@ dependencies = [
"gobject-sys", "gobject-sys",
"libc", "libc",
"system-deps", "system-deps",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -4540,7 +4540,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"libc", "libc",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -4844,7 +4844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.6", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@ -5238,7 +5238,7 @@ dependencies = [
[[package]] [[package]]
name = "mozjs" name = "mozjs"
version = "0.14.1" version = "0.14.1"
source = "git+https://github.com/servo/mozjs#e0a4ee47e686f581faefb201a6fd73bd4dcd67f0" source = "git+https://github.com/servo/mozjs#518ee8df6f7dcc85bbe184d562cea69c505fc7cc"
dependencies = [ dependencies = [
"bindgen 0.71.1", "bindgen 0.71.1",
"cc", "cc",
@ -5250,8 +5250,8 @@ dependencies = [
[[package]] [[package]]
name = "mozjs_sys" name = "mozjs_sys"
version = "0.137.0-2" version = "0.140.0-0"
source = "git+https://github.com/servo/mozjs#e0a4ee47e686f581faefb201a6fd73bd4dcd67f0" source = "git+https://github.com/servo/mozjs#518ee8df6f7dcc85bbe184d562cea69c505fc7cc"
dependencies = [ dependencies = [
"bindgen 0.71.1", "bindgen 0.71.1",
"cc", "cc",
@ -7011,7 +7011,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.4.15", "linux-raw-sys 0.4.15",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -7024,7 +7024,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.9.4", "linux-raw-sys 0.9.4",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -8431,7 +8431,7 @@ dependencies = [
"getrandom 0.3.3", "getrandom 0.3.3",
"once_cell", "once_cell",
"rustix 1.0.8", "rustix 1.0.8",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@ -9966,7 +9966,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]

View file

@ -216,7 +216,6 @@ pub struct Preferences {
pub js_mem_max: i64, pub js_mem_max: i64,
pub js_native_regex_enabled: bool, pub js_native_regex_enabled: bool,
pub js_offthread_compilation_enabled: bool, pub js_offthread_compilation_enabled: bool,
pub js_parallel_parsing_enabled: bool,
pub js_shared_memory: bool, pub js_shared_memory: bool,
pub js_throw_on_asmjs_validation_failure: bool, pub js_throw_on_asmjs_validation_failure: bool,
pub js_throw_on_debuggee_would_run: bool, pub js_throw_on_debuggee_would_run: bool,
@ -394,7 +393,6 @@ impl Preferences {
js_mem_max: -1, js_mem_max: -1,
js_native_regex_enabled: true, js_native_regex_enabled: true,
js_offthread_compilation_enabled: true, js_offthread_compilation_enabled: true,
js_parallel_parsing_enabled: true,
js_shared_memory: true, js_shared_memory: true,
js_throw_on_asmjs_validation_failure: false, js_throw_on_asmjs_validation_failure: false,
js_throw_on_debuggee_would_run: false, js_throw_on_debuggee_would_run: false,

View file

@ -21,19 +21,19 @@ use std::{os, ptr, thread};
use background_hang_monitor_api::ScriptHangAnnotation; use background_hang_monitor_api::ScriptHangAnnotation;
use js::conversions::jsstr_to_string; use js::conversions::jsstr_to_string;
use js::glue::{ use js::glue::{
CollectServoSizes, CreateJobQueue, DeleteJobQueue, DispatchableRun, JS_GetReservedSlot, CollectServoSizes, CreateJobQueue, DeleteJobQueue, DispatchablePointer, DispatchableRun,
JobQueueTraps, RUST_js_GetErrorMessage, SetBuildId, StreamConsumerConsumeChunk, JS_GetReservedSlot, JobQueueTraps, RUST_js_GetErrorMessage, SetBuildId, SetUpEventLoopDispatch,
StreamConsumerNoteResponseURLs, StreamConsumerStreamEnd, StreamConsumerStreamError, StreamConsumerConsumeChunk, StreamConsumerNoteResponseURLs, StreamConsumerStreamEnd,
StreamConsumerStreamError,
}; };
use js::jsapi::{ use js::jsapi::{
AsmJSOption, BuildIdCharVector, CompilationType, ContextOptionsRef, Dispatchable as JSRunnable, AsmJSOption, BuildIdCharVector, CompilationType, ContextOptionsRef,
Dispatchable_MaybeShuttingDown, GCDescription, GCOptions, GCProgress, GCReason, Dispatchable_MaybeShuttingDown, GCDescription, GCOptions, GCProgress, GCReason,
GetPromiseUserInputEventHandlingState, HandleObject, HandleString, GetPromiseUserInputEventHandlingState, HandleObject, HandleString,
HandleValue as RawHandleValue, Heap, InitConsumeStreamCallback, InitDispatchToEventLoop, HandleValue as RawHandleValue, Heap, InitConsumeStreamCallback, JS_AddExtraGCRootsTracer,
JS_AddExtraGCRootsTracer, JS_InitDestroyPrincipalsCallback, JS_InitReadPrincipalsCallback, JS_InitDestroyPrincipalsCallback, JS_InitReadPrincipalsCallback, JS_NewObject,
JS_NewObject, JS_NewStringCopyN, JS_SetGCCallback, JS_SetGCParameter, JS_NewStringCopyN, JS_SetGCCallback, JS_SetGCParameter, JS_SetGlobalJitCompilerOption,
JS_SetGlobalJitCompilerOption, JS_SetOffthreadIonCompilationEnabled, JS_SetOffthreadIonCompilationEnabled, JS_SetReservedSlot, JS_SetSecurityCallbacks,
JS_SetParallelParsingEnabled, JS_SetReservedSlot, JS_SetSecurityCallbacks,
JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_RESERVED_SLOTS_SHIFT, JSClass, JSClassOps, JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_RESERVED_SLOTS_SHIFT, JSClass, JSClassOps,
JSContext as RawJSContext, JSGCParamKey, JSGCStatus, JSJitCompilerOption, JSObject, JSContext as RawJSContext, JSGCParamKey, JSGCStatus, JSJitCompilerOption, JSObject,
JSSecurityCallbacks, JSTracer, JobQueue, MimeType, MutableHandleObject, MutableHandleString, JSSecurityCallbacks, JSTracer, JobQueue, MimeType, MutableHandleObject, MutableHandleString,
@ -694,7 +694,7 @@ impl Runtime {
unsafe extern "C" fn dispatch_to_event_loop( unsafe extern "C" fn dispatch_to_event_loop(
closure: *mut c_void, closure: *mut c_void,
dispatchable: *mut JSRunnable, dispatchable: *mut DispatchablePointer,
) -> bool { ) -> bool {
let networking_task_src: &SendableTaskSource = &*(closure as *mut SendableTaskSource); let networking_task_src: &SendableTaskSource = &*(closure as *mut SendableTaskSource);
let runnable = Runnable(dispatchable); let runnable = Runnable(dispatchable);
@ -711,7 +711,7 @@ impl Runtime {
let mut networking_task_src_ptr = std::ptr::null_mut(); let mut networking_task_src_ptr = std::ptr::null_mut();
if let Some(source) = networking_task_source { if let Some(source) = networking_task_source {
networking_task_src_ptr = Box::into_raw(Box::new(source)); networking_task_src_ptr = Box::into_raw(Box::new(source));
InitDispatchToEventLoop( SetUpEventLoopDispatch(
cx, cx,
Some(dispatch_to_event_loop), Some(dispatch_to_event_loop),
networking_task_src_ptr as *mut c_void, networking_task_src_ptr as *mut c_void,
@ -777,7 +777,6 @@ impl Runtime {
JSJitCompilerOption::JSJITCOMPILER_NATIVE_REGEXP_ENABLE, JSJitCompilerOption::JSJITCOMPILER_NATIVE_REGEXP_ENABLE,
pref!(js_native_regex_enabled) as u32, pref!(js_native_regex_enabled) as u32,
); );
JS_SetParallelParsingEnabled(cx, pref!(js_parallel_parsing_enabled));
JS_SetOffthreadIonCompilationEnabled(cx, pref!(js_offthread_compilation_enabled)); JS_SetOffthreadIonCompilationEnabled(cx, pref!(js_offthread_compilation_enabled));
JS_SetGlobalJitCompilerOption( JS_SetGlobalJitCompilerOption(
cx, cx,
@ -1263,7 +1262,7 @@ unsafe extern "C" fn report_stream_error(_cx: *mut RawJSContext, error_code: usi
); );
} }
pub(crate) struct Runnable(*mut JSRunnable); pub(crate) struct Runnable(*mut DispatchablePointer);
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe impl Sync for Runnable {} unsafe impl Sync for Runnable {}

View file

@ -8,6 +8,6 @@
[X Creating ConstantSourceNode(context) and DelayNode(context) incorrectly threw ReferenceError: "DelayNode is not defined".] [X Creating ConstantSourceNode(context) and DelayNode(context) incorrectly threw ReferenceError: "DelayNode is not defined".]
expected: FAIL expected: FAIL
[X Setting delayTime to 3 frames incorrectly threw TypeError: "delay is undefined".] [X Setting delayTime to 3 frames incorrectly threw TypeError: "can't access property "delayTime", delay is undefined".]
expected: FAIL expected: FAIL

View file

@ -10651,7 +10651,7 @@
[] []
], ],
"interfaces.js": [ "interfaces.js": [
"24c7fa68dbca91a9d26b2534c81ea7338cb2102a", "52fc87e916db0cd9143304eac883d975b6faf75e",
[] []
], ],
"max-session-history-frame.html": [ "max-session-history-frame.html": [

View file

@ -50,6 +50,7 @@ function test_interfaces(interfaceNamesInGlobalScope) {
"String", "String",
"Symbol", "Symbol",
"SyntaxError", "SyntaxError",
"Temporal",
"TextMetrics", "TextMetrics",
"TypeError", "TypeError",
"URIError", "URIError",