From 75ace6b874055423a6d086e41ef60fbf64e7eac0 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Wed, 24 Aug 2016 16:29:36 -0700 Subject: [PATCH 1/8] Update friendly rustic API for the great rt -> cx refactor and rooting stacks move to Zone --- src/jsglue.cpp | 4 +-- src/rust.rs | 87 ++++++++++++++++++++++++++++---------------------- 2 files changed, 50 insertions(+), 41 deletions(-) diff --git a/src/jsglue.cpp b/src/jsglue.cpp index 575363a43..06996e7ca 100644 --- a/src/jsglue.cpp +++ b/src/jsglue.cpp @@ -734,10 +734,10 @@ static size_t MallocSizeOf(const void* aPtr) } bool -CollectServoSizes(JSRuntime *rt, JS::ServoSizes *sizes) +CollectServoSizes(JSContext* cx, JS::ServoSizes *sizes) { mozilla::PodZero(sizes); - return JS::AddServoSizeOf(rt, MallocSizeOf, + return JS::AddServoSizeOf(cx, MallocSizeOf, /* ObjectPrivateVisitor = */ nullptr, sizes); } diff --git a/src/rust.rs b/src/rust.rs index ac45fcfbd..d46a5e51e 100644 --- a/src/rust.rs +++ b/src/rust.rs @@ -18,9 +18,9 @@ use std::cell::UnsafeCell; use std::marker::PhantomData; use consts::{JSCLASS_RESERVED_SLOTS_MASK, JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IS_GLOBAL}; use jsapi; -use jsapi::{JS_Init, JS_GetContext, JS_NewRuntime, JS_DestroyRuntime}; -use jsapi::{JSContext, JSRuntime, JSObject, JSFlatString, JSFunction, JSString, Symbol, JSScript, jsid, Value}; -use jsapi::{RuntimeOptionsRef, ReadOnlyCompileOptions}; +use jsapi::{InitWithFailureDiagnostic, JS_NewContext, JS_DestroyContext}; +use jsapi::{JSContext, JSObject, JSFlatString, JSFunction, JSString, Symbol, JSScript, jsid, Value}; +use jsapi::{ContextOptionsRef, ReadOnlyCompileOptions}; use jsapi::{SetWarningReporter, Evaluate2, JSErrorReport}; use jsapi::{JS_SetGCParameter, JSGCParamKey}; use jsapi::{Heap, HeapObjectPostBarrier, HeapValuePostBarrier}; @@ -103,37 +103,43 @@ impl ToResult for bool { // ___________________________________________________________________________ // friendly Rustic API to runtimes -/// A wrapper for the `JSRuntime` and `JSContext` structures in SpiderMonkey. +/// A wrapper for the `JSContext` structure in SpiderMonkey. pub struct Runtime { - rt: *mut JSRuntime, cx: *mut JSContext, } impl Runtime { - /// Creates a new `JSRuntime` and `JSContext`. + /// Creates a new `JSContext`. pub fn new() -> Runtime { unsafe { - struct TopRuntime(*mut JSRuntime); - unsafe impl Sync for TopRuntime {} + struct TopContext(*mut JSContext); + unsafe impl Sync for TopContext {} lazy_static! { - static ref PARENT: TopRuntime = { + static ref PARENT: TopContext = { unsafe { - assert!(JS_Init()); - let runtime = JS_NewRuntime( + // Yes, this is asserting that this call returns *null* + // (not non-null) on purpose. Unlike the rest of JSAPI, + // this function returns non-null on failure and null on + // success. + assert!(InitWithFailureDiagnostic(if cfg!(feature = "debugmozjs") { + true + } else { + false + }).is_null()); + + let context = JS_NewContext( default_heapsize, ChunkSize as u32, ptr::null_mut()); - assert!(!runtime.is_null()); - let context = JS_GetContext(runtime); assert!(!context.is_null()); InitSelfHostedCode(context); - TopRuntime(runtime) + TopContext(context) } }; } - let js_runtime = - JS_NewRuntime(default_heapsize, ChunkSize as u32, PARENT.0); - assert!(!js_runtime.is_null()); + let js_context = + JS_NewContext(default_heapsize, ChunkSize as u32, PARENT.0); + assert!(!js_context.is_null()); // Unconstrain the runtime's threshold on nominal heap size, to avoid // triggering GC too often if operating continuously near an arbitrary @@ -141,41 +147,32 @@ impl Runtime { // still in effect to cause periodical, and we hope hygienic, // last-ditch GCs from within the GC's allocator. JS_SetGCParameter( - js_runtime, JSGCParamKey::JSGC_MAX_BYTES, u32::MAX); + js_context, JSGCParamKey::JSGC_MAX_BYTES, u32::MAX); JS_SetNativeStackQuota( - js_runtime, + js_context, STACK_QUOTA, STACK_QUOTA - SYSTEM_CODE_BUFFER, STACK_QUOTA - SYSTEM_CODE_BUFFER - TRUSTED_SCRIPT_BUFFER); - let js_context = JS_GetContext(js_runtime); - assert!(!js_context.is_null()); - InitSelfHostedCode(js_context); - let runtimeopts = RuntimeOptionsRef(js_runtime); - (*runtimeopts).set_baseline_(true); - (*runtimeopts).set_ion_(true); - (*runtimeopts).set_nativeRegExp_(true); + let opts = ContextOptionsRef(js_context); + (*opts).set_baseline_(true); + (*opts).set_ion_(true); + (*opts).set_nativeRegExp_(true); - SetWarningReporter(js_runtime, Some(report_warning)); + SetWarningReporter(js_context, Some(report_warning)); JS_BeginRequest(js_context); Runtime { - rt: js_runtime, cx: js_context, } } } - /// Returns the `JSRuntime` object. - pub fn rt(&self) -> *mut JSRuntime { - self.rt - } - - /// Returns the `JSContext` object. + /// Returns the underlying `JSContext` object. pub fn cx(&self) -> *mut JSContext { self.cx } @@ -215,7 +212,7 @@ impl Drop for Runtime { fn drop(&mut self) { unsafe { JS_EndRequest(self.cx); - JS_DestroyRuntime(self.rt); + JS_DestroyContext(self.cx); } } } @@ -285,14 +282,26 @@ impl Rooted { } } + unsafe fn get_root_stack(cx: &mut ContextFriendFields) + -> *mut *mut Rooted<*mut ::std::os::raw::c_void> + where T: RootKind + { + let kind = T::rootKind() as usize; + if let Some(zone) = cx.zone_.as_mut() { + &mut zone.stackRoots_[kind] as *mut _ as *mut _ + } else { + &mut cx._base.roots.stackRoots_[kind] as *mut _ as *mut _ + } + } + pub unsafe fn add_to_root_stack(&mut self, cx: *mut JSContext) where T: RootKind { let ctxfriend: &mut ContextFriendFields = mem::transmute(cx); - let kind = T::rootKind() as usize; - self.stack = &mut ctxfriend.roots.stackRoots_[kind] as *mut _ as *mut _; - self.prev = ctxfriend.roots.stackRoots_[kind] as *mut _; + self.stack = Self::get_root_stack(ctxfriend); + let stack = self.stack.as_mut().unwrap(); + self.prev = *stack as *mut _; - ctxfriend.roots.stackRoots_[kind] = self as *mut _ as usize as _; + *stack = self as *mut _ as usize as _; } pub unsafe fn remove_from_root_stack(&mut self) { From 501273c8aa13e5f2cbecdd9abf3e58b57e1c5b30 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 30 Aug 2016 14:10:18 -0700 Subject: [PATCH 2/8] Update the bindings for macos 64 --- src/jsapi_macos_64.rs | 1338 ++++++++++++++++++---------------- src/jsapi_macos_64_debug.rs | 1343 ++++++++++++++++++----------------- 2 files changed, 1418 insertions(+), 1263 deletions(-) diff --git a/src/jsapi_macos_64.rs b/src/jsapi_macos_64.rs index 6701214de..e24544c49 100644 --- a/src/jsapi_macos_64.rs +++ b/src/jsapi_macos_64.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; pub const JSITER_KEYVALUE: ::std::os::raw::c_uint = 4; @@ -308,8 +308,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -445,61 +450,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 16usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 32usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -508,6 +479,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -650,43 +624,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContexty(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContexty(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -703,7 +677,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -800,6 +774,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -852,10 +831,23 @@ pub struct _vftable_CallbackTracer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct CallbackTracer_ContextFunctor; +pub struct CallbackTracer_ContextFunctor { + pub _vftable: *const _vftable_CallbackTracer_ContextFunctor, +} +#[repr(C)] +pub struct _vftable_CallbackTracer_ContextFunctor { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for CallbackTracer_ContextFunctor { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_CallbackTracer_ContextFunctor() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for CallbackTracer { fn clone(&self) -> Self { *self } } @@ -1147,6 +1139,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1154,6 +1150,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1796,8 +1800,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2123,6 +2127,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2263,6 +2274,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2280,7 +2292,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2572,12 +2584,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2594,20 +2606,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2748,7 +2764,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -2956,13 +2972,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -2987,7 +3003,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3433,11 +3449,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3576,7 +3592,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3584,7 +3599,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3654,9 +3669,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3894,6 +3909,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4066,11 +4124,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4106,11 +4159,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option Self { *self } } @@ -4404,6 +4462,10 @@ impl ::std::clone::Clone for AllCompartments { pub struct ContentCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ContentCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ContentCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4412,6 +4474,10 @@ impl ::std::clone::Clone for ContentCompartmentsOnly { pub struct ChromeCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ChromeCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ChromeCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4421,6 +4487,10 @@ pub struct SingleCompartment { pub _base: CompartmentFilter, pub ours: *mut JSCompartment, } +#[repr(C)] +pub struct _vftable_SingleCompartment { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for SingleCompartment { fn clone(&self) -> Self { *self } } @@ -4435,6 +4505,10 @@ pub struct CompartmentsWithPrincipals { pub _base: CompartmentFilter, pub principals: *mut JSPrincipals, } +#[repr(C)] +pub struct _vftable_CompartmentsWithPrincipals { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for CompartmentsWithPrincipals { fn clone(&self) -> Self { *self } } @@ -4712,205 +4786,218 @@ pub enum JSErrNum { JSMSG_RESERVED_ID = 234, JSMSG_REST_WITH_DEFAULT = 235, JSMSG_SELFHOSTED_TOP_LEVEL_LEXICAL = 236, - JSMSG_SELFHOSTED_UNBOUND_NAME = 237, - JSMSG_SEMI_AFTER_FOR_COND = 238, - JSMSG_SEMI_AFTER_FOR_INIT = 239, - JSMSG_SEMI_BEFORE_STMNT = 240, - JSMSG_SOURCE_TOO_LONG = 241, - JSMSG_STMT_AFTER_RETURN = 242, - JSMSG_STRICT_CODE_WITH = 243, - JSMSG_TEMPLSTR_UNTERM_EXPR = 244, - JSMSG_SIMD_NOT_A_VECTOR = 245, - JSMSG_TOO_MANY_CASES = 246, - JSMSG_TOO_MANY_CATCH_VARS = 247, - JSMSG_TOO_MANY_CON_ARGS = 248, - JSMSG_TOO_MANY_DEFAULTS = 249, - JSMSG_TOO_MANY_FUN_ARGS = 250, - JSMSG_TOO_MANY_LOCALS = 251, - JSMSG_TOO_MANY_YIELDS = 252, - JSMSG_TOUGH_BREAK = 253, - JSMSG_UNEXPECTED_TOKEN = 254, - JSMSG_UNNAMED_CLASS_STMT = 255, - JSMSG_UNNAMED_FUNCTION_STMT = 256, - JSMSG_UNTERMINATED_COMMENT = 257, - JSMSG_UNTERMINATED_REGEXP = 258, - JSMSG_UNTERMINATED_STRING = 259, - JSMSG_USELESS_EXPR = 260, - JSMSG_USE_ASM_DIRECTIVE_FAIL = 261, - JSMSG_VAR_HIDES_ARG = 262, - JSMSG_WHILE_AFTER_DO = 263, - JSMSG_YIELD_IN_ARROW = 264, - JSMSG_YIELD_IN_DEFAULT = 265, - JSMSG_BAD_COLUMN_NUMBER = 266, - JSMSG_COMPUTED_NAME_IN_PATTERN = 267, - JSMSG_DEFAULT_IN_PATTERN = 268, - JSMSG_BAD_NEWTARGET = 269, - JSMSG_ESCAPED_KEYWORD = 270, - JSMSG_USE_ASM_TYPE_FAIL = 271, - JSMSG_USE_ASM_LINK_FAIL = 272, - JSMSG_USE_ASM_TYPE_OK = 273, - JSMSG_WASM_FAIL = 274, - JSMSG_WASM_DECODE_FAIL = 275, - JSMSG_WASM_TEXT_FAIL = 276, - JSMSG_WASM_BAD_IND_CALL = 277, - JSMSG_WASM_BAD_BUF_ARG = 278, - JSMSG_WASM_BAD_IMPORT_ARG = 279, - JSMSG_WASM_UNREACHABLE = 280, - JSMSG_WASM_INTEGER_OVERFLOW = 281, - JSMSG_WASM_INVALID_CONVERSION = 282, - JSMSG_WASM_INT_DIVIDE_BY_ZERO = 283, - JSMSG_WASM_OVERRECURSED = 284, - JSMSG_BAD_TRAP_RETURN_VALUE = 285, - JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 286, - JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 287, - JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 288, - JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 289, - JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 290, - JSMSG_CANT_CHANGE_EXTENSIBILITY = 291, - JSMSG_CANT_DEFINE_INVALID = 292, - JSMSG_CANT_DEFINE_NEW = 293, - JSMSG_CANT_DEFINE_NE_AS_NC = 294, - JSMSG_PROXY_DEFINE_RETURNED_FALSE = 295, - JSMSG_PROXY_DELETE_RETURNED_FALSE = 296, - JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 297, - JSMSG_PROXY_SET_RETURNED_FALSE = 298, - JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 299, - JSMSG_CANT_REPORT_C_AS_NC = 300, - JSMSG_CANT_REPORT_E_AS_NE = 301, - JSMSG_CANT_REPORT_INVALID = 302, - JSMSG_CANT_REPORT_NC_AS_NE = 303, - JSMSG_CANT_REPORT_NEW = 304, - JSMSG_CANT_REPORT_NE_AS_NC = 305, - JSMSG_CANT_SET_NW_NC = 306, - JSMSG_CANT_SET_WO_SETTER = 307, - JSMSG_CANT_SKIP_NC = 308, - JSMSG_ONWKEYS_STR_SYM = 309, - JSMSG_MUST_REPORT_SAME_VALUE = 310, - JSMSG_MUST_REPORT_UNDEFINED = 311, - JSMSG_OBJECT_ACCESS_DENIED = 312, - JSMSG_PROPERTY_ACCESS_DENIED = 313, - JSMSG_PROXY_CONSTRUCT_OBJECT = 314, - JSMSG_PROXY_EXTENSIBILITY = 315, - JSMSG_PROXY_GETOWN_OBJORUNDEF = 316, - JSMSG_PROXY_REVOKED = 317, - JSMSG_PROXY_ARG_REVOKED = 318, - JSMSG_BAD_TRAP = 319, - JSMSG_SC_BAD_CLONE_VERSION = 320, - JSMSG_SC_BAD_SERIALIZED_DATA = 321, - JSMSG_SC_DUP_TRANSFERABLE = 322, - JSMSG_SC_NOT_TRANSFERABLE = 323, - JSMSG_SC_UNSUPPORTED_TYPE = 324, - JSMSG_SC_SHMEM_MUST_TRANSFER = 325, - JSMSG_ASSIGN_FUNCTION_OR_NULL = 326, - JSMSG_DEBUG_BAD_LINE = 327, - JSMSG_DEBUG_BAD_OFFSET = 328, - JSMSG_DEBUG_BAD_REFERENT = 329, - JSMSG_DEBUG_BAD_RESUMPTION = 330, - JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 331, - JSMSG_DEBUG_CCW_REQUIRED = 332, - JSMSG_DEBUG_COMPARTMENT_MISMATCH = 333, - JSMSG_DEBUG_LOOP = 334, - JSMSG_DEBUG_NOT_DEBUGGEE = 335, - JSMSG_DEBUG_NOT_DEBUGGING = 336, - JSMSG_DEBUG_NOT_IDLE = 337, - JSMSG_DEBUG_NOT_LIVE = 338, - JSMSG_DEBUG_NO_SCOPE_OBJECT = 339, - JSMSG_DEBUG_OBJECT_PROTO = 340, - JSMSG_DEBUG_OBJECT_WRONG_OWNER = 341, - JSMSG_DEBUG_OPTIMIZED_OUT = 342, - JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 343, - JSMSG_DEBUG_VARIABLE_NOT_FOUND = 344, - JSMSG_DEBUG_WRAPPER_IN_WAY = 345, - JSMSG_DEBUGGEE_WOULD_RUN = 346, - JSMSG_NOT_CALLABLE_OR_UNDEFINED = 347, - JSMSG_NOT_TRACKING_ALLOCATIONS = 348, - JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 349, - JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 350, - JSMSG_QUERY_LINE_WITHOUT_URL = 351, - JSMSG_DEBUG_CANT_SET_OPT_ENV = 352, - JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 353, - JSMSG_DEBUG_CENSUS_BREAKDOWN = 354, - JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 355, - JSMSG_TRACELOGGER_ENABLE_FAIL = 356, - JSMSG_DATE_NOT_FINITE = 357, - JSMSG_INTERNAL_INTL_ERROR = 358, - JSMSG_INTL_OBJECT_NOT_INITED = 359, - JSMSG_INTL_OBJECT_REINITED = 360, - JSMSG_INVALID_CURRENCY_CODE = 361, - JSMSG_INVALID_DIGITS_VALUE = 362, - JSMSG_INVALID_LANGUAGE_TAG = 363, - JSMSG_INVALID_LOCALES_ELEMENT = 364, - JSMSG_INVALID_LOCALE_MATCHER = 365, - JSMSG_INVALID_OPTION_VALUE = 366, - JSMSG_INVALID_TIME_ZONE = 367, - JSMSG_UNDEFINED_CURRENCY = 368, - JSMSG_BACK_REF_OUT_OF_RANGE = 369, - JSMSG_BAD_CLASS_RANGE = 370, - JSMSG_ESCAPE_AT_END_OF_REGEXP = 371, - JSMSG_EXEC_NOT_OBJORNULL = 372, - JSMSG_INVALID_DECIMAL_ESCAPE = 373, - JSMSG_INVALID_GROUP = 374, - JSMSG_INVALID_IDENTITY_ESCAPE = 375, - JSMSG_INVALID_UNICODE_ESCAPE = 376, - JSMSG_MISSING_PAREN = 377, - JSMSG_NEWREGEXP_FLAGGED = 378, - JSMSG_NOTHING_TO_REPEAT = 379, - JSMSG_NUMBERS_OUT_OF_ORDER = 380, - JSMSG_RANGE_WITH_CLASS_ESCAPE = 381, - JSMSG_RAW_BRACE_IN_REGEP = 382, - JSMSG_RAW_BRACKET_IN_REGEP = 383, - JSMSG_TOO_MANY_PARENS = 384, - JSMSG_UNICODE_OVERFLOW = 385, - JSMSG_UNMATCHED_RIGHT_PAREN = 386, - JSMSG_UNTERM_CLASS = 387, - JSMSG_DEFAULT_LOCALE_ERROR = 388, - JSMSG_NO_SUCH_SELF_HOSTED_PROP = 389, - JSMSG_INVALID_PROTOTYPE = 390, - JSMSG_TYPEDOBJECT_BAD_ARGS = 391, - JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 392, - JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 393, - JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 394, - JSMSG_TYPEDOBJECT_TOO_BIG = 395, - JSMSG_SIMD_FAILED_CONVERSION = 396, - JSMSG_SIMD_TO_NUMBER = 397, - JSMSG_TOO_LONG_ARRAY = 398, - JSMSG_BAD_INDEX = 399, - JSMSG_NON_ARRAY_BUFFER_RETURNED = 400, - JSMSG_SAME_ARRAY_BUFFER_RETURNED = 401, - JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 402, - JSMSG_TYPED_ARRAY_BAD_ARGS = 403, - JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 404, - JSMSG_TYPED_ARRAY_DETACHED = 405, - JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 406, - JSMSG_SHARED_ARRAY_BAD_LENGTH = 407, - JSMSG_BAD_PARSE_NODE = 408, - JSMSG_SYMBOL_TO_STRING = 409, - JSMSG_SYMBOL_TO_NUMBER = 410, - JSMSG_ATOMICS_BAD_ARRAY = 411, - JSMSG_ATOMICS_TOO_LONG = 412, - JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 413, - JSMSG_CANT_SET_INTERPOSED = 414, - JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 415, - JSMSG_CANT_DELETE_WINDOW_ELEMENT = 416, - JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 417, - JSMSG_CANT_PREVENT_EXTENSIONS = 418, - JSMSG_NO_NAMED_SETTER = 419, - JSMSG_NO_INDEXED_SETTER = 420, - JSMSG_CANT_DELETE_SUPER = 421, - JSMSG_REINIT_THIS = 422, - JSMSG_BAD_DEFAULT_EXPORT = 423, - JSMSG_MISSING_INDIRECT_EXPORT = 424, - JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 425, - JSMSG_MISSING_IMPORT = 426, - JSMSG_AMBIGUOUS_IMPORT = 427, - JSMSG_MISSING_NAMESPACE_EXPORT = 428, - JSMSG_MISSING_EXPORT = 429, - JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 430, - JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 431, - JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 432, - JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 433, - JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 434, - JSErr_Limit = 435, + JSMSG_SELFHOSTED_METHOD_CALL = 237, + JSMSG_SELFHOSTED_UNBOUND_NAME = 238, + JSMSG_SEMI_AFTER_FOR_COND = 239, + JSMSG_SEMI_AFTER_FOR_INIT = 240, + JSMSG_SEMI_BEFORE_STMNT = 241, + JSMSG_SOURCE_TOO_LONG = 242, + JSMSG_STMT_AFTER_RETURN = 243, + JSMSG_STRICT_CODE_WITH = 244, + JSMSG_TEMPLSTR_UNTERM_EXPR = 245, + JSMSG_SIMD_NOT_A_VECTOR = 246, + JSMSG_TOO_MANY_CASES = 247, + JSMSG_TOO_MANY_CATCH_VARS = 248, + JSMSG_TOO_MANY_CON_ARGS = 249, + JSMSG_TOO_MANY_DEFAULTS = 250, + JSMSG_TOO_MANY_FUN_ARGS = 251, + JSMSG_TOO_MANY_LOCALS = 252, + JSMSG_TOO_MANY_YIELDS = 253, + JSMSG_TOUGH_BREAK = 254, + JSMSG_UNEXPECTED_TOKEN = 255, + JSMSG_UNNAMED_CLASS_STMT = 256, + JSMSG_UNNAMED_FUNCTION_STMT = 257, + JSMSG_UNTERMINATED_COMMENT = 258, + JSMSG_UNTERMINATED_REGEXP = 259, + JSMSG_UNTERMINATED_STRING = 260, + JSMSG_USELESS_EXPR = 261, + JSMSG_USE_ASM_DIRECTIVE_FAIL = 262, + JSMSG_VAR_HIDES_ARG = 263, + JSMSG_WHILE_AFTER_DO = 264, + JSMSG_YIELD_IN_ARROW = 265, + JSMSG_YIELD_IN_DEFAULT = 266, + JSMSG_YIELD_IN_METHOD = 267, + JSMSG_BAD_COLUMN_NUMBER = 268, + JSMSG_COMPUTED_NAME_IN_PATTERN = 269, + JSMSG_DEFAULT_IN_PATTERN = 270, + JSMSG_BAD_NEWTARGET = 271, + JSMSG_ESCAPED_KEYWORD = 272, + JSMSG_USE_ASM_TYPE_FAIL = 273, + JSMSG_USE_ASM_LINK_FAIL = 274, + JSMSG_USE_ASM_TYPE_OK = 275, + JSMSG_WASM_FAIL = 276, + JSMSG_WASM_DECODE_FAIL = 277, + JSMSG_WASM_TEXT_FAIL = 278, + JSMSG_WASM_BAD_IND_CALL = 279, + JSMSG_WASM_BAD_BUF_ARG = 280, + JSMSG_WASM_BAD_MOD_ARG = 281, + JSMSG_WASM_BAD_DESC_ARG = 282, + JSMSG_WASM_BAD_IMP_SIZE = 283, + JSMSG_WASM_BAD_SIZE = 284, + JSMSG_WASM_BAD_ELEMENT = 285, + JSMSG_WASM_BAD_IMPORT_ARG = 286, + JSMSG_WASM_BAD_IMPORT_FIELD = 287, + JSMSG_WASM_BAD_IMPORT_SIG = 288, + JSMSG_WASM_BAD_SET_VALUE = 289, + JSMSG_WASM_UNREACHABLE = 290, + JSMSG_WASM_INTEGER_OVERFLOW = 291, + JSMSG_WASM_INVALID_CONVERSION = 292, + JSMSG_WASM_INT_DIVIDE_BY_ZERO = 293, + JSMSG_WASM_UNALIGNED_ACCESS = 294, + JSMSG_WASM_OVERRECURSED = 295, + JSMSG_BAD_TRAP_RETURN_VALUE = 296, + JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 297, + JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 298, + JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 299, + JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 300, + JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 301, + JSMSG_CANT_CHANGE_EXTENSIBILITY = 302, + JSMSG_CANT_DEFINE_INVALID = 303, + JSMSG_CANT_DEFINE_NEW = 304, + JSMSG_CANT_DEFINE_NE_AS_NC = 305, + JSMSG_PROXY_DEFINE_RETURNED_FALSE = 306, + JSMSG_PROXY_DELETE_RETURNED_FALSE = 307, + JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 308, + JSMSG_PROXY_SET_RETURNED_FALSE = 309, + JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 310, + JSMSG_CANT_REPORT_C_AS_NC = 311, + JSMSG_CANT_REPORT_E_AS_NE = 312, + JSMSG_CANT_REPORT_INVALID = 313, + JSMSG_CANT_REPORT_NC_AS_NE = 314, + JSMSG_CANT_REPORT_NEW = 315, + JSMSG_CANT_REPORT_NE_AS_NC = 316, + JSMSG_CANT_SET_NW_NC = 317, + JSMSG_CANT_SET_WO_SETTER = 318, + JSMSG_CANT_SKIP_NC = 319, + JSMSG_ONWKEYS_STR_SYM = 320, + JSMSG_MUST_REPORT_SAME_VALUE = 321, + JSMSG_MUST_REPORT_UNDEFINED = 322, + JSMSG_OBJECT_ACCESS_DENIED = 323, + JSMSG_PROPERTY_ACCESS_DENIED = 324, + JSMSG_PROXY_CONSTRUCT_OBJECT = 325, + JSMSG_PROXY_EXTENSIBILITY = 326, + JSMSG_PROXY_GETOWN_OBJORUNDEF = 327, + JSMSG_PROXY_REVOKED = 328, + JSMSG_PROXY_ARG_REVOKED = 329, + JSMSG_BAD_TRAP = 330, + JSMSG_SC_BAD_CLONE_VERSION = 331, + JSMSG_SC_BAD_SERIALIZED_DATA = 332, + JSMSG_SC_DUP_TRANSFERABLE = 333, + JSMSG_SC_NOT_TRANSFERABLE = 334, + JSMSG_SC_UNSUPPORTED_TYPE = 335, + JSMSG_SC_SHMEM_MUST_TRANSFER = 336, + JSMSG_ASSIGN_FUNCTION_OR_NULL = 337, + JSMSG_DEBUG_BAD_LINE = 338, + JSMSG_DEBUG_BAD_OFFSET = 339, + JSMSG_DEBUG_BAD_REFERENT = 340, + JSMSG_DEBUG_BAD_RESUMPTION = 341, + JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 342, + JSMSG_DEBUG_CCW_REQUIRED = 343, + JSMSG_DEBUG_COMPARTMENT_MISMATCH = 344, + JSMSG_DEBUG_LOOP = 345, + JSMSG_DEBUG_NOT_DEBUGGEE = 346, + JSMSG_DEBUG_NOT_DEBUGGING = 347, + JSMSG_DEBUG_NOT_IDLE = 348, + JSMSG_DEBUG_NOT_LIVE = 349, + JSMSG_DEBUG_NO_SCOPE_OBJECT = 350, + JSMSG_DEBUG_OBJECT_PROTO = 351, + JSMSG_DEBUG_OBJECT_WRONG_OWNER = 352, + JSMSG_DEBUG_OPTIMIZED_OUT = 353, + JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 354, + JSMSG_DEBUG_VARIABLE_NOT_FOUND = 355, + JSMSG_DEBUG_WRAPPER_IN_WAY = 356, + JSMSG_DEBUGGEE_WOULD_RUN = 357, + JSMSG_NOT_CALLABLE_OR_UNDEFINED = 358, + JSMSG_NOT_TRACKING_ALLOCATIONS = 359, + JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 360, + JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 361, + JSMSG_QUERY_LINE_WITHOUT_URL = 362, + JSMSG_DEBUG_CANT_SET_OPT_ENV = 363, + JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 364, + JSMSG_DEBUG_CENSUS_BREAKDOWN = 365, + JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 366, + JSMSG_TRACELOGGER_ENABLE_FAIL = 367, + JSMSG_DATE_NOT_FINITE = 368, + JSMSG_INTERNAL_INTL_ERROR = 369, + JSMSG_INTL_OBJECT_NOT_INITED = 370, + JSMSG_INTL_OBJECT_REINITED = 371, + JSMSG_INVALID_CURRENCY_CODE = 372, + JSMSG_INVALID_DIGITS_VALUE = 373, + JSMSG_INVALID_LANGUAGE_TAG = 374, + JSMSG_INVALID_LOCALES_ELEMENT = 375, + JSMSG_INVALID_LOCALE_MATCHER = 376, + JSMSG_INVALID_OPTION_VALUE = 377, + JSMSG_INVALID_TIME_ZONE = 378, + JSMSG_UNDEFINED_CURRENCY = 379, + JSMSG_BACK_REF_OUT_OF_RANGE = 380, + JSMSG_BAD_CLASS_RANGE = 381, + JSMSG_ESCAPE_AT_END_OF_REGEXP = 382, + JSMSG_EXEC_NOT_OBJORNULL = 383, + JSMSG_INVALID_DECIMAL_ESCAPE = 384, + JSMSG_INVALID_GROUP = 385, + JSMSG_INVALID_IDENTITY_ESCAPE = 386, + JSMSG_INVALID_UNICODE_ESCAPE = 387, + JSMSG_MISSING_PAREN = 388, + JSMSG_NEWREGEXP_FLAGGED = 389, + JSMSG_NOTHING_TO_REPEAT = 390, + JSMSG_NUMBERS_OUT_OF_ORDER = 391, + JSMSG_RANGE_WITH_CLASS_ESCAPE = 392, + JSMSG_RAW_BRACE_IN_REGEP = 393, + JSMSG_RAW_BRACKET_IN_REGEP = 394, + JSMSG_TOO_MANY_PARENS = 395, + JSMSG_UNICODE_OVERFLOW = 396, + JSMSG_UNMATCHED_RIGHT_PAREN = 397, + JSMSG_UNTERM_CLASS = 398, + JSMSG_DEFAULT_LOCALE_ERROR = 399, + JSMSG_NO_SUCH_SELF_HOSTED_PROP = 400, + JSMSG_INVALID_PROTOTYPE = 401, + JSMSG_TYPEDOBJECT_BAD_ARGS = 402, + JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 403, + JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 404, + JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 405, + JSMSG_TYPEDOBJECT_TOO_BIG = 406, + JSMSG_SIMD_FAILED_CONVERSION = 407, + JSMSG_SIMD_TO_NUMBER = 408, + JSMSG_TOO_LONG_ARRAY = 409, + JSMSG_BAD_INDEX = 410, + JSMSG_NON_ARRAY_BUFFER_RETURNED = 411, + JSMSG_SAME_ARRAY_BUFFER_RETURNED = 412, + JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 413, + JSMSG_TYPED_ARRAY_BAD_ARGS = 414, + JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 415, + JSMSG_TYPED_ARRAY_DETACHED = 416, + JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 417, + JSMSG_SHARED_ARRAY_BAD_LENGTH = 418, + JSMSG_BAD_PARSE_NODE = 419, + JSMSG_SYMBOL_TO_STRING = 420, + JSMSG_SYMBOL_TO_NUMBER = 421, + JSMSG_ATOMICS_BAD_ARRAY = 422, + JSMSG_ATOMICS_TOO_LONG = 423, + JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 424, + JSMSG_CANT_SET_INTERPOSED = 425, + JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 426, + JSMSG_CANT_DELETE_WINDOW_ELEMENT = 427, + JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 428, + JSMSG_CANT_PREVENT_EXTENSIONS = 429, + JSMSG_NO_NAMED_SETTER = 430, + JSMSG_NO_INDEXED_SETTER = 431, + JSMSG_CANT_DELETE_SUPER = 432, + JSMSG_REINIT_THIS = 433, + JSMSG_BAD_DEFAULT_EXPORT = 434, + JSMSG_MISSING_INDIRECT_EXPORT = 435, + JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 436, + JSMSG_MISSING_IMPORT = 437, + JSMSG_AMBIGUOUS_IMPORT = 438, + JSMSG_MISSING_NAMESPACE_EXPORT = 439, + JSMSG_MISSING_EXPORT = 440, + JSMSG_MODULE_INSTANTIATE_FAILED = 441, + JSMSG_BAD_MODULE_STATE = 442, + JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 443, + JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 444, + JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 445, + JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 446, + JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 447, + JSErr_Limit = 448, } /** * Scalar types that can appear in typed arrays and typed objects. The enum @@ -4931,10 +5018,11 @@ pub enum Type { Float64 = 7, Uint8Clamped = 8, MaxTypedArrayViewType = 9, - Float32x4 = 10, - Int8x16 = 11, - Int16x8 = 12, - Int32x4 = 13, + Int64 = 10, + Float32x4 = 11, + Int8x16 = 12, + Int16x8 = 13, + Int32x4 = 14, } #[repr(u32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -5216,10 +5304,23 @@ pub struct _vftable_ScriptEnvironmentPreparer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct ScriptEnvironmentPreparer_Closure; +pub struct ScriptEnvironmentPreparer_Closure { + pub _vftable: *const _vftable_ScriptEnvironmentPreparer_Closure, +} +#[repr(C)] +pub struct _vftable_ScriptEnvironmentPreparer_Closure { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for ScriptEnvironmentPreparer_Closure { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_ScriptEnvironmentPreparer_Closure() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for ScriptEnvironmentPreparer { fn clone(&self) -> Self { *self } } @@ -5253,10 +5354,21 @@ fn bindgen_test_layout_AutoCTypesActivityCallback() { } #[repr(C)] #[derive(Debug, Copy)] -pub struct AllocationMetadataBuilder; +pub struct AllocationMetadataBuilder { + pub _vftable: *const _vftable_AllocationMetadataBuilder, +} +#[repr(C)] +pub struct _vftable_AllocationMetadataBuilder { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for AllocationMetadataBuilder { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_AllocationMetadataBuilder() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} #[repr(C)] #[derive(Debug)] pub struct NativeProfiler { @@ -5308,41 +5420,6 @@ fn bindgen_test_layout_GCHeapProfiler() { assert_eq!(::std::mem::size_of::() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5545,7 +5622,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5559,7 +5635,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5665,7 +5741,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5774,11 +5850,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5877,21 +5953,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5908,67 +5984,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEx"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEx"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEx"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEx"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -5978,8 +6054,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -5988,16 +6064,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6007,8 +6083,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6023,23 +6099,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6109,9 +6178,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPymjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPymjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6122,9 +6192,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyPmPK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyPmNS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6176,29 +6247,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6227,8 +6301,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6266,11 +6340,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6287,30 +6361,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6330,10 +6396,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6341,31 +6405,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFmPFmPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFmPFmPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcmE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcmE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6407,8 +6477,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6569,8 +6639,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContextm"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6584,77 +6652,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6696,8 +6764,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimemmm"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextmmm"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6775,6 +6843,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6834,8 +6906,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7701,6 +7771,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7845,10 +7919,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsmPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7858,10 +7935,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -7950,9 +8030,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8061,14 +8142,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8079,8 +8172,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8089,8 +8182,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8555,27 +8648,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8644,11 +8737,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8856,16 +8949,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8876,19 +8969,19 @@ extern "C" { pub fn JS_NewObjectForConstructor(cx: *mut JSContext, clasp: *const JSClass, args: *const CallArgs) -> *mut JSObject; - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -8970,34 +9063,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9106,18 +9210,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9125,41 +9229,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePyS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPyS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimey"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbyPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContexty"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9228,8 +9325,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9422,8 +9519,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP7__sFILENS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP7__sFILENS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9441,8 +9538,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9570,8 +9667,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9609,22 +9706,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js23RegExpToSharedNonInlineEP9JSContextN2JS6HandleIP8JSObjectEEPNS_11RegExpGuardE"] @@ -10187,8 +10284,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10196,8 +10293,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10294,8 +10391,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10378,6 +10475,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10388,28 +10488,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10440,25 +10518,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } diff --git a/src/jsapi_macos_64_debug.rs b/src/jsapi_macos_64_debug.rs index 792c491e3..95405b0c5 100644 --- a/src/jsapi_macos_64_debug.rs +++ b/src/jsapi_macos_64_debug.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JS_DEFAULT_ZEAL_FREQ: ::std::os::raw::c_uint = 100; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; @@ -309,8 +309,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -446,62 +451,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, - pub field3: u64, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 24usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 40usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -510,6 +480,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -652,43 +625,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContexty(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContexty(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -705,7 +678,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -820,6 +793,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -872,10 +850,23 @@ pub struct _vftable_CallbackTracer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct CallbackTracer_ContextFunctor; +pub struct CallbackTracer_ContextFunctor { + pub _vftable: *const _vftable_CallbackTracer_ContextFunctor, +} +#[repr(C)] +pub struct _vftable_CallbackTracer_ContextFunctor { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for CallbackTracer_ContextFunctor { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_CallbackTracer_ContextFunctor() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for CallbackTracer { fn clone(&self) -> Self { *self } } @@ -1167,6 +1158,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1174,6 +1169,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1851,8 +1854,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2178,6 +2181,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2318,6 +2328,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2335,7 +2346,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2638,12 +2649,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2660,20 +2671,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2814,7 +2829,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -3022,13 +3037,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3053,7 +3068,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3499,11 +3514,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3642,7 +3657,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3650,7 +3664,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3720,9 +3734,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3960,6 +3974,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4132,11 +4189,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4172,11 +4224,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option Self { *self } } @@ -4470,6 +4527,10 @@ impl ::std::clone::Clone for AllCompartments { pub struct ContentCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ContentCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ContentCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4478,6 +4539,10 @@ impl ::std::clone::Clone for ContentCompartmentsOnly { pub struct ChromeCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ChromeCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ChromeCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4487,6 +4552,10 @@ pub struct SingleCompartment { pub _base: CompartmentFilter, pub ours: *mut JSCompartment, } +#[repr(C)] +pub struct _vftable_SingleCompartment { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for SingleCompartment { fn clone(&self) -> Self { *self } } @@ -4501,6 +4570,10 @@ pub struct CompartmentsWithPrincipals { pub _base: CompartmentFilter, pub principals: *mut JSPrincipals, } +#[repr(C)] +pub struct _vftable_CompartmentsWithPrincipals { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for CompartmentsWithPrincipals { fn clone(&self) -> Self { *self } } @@ -4778,205 +4851,218 @@ pub enum JSErrNum { JSMSG_RESERVED_ID = 234, JSMSG_REST_WITH_DEFAULT = 235, JSMSG_SELFHOSTED_TOP_LEVEL_LEXICAL = 236, - JSMSG_SELFHOSTED_UNBOUND_NAME = 237, - JSMSG_SEMI_AFTER_FOR_COND = 238, - JSMSG_SEMI_AFTER_FOR_INIT = 239, - JSMSG_SEMI_BEFORE_STMNT = 240, - JSMSG_SOURCE_TOO_LONG = 241, - JSMSG_STMT_AFTER_RETURN = 242, - JSMSG_STRICT_CODE_WITH = 243, - JSMSG_TEMPLSTR_UNTERM_EXPR = 244, - JSMSG_SIMD_NOT_A_VECTOR = 245, - JSMSG_TOO_MANY_CASES = 246, - JSMSG_TOO_MANY_CATCH_VARS = 247, - JSMSG_TOO_MANY_CON_ARGS = 248, - JSMSG_TOO_MANY_DEFAULTS = 249, - JSMSG_TOO_MANY_FUN_ARGS = 250, - JSMSG_TOO_MANY_LOCALS = 251, - JSMSG_TOO_MANY_YIELDS = 252, - JSMSG_TOUGH_BREAK = 253, - JSMSG_UNEXPECTED_TOKEN = 254, - JSMSG_UNNAMED_CLASS_STMT = 255, - JSMSG_UNNAMED_FUNCTION_STMT = 256, - JSMSG_UNTERMINATED_COMMENT = 257, - JSMSG_UNTERMINATED_REGEXP = 258, - JSMSG_UNTERMINATED_STRING = 259, - JSMSG_USELESS_EXPR = 260, - JSMSG_USE_ASM_DIRECTIVE_FAIL = 261, - JSMSG_VAR_HIDES_ARG = 262, - JSMSG_WHILE_AFTER_DO = 263, - JSMSG_YIELD_IN_ARROW = 264, - JSMSG_YIELD_IN_DEFAULT = 265, - JSMSG_BAD_COLUMN_NUMBER = 266, - JSMSG_COMPUTED_NAME_IN_PATTERN = 267, - JSMSG_DEFAULT_IN_PATTERN = 268, - JSMSG_BAD_NEWTARGET = 269, - JSMSG_ESCAPED_KEYWORD = 270, - JSMSG_USE_ASM_TYPE_FAIL = 271, - JSMSG_USE_ASM_LINK_FAIL = 272, - JSMSG_USE_ASM_TYPE_OK = 273, - JSMSG_WASM_FAIL = 274, - JSMSG_WASM_DECODE_FAIL = 275, - JSMSG_WASM_TEXT_FAIL = 276, - JSMSG_WASM_BAD_IND_CALL = 277, - JSMSG_WASM_BAD_BUF_ARG = 278, - JSMSG_WASM_BAD_IMPORT_ARG = 279, - JSMSG_WASM_UNREACHABLE = 280, - JSMSG_WASM_INTEGER_OVERFLOW = 281, - JSMSG_WASM_INVALID_CONVERSION = 282, - JSMSG_WASM_INT_DIVIDE_BY_ZERO = 283, - JSMSG_WASM_OVERRECURSED = 284, - JSMSG_BAD_TRAP_RETURN_VALUE = 285, - JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 286, - JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 287, - JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 288, - JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 289, - JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 290, - JSMSG_CANT_CHANGE_EXTENSIBILITY = 291, - JSMSG_CANT_DEFINE_INVALID = 292, - JSMSG_CANT_DEFINE_NEW = 293, - JSMSG_CANT_DEFINE_NE_AS_NC = 294, - JSMSG_PROXY_DEFINE_RETURNED_FALSE = 295, - JSMSG_PROXY_DELETE_RETURNED_FALSE = 296, - JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 297, - JSMSG_PROXY_SET_RETURNED_FALSE = 298, - JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 299, - JSMSG_CANT_REPORT_C_AS_NC = 300, - JSMSG_CANT_REPORT_E_AS_NE = 301, - JSMSG_CANT_REPORT_INVALID = 302, - JSMSG_CANT_REPORT_NC_AS_NE = 303, - JSMSG_CANT_REPORT_NEW = 304, - JSMSG_CANT_REPORT_NE_AS_NC = 305, - JSMSG_CANT_SET_NW_NC = 306, - JSMSG_CANT_SET_WO_SETTER = 307, - JSMSG_CANT_SKIP_NC = 308, - JSMSG_ONWKEYS_STR_SYM = 309, - JSMSG_MUST_REPORT_SAME_VALUE = 310, - JSMSG_MUST_REPORT_UNDEFINED = 311, - JSMSG_OBJECT_ACCESS_DENIED = 312, - JSMSG_PROPERTY_ACCESS_DENIED = 313, - JSMSG_PROXY_CONSTRUCT_OBJECT = 314, - JSMSG_PROXY_EXTENSIBILITY = 315, - JSMSG_PROXY_GETOWN_OBJORUNDEF = 316, - JSMSG_PROXY_REVOKED = 317, - JSMSG_PROXY_ARG_REVOKED = 318, - JSMSG_BAD_TRAP = 319, - JSMSG_SC_BAD_CLONE_VERSION = 320, - JSMSG_SC_BAD_SERIALIZED_DATA = 321, - JSMSG_SC_DUP_TRANSFERABLE = 322, - JSMSG_SC_NOT_TRANSFERABLE = 323, - JSMSG_SC_UNSUPPORTED_TYPE = 324, - JSMSG_SC_SHMEM_MUST_TRANSFER = 325, - JSMSG_ASSIGN_FUNCTION_OR_NULL = 326, - JSMSG_DEBUG_BAD_LINE = 327, - JSMSG_DEBUG_BAD_OFFSET = 328, - JSMSG_DEBUG_BAD_REFERENT = 329, - JSMSG_DEBUG_BAD_RESUMPTION = 330, - JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 331, - JSMSG_DEBUG_CCW_REQUIRED = 332, - JSMSG_DEBUG_COMPARTMENT_MISMATCH = 333, - JSMSG_DEBUG_LOOP = 334, - JSMSG_DEBUG_NOT_DEBUGGEE = 335, - JSMSG_DEBUG_NOT_DEBUGGING = 336, - JSMSG_DEBUG_NOT_IDLE = 337, - JSMSG_DEBUG_NOT_LIVE = 338, - JSMSG_DEBUG_NO_SCOPE_OBJECT = 339, - JSMSG_DEBUG_OBJECT_PROTO = 340, - JSMSG_DEBUG_OBJECT_WRONG_OWNER = 341, - JSMSG_DEBUG_OPTIMIZED_OUT = 342, - JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 343, - JSMSG_DEBUG_VARIABLE_NOT_FOUND = 344, - JSMSG_DEBUG_WRAPPER_IN_WAY = 345, - JSMSG_DEBUGGEE_WOULD_RUN = 346, - JSMSG_NOT_CALLABLE_OR_UNDEFINED = 347, - JSMSG_NOT_TRACKING_ALLOCATIONS = 348, - JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 349, - JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 350, - JSMSG_QUERY_LINE_WITHOUT_URL = 351, - JSMSG_DEBUG_CANT_SET_OPT_ENV = 352, - JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 353, - JSMSG_DEBUG_CENSUS_BREAKDOWN = 354, - JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 355, - JSMSG_TRACELOGGER_ENABLE_FAIL = 356, - JSMSG_DATE_NOT_FINITE = 357, - JSMSG_INTERNAL_INTL_ERROR = 358, - JSMSG_INTL_OBJECT_NOT_INITED = 359, - JSMSG_INTL_OBJECT_REINITED = 360, - JSMSG_INVALID_CURRENCY_CODE = 361, - JSMSG_INVALID_DIGITS_VALUE = 362, - JSMSG_INVALID_LANGUAGE_TAG = 363, - JSMSG_INVALID_LOCALES_ELEMENT = 364, - JSMSG_INVALID_LOCALE_MATCHER = 365, - JSMSG_INVALID_OPTION_VALUE = 366, - JSMSG_INVALID_TIME_ZONE = 367, - JSMSG_UNDEFINED_CURRENCY = 368, - JSMSG_BACK_REF_OUT_OF_RANGE = 369, - JSMSG_BAD_CLASS_RANGE = 370, - JSMSG_ESCAPE_AT_END_OF_REGEXP = 371, - JSMSG_EXEC_NOT_OBJORNULL = 372, - JSMSG_INVALID_DECIMAL_ESCAPE = 373, - JSMSG_INVALID_GROUP = 374, - JSMSG_INVALID_IDENTITY_ESCAPE = 375, - JSMSG_INVALID_UNICODE_ESCAPE = 376, - JSMSG_MISSING_PAREN = 377, - JSMSG_NEWREGEXP_FLAGGED = 378, - JSMSG_NOTHING_TO_REPEAT = 379, - JSMSG_NUMBERS_OUT_OF_ORDER = 380, - JSMSG_RANGE_WITH_CLASS_ESCAPE = 381, - JSMSG_RAW_BRACE_IN_REGEP = 382, - JSMSG_RAW_BRACKET_IN_REGEP = 383, - JSMSG_TOO_MANY_PARENS = 384, - JSMSG_UNICODE_OVERFLOW = 385, - JSMSG_UNMATCHED_RIGHT_PAREN = 386, - JSMSG_UNTERM_CLASS = 387, - JSMSG_DEFAULT_LOCALE_ERROR = 388, - JSMSG_NO_SUCH_SELF_HOSTED_PROP = 389, - JSMSG_INVALID_PROTOTYPE = 390, - JSMSG_TYPEDOBJECT_BAD_ARGS = 391, - JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 392, - JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 393, - JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 394, - JSMSG_TYPEDOBJECT_TOO_BIG = 395, - JSMSG_SIMD_FAILED_CONVERSION = 396, - JSMSG_SIMD_TO_NUMBER = 397, - JSMSG_TOO_LONG_ARRAY = 398, - JSMSG_BAD_INDEX = 399, - JSMSG_NON_ARRAY_BUFFER_RETURNED = 400, - JSMSG_SAME_ARRAY_BUFFER_RETURNED = 401, - JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 402, - JSMSG_TYPED_ARRAY_BAD_ARGS = 403, - JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 404, - JSMSG_TYPED_ARRAY_DETACHED = 405, - JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 406, - JSMSG_SHARED_ARRAY_BAD_LENGTH = 407, - JSMSG_BAD_PARSE_NODE = 408, - JSMSG_SYMBOL_TO_STRING = 409, - JSMSG_SYMBOL_TO_NUMBER = 410, - JSMSG_ATOMICS_BAD_ARRAY = 411, - JSMSG_ATOMICS_TOO_LONG = 412, - JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 413, - JSMSG_CANT_SET_INTERPOSED = 414, - JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 415, - JSMSG_CANT_DELETE_WINDOW_ELEMENT = 416, - JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 417, - JSMSG_CANT_PREVENT_EXTENSIONS = 418, - JSMSG_NO_NAMED_SETTER = 419, - JSMSG_NO_INDEXED_SETTER = 420, - JSMSG_CANT_DELETE_SUPER = 421, - JSMSG_REINIT_THIS = 422, - JSMSG_BAD_DEFAULT_EXPORT = 423, - JSMSG_MISSING_INDIRECT_EXPORT = 424, - JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 425, - JSMSG_MISSING_IMPORT = 426, - JSMSG_AMBIGUOUS_IMPORT = 427, - JSMSG_MISSING_NAMESPACE_EXPORT = 428, - JSMSG_MISSING_EXPORT = 429, - JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 430, - JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 431, - JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 432, - JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 433, - JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 434, - JSErr_Limit = 435, + JSMSG_SELFHOSTED_METHOD_CALL = 237, + JSMSG_SELFHOSTED_UNBOUND_NAME = 238, + JSMSG_SEMI_AFTER_FOR_COND = 239, + JSMSG_SEMI_AFTER_FOR_INIT = 240, + JSMSG_SEMI_BEFORE_STMNT = 241, + JSMSG_SOURCE_TOO_LONG = 242, + JSMSG_STMT_AFTER_RETURN = 243, + JSMSG_STRICT_CODE_WITH = 244, + JSMSG_TEMPLSTR_UNTERM_EXPR = 245, + JSMSG_SIMD_NOT_A_VECTOR = 246, + JSMSG_TOO_MANY_CASES = 247, + JSMSG_TOO_MANY_CATCH_VARS = 248, + JSMSG_TOO_MANY_CON_ARGS = 249, + JSMSG_TOO_MANY_DEFAULTS = 250, + JSMSG_TOO_MANY_FUN_ARGS = 251, + JSMSG_TOO_MANY_LOCALS = 252, + JSMSG_TOO_MANY_YIELDS = 253, + JSMSG_TOUGH_BREAK = 254, + JSMSG_UNEXPECTED_TOKEN = 255, + JSMSG_UNNAMED_CLASS_STMT = 256, + JSMSG_UNNAMED_FUNCTION_STMT = 257, + JSMSG_UNTERMINATED_COMMENT = 258, + JSMSG_UNTERMINATED_REGEXP = 259, + JSMSG_UNTERMINATED_STRING = 260, + JSMSG_USELESS_EXPR = 261, + JSMSG_USE_ASM_DIRECTIVE_FAIL = 262, + JSMSG_VAR_HIDES_ARG = 263, + JSMSG_WHILE_AFTER_DO = 264, + JSMSG_YIELD_IN_ARROW = 265, + JSMSG_YIELD_IN_DEFAULT = 266, + JSMSG_YIELD_IN_METHOD = 267, + JSMSG_BAD_COLUMN_NUMBER = 268, + JSMSG_COMPUTED_NAME_IN_PATTERN = 269, + JSMSG_DEFAULT_IN_PATTERN = 270, + JSMSG_BAD_NEWTARGET = 271, + JSMSG_ESCAPED_KEYWORD = 272, + JSMSG_USE_ASM_TYPE_FAIL = 273, + JSMSG_USE_ASM_LINK_FAIL = 274, + JSMSG_USE_ASM_TYPE_OK = 275, + JSMSG_WASM_FAIL = 276, + JSMSG_WASM_DECODE_FAIL = 277, + JSMSG_WASM_TEXT_FAIL = 278, + JSMSG_WASM_BAD_IND_CALL = 279, + JSMSG_WASM_BAD_BUF_ARG = 280, + JSMSG_WASM_BAD_MOD_ARG = 281, + JSMSG_WASM_BAD_DESC_ARG = 282, + JSMSG_WASM_BAD_IMP_SIZE = 283, + JSMSG_WASM_BAD_SIZE = 284, + JSMSG_WASM_BAD_ELEMENT = 285, + JSMSG_WASM_BAD_IMPORT_ARG = 286, + JSMSG_WASM_BAD_IMPORT_FIELD = 287, + JSMSG_WASM_BAD_IMPORT_SIG = 288, + JSMSG_WASM_BAD_SET_VALUE = 289, + JSMSG_WASM_UNREACHABLE = 290, + JSMSG_WASM_INTEGER_OVERFLOW = 291, + JSMSG_WASM_INVALID_CONVERSION = 292, + JSMSG_WASM_INT_DIVIDE_BY_ZERO = 293, + JSMSG_WASM_UNALIGNED_ACCESS = 294, + JSMSG_WASM_OVERRECURSED = 295, + JSMSG_BAD_TRAP_RETURN_VALUE = 296, + JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 297, + JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 298, + JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 299, + JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 300, + JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 301, + JSMSG_CANT_CHANGE_EXTENSIBILITY = 302, + JSMSG_CANT_DEFINE_INVALID = 303, + JSMSG_CANT_DEFINE_NEW = 304, + JSMSG_CANT_DEFINE_NE_AS_NC = 305, + JSMSG_PROXY_DEFINE_RETURNED_FALSE = 306, + JSMSG_PROXY_DELETE_RETURNED_FALSE = 307, + JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 308, + JSMSG_PROXY_SET_RETURNED_FALSE = 309, + JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 310, + JSMSG_CANT_REPORT_C_AS_NC = 311, + JSMSG_CANT_REPORT_E_AS_NE = 312, + JSMSG_CANT_REPORT_INVALID = 313, + JSMSG_CANT_REPORT_NC_AS_NE = 314, + JSMSG_CANT_REPORT_NEW = 315, + JSMSG_CANT_REPORT_NE_AS_NC = 316, + JSMSG_CANT_SET_NW_NC = 317, + JSMSG_CANT_SET_WO_SETTER = 318, + JSMSG_CANT_SKIP_NC = 319, + JSMSG_ONWKEYS_STR_SYM = 320, + JSMSG_MUST_REPORT_SAME_VALUE = 321, + JSMSG_MUST_REPORT_UNDEFINED = 322, + JSMSG_OBJECT_ACCESS_DENIED = 323, + JSMSG_PROPERTY_ACCESS_DENIED = 324, + JSMSG_PROXY_CONSTRUCT_OBJECT = 325, + JSMSG_PROXY_EXTENSIBILITY = 326, + JSMSG_PROXY_GETOWN_OBJORUNDEF = 327, + JSMSG_PROXY_REVOKED = 328, + JSMSG_PROXY_ARG_REVOKED = 329, + JSMSG_BAD_TRAP = 330, + JSMSG_SC_BAD_CLONE_VERSION = 331, + JSMSG_SC_BAD_SERIALIZED_DATA = 332, + JSMSG_SC_DUP_TRANSFERABLE = 333, + JSMSG_SC_NOT_TRANSFERABLE = 334, + JSMSG_SC_UNSUPPORTED_TYPE = 335, + JSMSG_SC_SHMEM_MUST_TRANSFER = 336, + JSMSG_ASSIGN_FUNCTION_OR_NULL = 337, + JSMSG_DEBUG_BAD_LINE = 338, + JSMSG_DEBUG_BAD_OFFSET = 339, + JSMSG_DEBUG_BAD_REFERENT = 340, + JSMSG_DEBUG_BAD_RESUMPTION = 341, + JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 342, + JSMSG_DEBUG_CCW_REQUIRED = 343, + JSMSG_DEBUG_COMPARTMENT_MISMATCH = 344, + JSMSG_DEBUG_LOOP = 345, + JSMSG_DEBUG_NOT_DEBUGGEE = 346, + JSMSG_DEBUG_NOT_DEBUGGING = 347, + JSMSG_DEBUG_NOT_IDLE = 348, + JSMSG_DEBUG_NOT_LIVE = 349, + JSMSG_DEBUG_NO_SCOPE_OBJECT = 350, + JSMSG_DEBUG_OBJECT_PROTO = 351, + JSMSG_DEBUG_OBJECT_WRONG_OWNER = 352, + JSMSG_DEBUG_OPTIMIZED_OUT = 353, + JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 354, + JSMSG_DEBUG_VARIABLE_NOT_FOUND = 355, + JSMSG_DEBUG_WRAPPER_IN_WAY = 356, + JSMSG_DEBUGGEE_WOULD_RUN = 357, + JSMSG_NOT_CALLABLE_OR_UNDEFINED = 358, + JSMSG_NOT_TRACKING_ALLOCATIONS = 359, + JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 360, + JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 361, + JSMSG_QUERY_LINE_WITHOUT_URL = 362, + JSMSG_DEBUG_CANT_SET_OPT_ENV = 363, + JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 364, + JSMSG_DEBUG_CENSUS_BREAKDOWN = 365, + JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 366, + JSMSG_TRACELOGGER_ENABLE_FAIL = 367, + JSMSG_DATE_NOT_FINITE = 368, + JSMSG_INTERNAL_INTL_ERROR = 369, + JSMSG_INTL_OBJECT_NOT_INITED = 370, + JSMSG_INTL_OBJECT_REINITED = 371, + JSMSG_INVALID_CURRENCY_CODE = 372, + JSMSG_INVALID_DIGITS_VALUE = 373, + JSMSG_INVALID_LANGUAGE_TAG = 374, + JSMSG_INVALID_LOCALES_ELEMENT = 375, + JSMSG_INVALID_LOCALE_MATCHER = 376, + JSMSG_INVALID_OPTION_VALUE = 377, + JSMSG_INVALID_TIME_ZONE = 378, + JSMSG_UNDEFINED_CURRENCY = 379, + JSMSG_BACK_REF_OUT_OF_RANGE = 380, + JSMSG_BAD_CLASS_RANGE = 381, + JSMSG_ESCAPE_AT_END_OF_REGEXP = 382, + JSMSG_EXEC_NOT_OBJORNULL = 383, + JSMSG_INVALID_DECIMAL_ESCAPE = 384, + JSMSG_INVALID_GROUP = 385, + JSMSG_INVALID_IDENTITY_ESCAPE = 386, + JSMSG_INVALID_UNICODE_ESCAPE = 387, + JSMSG_MISSING_PAREN = 388, + JSMSG_NEWREGEXP_FLAGGED = 389, + JSMSG_NOTHING_TO_REPEAT = 390, + JSMSG_NUMBERS_OUT_OF_ORDER = 391, + JSMSG_RANGE_WITH_CLASS_ESCAPE = 392, + JSMSG_RAW_BRACE_IN_REGEP = 393, + JSMSG_RAW_BRACKET_IN_REGEP = 394, + JSMSG_TOO_MANY_PARENS = 395, + JSMSG_UNICODE_OVERFLOW = 396, + JSMSG_UNMATCHED_RIGHT_PAREN = 397, + JSMSG_UNTERM_CLASS = 398, + JSMSG_DEFAULT_LOCALE_ERROR = 399, + JSMSG_NO_SUCH_SELF_HOSTED_PROP = 400, + JSMSG_INVALID_PROTOTYPE = 401, + JSMSG_TYPEDOBJECT_BAD_ARGS = 402, + JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 403, + JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 404, + JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 405, + JSMSG_TYPEDOBJECT_TOO_BIG = 406, + JSMSG_SIMD_FAILED_CONVERSION = 407, + JSMSG_SIMD_TO_NUMBER = 408, + JSMSG_TOO_LONG_ARRAY = 409, + JSMSG_BAD_INDEX = 410, + JSMSG_NON_ARRAY_BUFFER_RETURNED = 411, + JSMSG_SAME_ARRAY_BUFFER_RETURNED = 412, + JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 413, + JSMSG_TYPED_ARRAY_BAD_ARGS = 414, + JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 415, + JSMSG_TYPED_ARRAY_DETACHED = 416, + JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 417, + JSMSG_SHARED_ARRAY_BAD_LENGTH = 418, + JSMSG_BAD_PARSE_NODE = 419, + JSMSG_SYMBOL_TO_STRING = 420, + JSMSG_SYMBOL_TO_NUMBER = 421, + JSMSG_ATOMICS_BAD_ARRAY = 422, + JSMSG_ATOMICS_TOO_LONG = 423, + JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 424, + JSMSG_CANT_SET_INTERPOSED = 425, + JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 426, + JSMSG_CANT_DELETE_WINDOW_ELEMENT = 427, + JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 428, + JSMSG_CANT_PREVENT_EXTENSIONS = 429, + JSMSG_NO_NAMED_SETTER = 430, + JSMSG_NO_INDEXED_SETTER = 431, + JSMSG_CANT_DELETE_SUPER = 432, + JSMSG_REINIT_THIS = 433, + JSMSG_BAD_DEFAULT_EXPORT = 434, + JSMSG_MISSING_INDIRECT_EXPORT = 435, + JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 436, + JSMSG_MISSING_IMPORT = 437, + JSMSG_AMBIGUOUS_IMPORT = 438, + JSMSG_MISSING_NAMESPACE_EXPORT = 439, + JSMSG_MISSING_EXPORT = 440, + JSMSG_MODULE_INSTANTIATE_FAILED = 441, + JSMSG_BAD_MODULE_STATE = 442, + JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 443, + JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 444, + JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 445, + JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 446, + JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 447, + JSErr_Limit = 448, } /** * Scalar types that can appear in typed arrays and typed objects. The enum @@ -4997,10 +5083,11 @@ pub enum Type { Float64 = 7, Uint8Clamped = 8, MaxTypedArrayViewType = 9, - Float32x4 = 10, - Int8x16 = 11, - Int16x8 = 12, - Int32x4 = 13, + Int64 = 10, + Float32x4 = 11, + Int8x16 = 12, + Int16x8 = 13, + Int32x4 = 14, } #[repr(u32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -5282,10 +5369,23 @@ pub struct _vftable_ScriptEnvironmentPreparer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct ScriptEnvironmentPreparer_Closure; +pub struct ScriptEnvironmentPreparer_Closure { + pub _vftable: *const _vftable_ScriptEnvironmentPreparer_Closure, +} +#[repr(C)] +pub struct _vftable_ScriptEnvironmentPreparer_Closure { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for ScriptEnvironmentPreparer_Closure { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_ScriptEnvironmentPreparer_Closure() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for ScriptEnvironmentPreparer { fn clone(&self) -> Self { *self } } @@ -5319,10 +5419,21 @@ fn bindgen_test_layout_AutoCTypesActivityCallback() { } #[repr(C)] #[derive(Debug, Copy)] -pub struct AllocationMetadataBuilder; +pub struct AllocationMetadataBuilder { + pub _vftable: *const _vftable_AllocationMetadataBuilder, +} +#[repr(C)] +pub struct _vftable_AllocationMetadataBuilder { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for AllocationMetadataBuilder { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_AllocationMetadataBuilder() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} #[repr(C)] #[derive(Debug)] pub struct NativeProfiler { @@ -5374,41 +5485,6 @@ fn bindgen_test_layout_GCHeapProfiler() { assert_eq!(::std::mem::size_of::() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5611,7 +5687,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5625,7 +5700,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5731,7 +5806,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5840,11 +5915,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5946,21 +6021,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5977,67 +6052,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEx"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEx"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEx"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEx"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -6047,8 +6122,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -6057,16 +6132,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6076,8 +6151,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6092,23 +6167,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6188,9 +6256,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPymjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPymjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6201,9 +6270,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyPmPK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyPmNS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6255,29 +6325,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6306,8 +6379,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6345,11 +6418,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6366,30 +6439,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6409,10 +6474,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6420,31 +6483,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFmPFmPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFmPFmPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcmE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcmE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6486,8 +6555,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6648,8 +6717,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContextm"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6663,77 +6730,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6775,8 +6842,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimemmm"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextmmm"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6854,6 +6921,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6913,8 +6984,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7780,6 +7849,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7924,10 +7997,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsmPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7937,10 +8013,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -8029,9 +8108,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8140,14 +8220,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8158,8 +8250,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8168,8 +8260,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8634,27 +8726,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8723,11 +8815,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8935,16 +9027,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8958,23 +9050,23 @@ extern "C" { #[link_name = "_Z16JS_GetGCZealBitsP9JSContextPjS1_S1_"] pub fn JS_GetGCZealBits(cx: *mut JSContext, zealBits: *mut u32, frequency: *mut u32, nextScheduled: *mut u32); - #[link_name = "_Z12JS_SetGCZealP9JSRuntimehj"] - pub fn JS_SetGCZeal(rt: *mut JSRuntime, zeal: u8, frequency: u32); + #[link_name = "_Z12JS_SetGCZealP9JSContexthj"] + pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32); #[link_name = "_Z13JS_ScheduleGCP9JSContextj"] pub fn JS_ScheduleGC(cx: *mut JSContext, count: u32); - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -9056,34 +9148,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9192,18 +9295,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9211,41 +9314,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePyS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPyS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimey"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbyPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContexty"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9314,8 +9410,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9550,8 +9646,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP7__sFILENS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP7__sFILENS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9569,8 +9665,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9700,8 +9796,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9739,22 +9835,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js24GetEnterCompartmentDepthEP9JSContext"] pub fn GetEnterCompartmentDepth(cx: *mut JSContext) @@ -10320,8 +10416,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10329,8 +10425,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10427,8 +10523,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10519,6 +10615,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10529,28 +10628,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10581,25 +10658,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } From 06d8705a70411bf35d6639ed63c548beff3d6c93 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 23 Aug 2016 11:15:16 +0200 Subject: [PATCH 3/8] TEST --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 19a5dcb17..0770a3b35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ promises = ['mozjs_sys/promises'] [dependencies.mozjs_sys] git = "https://github.com/servo/mozjs" +branch = "smup" [dependencies] lazy_static = "0.2.1" From f6e30b14b0b60196d5622d44127b14b48945edde Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 1 Sep 2016 14:56:58 +0200 Subject: [PATCH 4/8] Force Xcode 7 on Travis for OS X --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 634262300..735a5b580 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: rust sudo: 9000 dist: trusty +osx_image: xcode7 rust: - nightly os: From 1ac258a9df13afda1a2128a66f375a009afeb063 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Thu, 1 Sep 2016 15:46:17 +0200 Subject: [PATCH 5/8] Install CMake on OS X --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 735a5b580..785d4932b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,9 @@ env: - FEATURES="--features debugmozjs" before_install: -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache cmake; fi +- cmake --version script: - ccache -z From eff454f30a545f20e31ee3ba9aaa0da19fe4170c Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Thu, 1 Sep 2016 18:26:40 -0700 Subject: [PATCH 6/8] Update the bindings for linux 64 --- src/jsapi_linux_64.rs | 1338 ++++++++++++++++++---------------- src/jsapi_linux_64_debug.rs | 1343 ++++++++++++++++++----------------- 2 files changed, 1418 insertions(+), 1263 deletions(-) diff --git a/src/jsapi_linux_64.rs b/src/jsapi_linux_64.rs index b20739008..6ff91668e 100644 --- a/src/jsapi_linux_64.rs +++ b/src/jsapi_linux_64.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; pub const JSITER_KEYVALUE: ::std::os::raw::c_uint = 4; @@ -308,8 +308,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -445,61 +450,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 16usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 32usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -508,6 +479,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -650,43 +624,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimem(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContextm(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimem(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContextm(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -703,7 +677,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -800,6 +774,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -852,10 +831,23 @@ pub struct _vftable_CallbackTracer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct CallbackTracer_ContextFunctor; +pub struct CallbackTracer_ContextFunctor { + pub _vftable: *const _vftable_CallbackTracer_ContextFunctor, +} +#[repr(C)] +pub struct _vftable_CallbackTracer_ContextFunctor { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for CallbackTracer_ContextFunctor { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_CallbackTracer_ContextFunctor() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for CallbackTracer { fn clone(&self) -> Self { *self } } @@ -1147,6 +1139,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1154,6 +1150,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1796,8 +1800,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2123,6 +2127,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2263,6 +2274,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2280,7 +2292,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2572,12 +2584,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2594,20 +2606,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2748,7 +2764,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -2956,13 +2972,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -2987,7 +3003,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3433,11 +3449,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3576,7 +3592,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3584,7 +3599,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3654,9 +3669,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3894,6 +3909,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4066,11 +4124,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4106,11 +4159,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option Self { *self } } @@ -4404,6 +4462,10 @@ impl ::std::clone::Clone for AllCompartments { pub struct ContentCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ContentCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ContentCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4412,6 +4474,10 @@ impl ::std::clone::Clone for ContentCompartmentsOnly { pub struct ChromeCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ChromeCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ChromeCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4421,6 +4487,10 @@ pub struct SingleCompartment { pub _base: CompartmentFilter, pub ours: *mut JSCompartment, } +#[repr(C)] +pub struct _vftable_SingleCompartment { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for SingleCompartment { fn clone(&self) -> Self { *self } } @@ -4435,6 +4505,10 @@ pub struct CompartmentsWithPrincipals { pub _base: CompartmentFilter, pub principals: *mut JSPrincipals, } +#[repr(C)] +pub struct _vftable_CompartmentsWithPrincipals { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for CompartmentsWithPrincipals { fn clone(&self) -> Self { *self } } @@ -4712,205 +4786,218 @@ pub enum JSErrNum { JSMSG_RESERVED_ID = 234, JSMSG_REST_WITH_DEFAULT = 235, JSMSG_SELFHOSTED_TOP_LEVEL_LEXICAL = 236, - JSMSG_SELFHOSTED_UNBOUND_NAME = 237, - JSMSG_SEMI_AFTER_FOR_COND = 238, - JSMSG_SEMI_AFTER_FOR_INIT = 239, - JSMSG_SEMI_BEFORE_STMNT = 240, - JSMSG_SOURCE_TOO_LONG = 241, - JSMSG_STMT_AFTER_RETURN = 242, - JSMSG_STRICT_CODE_WITH = 243, - JSMSG_TEMPLSTR_UNTERM_EXPR = 244, - JSMSG_SIMD_NOT_A_VECTOR = 245, - JSMSG_TOO_MANY_CASES = 246, - JSMSG_TOO_MANY_CATCH_VARS = 247, - JSMSG_TOO_MANY_CON_ARGS = 248, - JSMSG_TOO_MANY_DEFAULTS = 249, - JSMSG_TOO_MANY_FUN_ARGS = 250, - JSMSG_TOO_MANY_LOCALS = 251, - JSMSG_TOO_MANY_YIELDS = 252, - JSMSG_TOUGH_BREAK = 253, - JSMSG_UNEXPECTED_TOKEN = 254, - JSMSG_UNNAMED_CLASS_STMT = 255, - JSMSG_UNNAMED_FUNCTION_STMT = 256, - JSMSG_UNTERMINATED_COMMENT = 257, - JSMSG_UNTERMINATED_REGEXP = 258, - JSMSG_UNTERMINATED_STRING = 259, - JSMSG_USELESS_EXPR = 260, - JSMSG_USE_ASM_DIRECTIVE_FAIL = 261, - JSMSG_VAR_HIDES_ARG = 262, - JSMSG_WHILE_AFTER_DO = 263, - JSMSG_YIELD_IN_ARROW = 264, - JSMSG_YIELD_IN_DEFAULT = 265, - JSMSG_BAD_COLUMN_NUMBER = 266, - JSMSG_COMPUTED_NAME_IN_PATTERN = 267, - JSMSG_DEFAULT_IN_PATTERN = 268, - JSMSG_BAD_NEWTARGET = 269, - JSMSG_ESCAPED_KEYWORD = 270, - JSMSG_USE_ASM_TYPE_FAIL = 271, - JSMSG_USE_ASM_LINK_FAIL = 272, - JSMSG_USE_ASM_TYPE_OK = 273, - JSMSG_WASM_FAIL = 274, - JSMSG_WASM_DECODE_FAIL = 275, - JSMSG_WASM_TEXT_FAIL = 276, - JSMSG_WASM_BAD_IND_CALL = 277, - JSMSG_WASM_BAD_BUF_ARG = 278, - JSMSG_WASM_BAD_IMPORT_ARG = 279, - JSMSG_WASM_UNREACHABLE = 280, - JSMSG_WASM_INTEGER_OVERFLOW = 281, - JSMSG_WASM_INVALID_CONVERSION = 282, - JSMSG_WASM_INT_DIVIDE_BY_ZERO = 283, - JSMSG_WASM_OVERRECURSED = 284, - JSMSG_BAD_TRAP_RETURN_VALUE = 285, - JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 286, - JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 287, - JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 288, - JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 289, - JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 290, - JSMSG_CANT_CHANGE_EXTENSIBILITY = 291, - JSMSG_CANT_DEFINE_INVALID = 292, - JSMSG_CANT_DEFINE_NEW = 293, - JSMSG_CANT_DEFINE_NE_AS_NC = 294, - JSMSG_PROXY_DEFINE_RETURNED_FALSE = 295, - JSMSG_PROXY_DELETE_RETURNED_FALSE = 296, - JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 297, - JSMSG_PROXY_SET_RETURNED_FALSE = 298, - JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 299, - JSMSG_CANT_REPORT_C_AS_NC = 300, - JSMSG_CANT_REPORT_E_AS_NE = 301, - JSMSG_CANT_REPORT_INVALID = 302, - JSMSG_CANT_REPORT_NC_AS_NE = 303, - JSMSG_CANT_REPORT_NEW = 304, - JSMSG_CANT_REPORT_NE_AS_NC = 305, - JSMSG_CANT_SET_NW_NC = 306, - JSMSG_CANT_SET_WO_SETTER = 307, - JSMSG_CANT_SKIP_NC = 308, - JSMSG_ONWKEYS_STR_SYM = 309, - JSMSG_MUST_REPORT_SAME_VALUE = 310, - JSMSG_MUST_REPORT_UNDEFINED = 311, - JSMSG_OBJECT_ACCESS_DENIED = 312, - JSMSG_PROPERTY_ACCESS_DENIED = 313, - JSMSG_PROXY_CONSTRUCT_OBJECT = 314, - JSMSG_PROXY_EXTENSIBILITY = 315, - JSMSG_PROXY_GETOWN_OBJORUNDEF = 316, - JSMSG_PROXY_REVOKED = 317, - JSMSG_PROXY_ARG_REVOKED = 318, - JSMSG_BAD_TRAP = 319, - JSMSG_SC_BAD_CLONE_VERSION = 320, - JSMSG_SC_BAD_SERIALIZED_DATA = 321, - JSMSG_SC_DUP_TRANSFERABLE = 322, - JSMSG_SC_NOT_TRANSFERABLE = 323, - JSMSG_SC_UNSUPPORTED_TYPE = 324, - JSMSG_SC_SHMEM_MUST_TRANSFER = 325, - JSMSG_ASSIGN_FUNCTION_OR_NULL = 326, - JSMSG_DEBUG_BAD_LINE = 327, - JSMSG_DEBUG_BAD_OFFSET = 328, - JSMSG_DEBUG_BAD_REFERENT = 329, - JSMSG_DEBUG_BAD_RESUMPTION = 330, - JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 331, - JSMSG_DEBUG_CCW_REQUIRED = 332, - JSMSG_DEBUG_COMPARTMENT_MISMATCH = 333, - JSMSG_DEBUG_LOOP = 334, - JSMSG_DEBUG_NOT_DEBUGGEE = 335, - JSMSG_DEBUG_NOT_DEBUGGING = 336, - JSMSG_DEBUG_NOT_IDLE = 337, - JSMSG_DEBUG_NOT_LIVE = 338, - JSMSG_DEBUG_NO_SCOPE_OBJECT = 339, - JSMSG_DEBUG_OBJECT_PROTO = 340, - JSMSG_DEBUG_OBJECT_WRONG_OWNER = 341, - JSMSG_DEBUG_OPTIMIZED_OUT = 342, - JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 343, - JSMSG_DEBUG_VARIABLE_NOT_FOUND = 344, - JSMSG_DEBUG_WRAPPER_IN_WAY = 345, - JSMSG_DEBUGGEE_WOULD_RUN = 346, - JSMSG_NOT_CALLABLE_OR_UNDEFINED = 347, - JSMSG_NOT_TRACKING_ALLOCATIONS = 348, - JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 349, - JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 350, - JSMSG_QUERY_LINE_WITHOUT_URL = 351, - JSMSG_DEBUG_CANT_SET_OPT_ENV = 352, - JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 353, - JSMSG_DEBUG_CENSUS_BREAKDOWN = 354, - JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 355, - JSMSG_TRACELOGGER_ENABLE_FAIL = 356, - JSMSG_DATE_NOT_FINITE = 357, - JSMSG_INTERNAL_INTL_ERROR = 358, - JSMSG_INTL_OBJECT_NOT_INITED = 359, - JSMSG_INTL_OBJECT_REINITED = 360, - JSMSG_INVALID_CURRENCY_CODE = 361, - JSMSG_INVALID_DIGITS_VALUE = 362, - JSMSG_INVALID_LANGUAGE_TAG = 363, - JSMSG_INVALID_LOCALES_ELEMENT = 364, - JSMSG_INVALID_LOCALE_MATCHER = 365, - JSMSG_INVALID_OPTION_VALUE = 366, - JSMSG_INVALID_TIME_ZONE = 367, - JSMSG_UNDEFINED_CURRENCY = 368, - JSMSG_BACK_REF_OUT_OF_RANGE = 369, - JSMSG_BAD_CLASS_RANGE = 370, - JSMSG_ESCAPE_AT_END_OF_REGEXP = 371, - JSMSG_EXEC_NOT_OBJORNULL = 372, - JSMSG_INVALID_DECIMAL_ESCAPE = 373, - JSMSG_INVALID_GROUP = 374, - JSMSG_INVALID_IDENTITY_ESCAPE = 375, - JSMSG_INVALID_UNICODE_ESCAPE = 376, - JSMSG_MISSING_PAREN = 377, - JSMSG_NEWREGEXP_FLAGGED = 378, - JSMSG_NOTHING_TO_REPEAT = 379, - JSMSG_NUMBERS_OUT_OF_ORDER = 380, - JSMSG_RANGE_WITH_CLASS_ESCAPE = 381, - JSMSG_RAW_BRACE_IN_REGEP = 382, - JSMSG_RAW_BRACKET_IN_REGEP = 383, - JSMSG_TOO_MANY_PARENS = 384, - JSMSG_UNICODE_OVERFLOW = 385, - JSMSG_UNMATCHED_RIGHT_PAREN = 386, - JSMSG_UNTERM_CLASS = 387, - JSMSG_DEFAULT_LOCALE_ERROR = 388, - JSMSG_NO_SUCH_SELF_HOSTED_PROP = 389, - JSMSG_INVALID_PROTOTYPE = 390, - JSMSG_TYPEDOBJECT_BAD_ARGS = 391, - JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 392, - JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 393, - JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 394, - JSMSG_TYPEDOBJECT_TOO_BIG = 395, - JSMSG_SIMD_FAILED_CONVERSION = 396, - JSMSG_SIMD_TO_NUMBER = 397, - JSMSG_TOO_LONG_ARRAY = 398, - JSMSG_BAD_INDEX = 399, - JSMSG_NON_ARRAY_BUFFER_RETURNED = 400, - JSMSG_SAME_ARRAY_BUFFER_RETURNED = 401, - JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 402, - JSMSG_TYPED_ARRAY_BAD_ARGS = 403, - JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 404, - JSMSG_TYPED_ARRAY_DETACHED = 405, - JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 406, - JSMSG_SHARED_ARRAY_BAD_LENGTH = 407, - JSMSG_BAD_PARSE_NODE = 408, - JSMSG_SYMBOL_TO_STRING = 409, - JSMSG_SYMBOL_TO_NUMBER = 410, - JSMSG_ATOMICS_BAD_ARRAY = 411, - JSMSG_ATOMICS_TOO_LONG = 412, - JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 413, - JSMSG_CANT_SET_INTERPOSED = 414, - JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 415, - JSMSG_CANT_DELETE_WINDOW_ELEMENT = 416, - JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 417, - JSMSG_CANT_PREVENT_EXTENSIONS = 418, - JSMSG_NO_NAMED_SETTER = 419, - JSMSG_NO_INDEXED_SETTER = 420, - JSMSG_CANT_DELETE_SUPER = 421, - JSMSG_REINIT_THIS = 422, - JSMSG_BAD_DEFAULT_EXPORT = 423, - JSMSG_MISSING_INDIRECT_EXPORT = 424, - JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 425, - JSMSG_MISSING_IMPORT = 426, - JSMSG_AMBIGUOUS_IMPORT = 427, - JSMSG_MISSING_NAMESPACE_EXPORT = 428, - JSMSG_MISSING_EXPORT = 429, - JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 430, - JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 431, - JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 432, - JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 433, - JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 434, - JSErr_Limit = 435, + JSMSG_SELFHOSTED_METHOD_CALL = 237, + JSMSG_SELFHOSTED_UNBOUND_NAME = 238, + JSMSG_SEMI_AFTER_FOR_COND = 239, + JSMSG_SEMI_AFTER_FOR_INIT = 240, + JSMSG_SEMI_BEFORE_STMNT = 241, + JSMSG_SOURCE_TOO_LONG = 242, + JSMSG_STMT_AFTER_RETURN = 243, + JSMSG_STRICT_CODE_WITH = 244, + JSMSG_TEMPLSTR_UNTERM_EXPR = 245, + JSMSG_SIMD_NOT_A_VECTOR = 246, + JSMSG_TOO_MANY_CASES = 247, + JSMSG_TOO_MANY_CATCH_VARS = 248, + JSMSG_TOO_MANY_CON_ARGS = 249, + JSMSG_TOO_MANY_DEFAULTS = 250, + JSMSG_TOO_MANY_FUN_ARGS = 251, + JSMSG_TOO_MANY_LOCALS = 252, + JSMSG_TOO_MANY_YIELDS = 253, + JSMSG_TOUGH_BREAK = 254, + JSMSG_UNEXPECTED_TOKEN = 255, + JSMSG_UNNAMED_CLASS_STMT = 256, + JSMSG_UNNAMED_FUNCTION_STMT = 257, + JSMSG_UNTERMINATED_COMMENT = 258, + JSMSG_UNTERMINATED_REGEXP = 259, + JSMSG_UNTERMINATED_STRING = 260, + JSMSG_USELESS_EXPR = 261, + JSMSG_USE_ASM_DIRECTIVE_FAIL = 262, + JSMSG_VAR_HIDES_ARG = 263, + JSMSG_WHILE_AFTER_DO = 264, + JSMSG_YIELD_IN_ARROW = 265, + JSMSG_YIELD_IN_DEFAULT = 266, + JSMSG_YIELD_IN_METHOD = 267, + JSMSG_BAD_COLUMN_NUMBER = 268, + JSMSG_COMPUTED_NAME_IN_PATTERN = 269, + JSMSG_DEFAULT_IN_PATTERN = 270, + JSMSG_BAD_NEWTARGET = 271, + JSMSG_ESCAPED_KEYWORD = 272, + JSMSG_USE_ASM_TYPE_FAIL = 273, + JSMSG_USE_ASM_LINK_FAIL = 274, + JSMSG_USE_ASM_TYPE_OK = 275, + JSMSG_WASM_FAIL = 276, + JSMSG_WASM_DECODE_FAIL = 277, + JSMSG_WASM_TEXT_FAIL = 278, + JSMSG_WASM_BAD_IND_CALL = 279, + JSMSG_WASM_BAD_BUF_ARG = 280, + JSMSG_WASM_BAD_MOD_ARG = 281, + JSMSG_WASM_BAD_DESC_ARG = 282, + JSMSG_WASM_BAD_IMP_SIZE = 283, + JSMSG_WASM_BAD_SIZE = 284, + JSMSG_WASM_BAD_ELEMENT = 285, + JSMSG_WASM_BAD_IMPORT_ARG = 286, + JSMSG_WASM_BAD_IMPORT_FIELD = 287, + JSMSG_WASM_BAD_IMPORT_SIG = 288, + JSMSG_WASM_BAD_SET_VALUE = 289, + JSMSG_WASM_UNREACHABLE = 290, + JSMSG_WASM_INTEGER_OVERFLOW = 291, + JSMSG_WASM_INVALID_CONVERSION = 292, + JSMSG_WASM_INT_DIVIDE_BY_ZERO = 293, + JSMSG_WASM_UNALIGNED_ACCESS = 294, + JSMSG_WASM_OVERRECURSED = 295, + JSMSG_BAD_TRAP_RETURN_VALUE = 296, + JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 297, + JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 298, + JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 299, + JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 300, + JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 301, + JSMSG_CANT_CHANGE_EXTENSIBILITY = 302, + JSMSG_CANT_DEFINE_INVALID = 303, + JSMSG_CANT_DEFINE_NEW = 304, + JSMSG_CANT_DEFINE_NE_AS_NC = 305, + JSMSG_PROXY_DEFINE_RETURNED_FALSE = 306, + JSMSG_PROXY_DELETE_RETURNED_FALSE = 307, + JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 308, + JSMSG_PROXY_SET_RETURNED_FALSE = 309, + JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 310, + JSMSG_CANT_REPORT_C_AS_NC = 311, + JSMSG_CANT_REPORT_E_AS_NE = 312, + JSMSG_CANT_REPORT_INVALID = 313, + JSMSG_CANT_REPORT_NC_AS_NE = 314, + JSMSG_CANT_REPORT_NEW = 315, + JSMSG_CANT_REPORT_NE_AS_NC = 316, + JSMSG_CANT_SET_NW_NC = 317, + JSMSG_CANT_SET_WO_SETTER = 318, + JSMSG_CANT_SKIP_NC = 319, + JSMSG_ONWKEYS_STR_SYM = 320, + JSMSG_MUST_REPORT_SAME_VALUE = 321, + JSMSG_MUST_REPORT_UNDEFINED = 322, + JSMSG_OBJECT_ACCESS_DENIED = 323, + JSMSG_PROPERTY_ACCESS_DENIED = 324, + JSMSG_PROXY_CONSTRUCT_OBJECT = 325, + JSMSG_PROXY_EXTENSIBILITY = 326, + JSMSG_PROXY_GETOWN_OBJORUNDEF = 327, + JSMSG_PROXY_REVOKED = 328, + JSMSG_PROXY_ARG_REVOKED = 329, + JSMSG_BAD_TRAP = 330, + JSMSG_SC_BAD_CLONE_VERSION = 331, + JSMSG_SC_BAD_SERIALIZED_DATA = 332, + JSMSG_SC_DUP_TRANSFERABLE = 333, + JSMSG_SC_NOT_TRANSFERABLE = 334, + JSMSG_SC_UNSUPPORTED_TYPE = 335, + JSMSG_SC_SHMEM_MUST_TRANSFER = 336, + JSMSG_ASSIGN_FUNCTION_OR_NULL = 337, + JSMSG_DEBUG_BAD_LINE = 338, + JSMSG_DEBUG_BAD_OFFSET = 339, + JSMSG_DEBUG_BAD_REFERENT = 340, + JSMSG_DEBUG_BAD_RESUMPTION = 341, + JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 342, + JSMSG_DEBUG_CCW_REQUIRED = 343, + JSMSG_DEBUG_COMPARTMENT_MISMATCH = 344, + JSMSG_DEBUG_LOOP = 345, + JSMSG_DEBUG_NOT_DEBUGGEE = 346, + JSMSG_DEBUG_NOT_DEBUGGING = 347, + JSMSG_DEBUG_NOT_IDLE = 348, + JSMSG_DEBUG_NOT_LIVE = 349, + JSMSG_DEBUG_NO_SCOPE_OBJECT = 350, + JSMSG_DEBUG_OBJECT_PROTO = 351, + JSMSG_DEBUG_OBJECT_WRONG_OWNER = 352, + JSMSG_DEBUG_OPTIMIZED_OUT = 353, + JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 354, + JSMSG_DEBUG_VARIABLE_NOT_FOUND = 355, + JSMSG_DEBUG_WRAPPER_IN_WAY = 356, + JSMSG_DEBUGGEE_WOULD_RUN = 357, + JSMSG_NOT_CALLABLE_OR_UNDEFINED = 358, + JSMSG_NOT_TRACKING_ALLOCATIONS = 359, + JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 360, + JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 361, + JSMSG_QUERY_LINE_WITHOUT_URL = 362, + JSMSG_DEBUG_CANT_SET_OPT_ENV = 363, + JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 364, + JSMSG_DEBUG_CENSUS_BREAKDOWN = 365, + JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 366, + JSMSG_TRACELOGGER_ENABLE_FAIL = 367, + JSMSG_DATE_NOT_FINITE = 368, + JSMSG_INTERNAL_INTL_ERROR = 369, + JSMSG_INTL_OBJECT_NOT_INITED = 370, + JSMSG_INTL_OBJECT_REINITED = 371, + JSMSG_INVALID_CURRENCY_CODE = 372, + JSMSG_INVALID_DIGITS_VALUE = 373, + JSMSG_INVALID_LANGUAGE_TAG = 374, + JSMSG_INVALID_LOCALES_ELEMENT = 375, + JSMSG_INVALID_LOCALE_MATCHER = 376, + JSMSG_INVALID_OPTION_VALUE = 377, + JSMSG_INVALID_TIME_ZONE = 378, + JSMSG_UNDEFINED_CURRENCY = 379, + JSMSG_BACK_REF_OUT_OF_RANGE = 380, + JSMSG_BAD_CLASS_RANGE = 381, + JSMSG_ESCAPE_AT_END_OF_REGEXP = 382, + JSMSG_EXEC_NOT_OBJORNULL = 383, + JSMSG_INVALID_DECIMAL_ESCAPE = 384, + JSMSG_INVALID_GROUP = 385, + JSMSG_INVALID_IDENTITY_ESCAPE = 386, + JSMSG_INVALID_UNICODE_ESCAPE = 387, + JSMSG_MISSING_PAREN = 388, + JSMSG_NEWREGEXP_FLAGGED = 389, + JSMSG_NOTHING_TO_REPEAT = 390, + JSMSG_NUMBERS_OUT_OF_ORDER = 391, + JSMSG_RANGE_WITH_CLASS_ESCAPE = 392, + JSMSG_RAW_BRACE_IN_REGEP = 393, + JSMSG_RAW_BRACKET_IN_REGEP = 394, + JSMSG_TOO_MANY_PARENS = 395, + JSMSG_UNICODE_OVERFLOW = 396, + JSMSG_UNMATCHED_RIGHT_PAREN = 397, + JSMSG_UNTERM_CLASS = 398, + JSMSG_DEFAULT_LOCALE_ERROR = 399, + JSMSG_NO_SUCH_SELF_HOSTED_PROP = 400, + JSMSG_INVALID_PROTOTYPE = 401, + JSMSG_TYPEDOBJECT_BAD_ARGS = 402, + JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 403, + JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 404, + JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 405, + JSMSG_TYPEDOBJECT_TOO_BIG = 406, + JSMSG_SIMD_FAILED_CONVERSION = 407, + JSMSG_SIMD_TO_NUMBER = 408, + JSMSG_TOO_LONG_ARRAY = 409, + JSMSG_BAD_INDEX = 410, + JSMSG_NON_ARRAY_BUFFER_RETURNED = 411, + JSMSG_SAME_ARRAY_BUFFER_RETURNED = 412, + JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 413, + JSMSG_TYPED_ARRAY_BAD_ARGS = 414, + JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 415, + JSMSG_TYPED_ARRAY_DETACHED = 416, + JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 417, + JSMSG_SHARED_ARRAY_BAD_LENGTH = 418, + JSMSG_BAD_PARSE_NODE = 419, + JSMSG_SYMBOL_TO_STRING = 420, + JSMSG_SYMBOL_TO_NUMBER = 421, + JSMSG_ATOMICS_BAD_ARRAY = 422, + JSMSG_ATOMICS_TOO_LONG = 423, + JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 424, + JSMSG_CANT_SET_INTERPOSED = 425, + JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 426, + JSMSG_CANT_DELETE_WINDOW_ELEMENT = 427, + JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 428, + JSMSG_CANT_PREVENT_EXTENSIONS = 429, + JSMSG_NO_NAMED_SETTER = 430, + JSMSG_NO_INDEXED_SETTER = 431, + JSMSG_CANT_DELETE_SUPER = 432, + JSMSG_REINIT_THIS = 433, + JSMSG_BAD_DEFAULT_EXPORT = 434, + JSMSG_MISSING_INDIRECT_EXPORT = 435, + JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 436, + JSMSG_MISSING_IMPORT = 437, + JSMSG_AMBIGUOUS_IMPORT = 438, + JSMSG_MISSING_NAMESPACE_EXPORT = 439, + JSMSG_MISSING_EXPORT = 440, + JSMSG_MODULE_INSTANTIATE_FAILED = 441, + JSMSG_BAD_MODULE_STATE = 442, + JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 443, + JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 444, + JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 445, + JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 446, + JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 447, + JSErr_Limit = 448, } /** * Scalar types that can appear in typed arrays and typed objects. The enum @@ -4931,10 +5018,11 @@ pub enum Type { Float64 = 7, Uint8Clamped = 8, MaxTypedArrayViewType = 9, - Float32x4 = 10, - Int8x16 = 11, - Int16x8 = 12, - Int32x4 = 13, + Int64 = 10, + Float32x4 = 11, + Int8x16 = 12, + Int16x8 = 13, + Int32x4 = 14, } #[repr(u32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -5216,10 +5304,23 @@ pub struct _vftable_ScriptEnvironmentPreparer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct ScriptEnvironmentPreparer_Closure; +pub struct ScriptEnvironmentPreparer_Closure { + pub _vftable: *const _vftable_ScriptEnvironmentPreparer_Closure, +} +#[repr(C)] +pub struct _vftable_ScriptEnvironmentPreparer_Closure { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for ScriptEnvironmentPreparer_Closure { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_ScriptEnvironmentPreparer_Closure() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for ScriptEnvironmentPreparer { fn clone(&self) -> Self { *self } } @@ -5253,10 +5354,21 @@ fn bindgen_test_layout_AutoCTypesActivityCallback() { } #[repr(C)] #[derive(Debug, Copy)] -pub struct AllocationMetadataBuilder; +pub struct AllocationMetadataBuilder { + pub _vftable: *const _vftable_AllocationMetadataBuilder, +} +#[repr(C)] +pub struct _vftable_AllocationMetadataBuilder { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for AllocationMetadataBuilder { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_AllocationMetadataBuilder() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} #[repr(C)] #[derive(Debug)] pub struct NativeProfiler { @@ -5308,41 +5420,6 @@ fn bindgen_test_layout_GCHeapProfiler() { assert_eq!(::std::mem::size_of::() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5545,7 +5622,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5559,7 +5635,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5665,7 +5741,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5774,11 +5850,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5877,21 +5953,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5908,67 +5984,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEl"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEl"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEl"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEl"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -5978,8 +6054,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -5988,16 +6064,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6007,8 +6083,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6023,23 +6099,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6109,9 +6178,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPmmjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPmmjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6122,9 +6192,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPmS5_PK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPmS5_NS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6176,29 +6247,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6227,8 +6301,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6266,11 +6340,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6287,30 +6361,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6330,10 +6396,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6341,31 +6405,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFmPFmPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFmPFmPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcmE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcmE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6407,8 +6477,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6569,8 +6639,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContextm"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6584,77 +6652,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6696,8 +6764,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimemmm"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextmmm"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6775,6 +6843,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6834,8 +6906,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7701,6 +7771,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7845,10 +7919,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsmPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7858,10 +7935,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -7950,9 +8030,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8061,14 +8142,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8079,8 +8172,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8089,8 +8182,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8555,27 +8648,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8644,11 +8737,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8856,16 +8949,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8876,19 +8969,19 @@ extern "C" { pub fn JS_NewObjectForConstructor(cx: *mut JSContext, clasp: *const JSClass, args: *const CallArgs) -> *mut JSObject; - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -8970,34 +9063,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9106,18 +9210,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9125,41 +9229,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePmS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPmS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimem"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbmPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContextm"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9228,8 +9325,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9422,8 +9519,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP8_IO_FILENS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP8_IO_FILENS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9441,8 +9538,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9570,8 +9667,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9609,22 +9706,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js23RegExpToSharedNonInlineEP9JSContextN2JS6HandleIP8JSObjectEEPNS_11RegExpGuardE"] @@ -10187,8 +10284,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10196,8 +10293,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10294,8 +10391,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10378,6 +10475,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10388,28 +10488,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10440,25 +10518,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } diff --git a/src/jsapi_linux_64_debug.rs b/src/jsapi_linux_64_debug.rs index d2a8a88fc..2d183c5c5 100644 --- a/src/jsapi_linux_64_debug.rs +++ b/src/jsapi_linux_64_debug.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JS_DEFAULT_ZEAL_FREQ: ::std::os::raw::c_uint = 100; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; @@ -309,8 +309,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -446,62 +451,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, - pub field3: u64, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 24usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 40usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -510,6 +480,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -652,43 +625,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimem(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContextm(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimem(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContextm(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -705,7 +678,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -820,6 +793,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -872,10 +850,23 @@ pub struct _vftable_CallbackTracer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct CallbackTracer_ContextFunctor; +pub struct CallbackTracer_ContextFunctor { + pub _vftable: *const _vftable_CallbackTracer_ContextFunctor, +} +#[repr(C)] +pub struct _vftable_CallbackTracer_ContextFunctor { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for CallbackTracer_ContextFunctor { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_CallbackTracer_ContextFunctor() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for CallbackTracer { fn clone(&self) -> Self { *self } } @@ -1167,6 +1158,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1174,6 +1169,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1851,8 +1854,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2178,6 +2181,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2318,6 +2328,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2335,7 +2346,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2638,12 +2649,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2660,20 +2671,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2814,7 +2829,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -3022,13 +3037,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3053,7 +3068,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3499,11 +3514,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3642,7 +3657,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3650,7 +3664,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3720,9 +3734,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3960,6 +3974,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4132,11 +4189,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4172,11 +4224,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option Self { *self } } @@ -4470,6 +4527,10 @@ impl ::std::clone::Clone for AllCompartments { pub struct ContentCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ContentCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ContentCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4478,6 +4539,10 @@ impl ::std::clone::Clone for ContentCompartmentsOnly { pub struct ChromeCompartmentsOnly { pub _base: CompartmentFilter, } +#[repr(C)] +pub struct _vftable_ChromeCompartmentsOnly { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for ChromeCompartmentsOnly { fn clone(&self) -> Self { *self } } @@ -4487,6 +4552,10 @@ pub struct SingleCompartment { pub _base: CompartmentFilter, pub ours: *mut JSCompartment, } +#[repr(C)] +pub struct _vftable_SingleCompartment { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for SingleCompartment { fn clone(&self) -> Self { *self } } @@ -4501,6 +4570,10 @@ pub struct CompartmentsWithPrincipals { pub _base: CompartmentFilter, pub principals: *mut JSPrincipals, } +#[repr(C)] +pub struct _vftable_CompartmentsWithPrincipals { + pub _base: _vftable_CompartmentFilter, +} impl ::std::clone::Clone for CompartmentsWithPrincipals { fn clone(&self) -> Self { *self } } @@ -4778,205 +4851,218 @@ pub enum JSErrNum { JSMSG_RESERVED_ID = 234, JSMSG_REST_WITH_DEFAULT = 235, JSMSG_SELFHOSTED_TOP_LEVEL_LEXICAL = 236, - JSMSG_SELFHOSTED_UNBOUND_NAME = 237, - JSMSG_SEMI_AFTER_FOR_COND = 238, - JSMSG_SEMI_AFTER_FOR_INIT = 239, - JSMSG_SEMI_BEFORE_STMNT = 240, - JSMSG_SOURCE_TOO_LONG = 241, - JSMSG_STMT_AFTER_RETURN = 242, - JSMSG_STRICT_CODE_WITH = 243, - JSMSG_TEMPLSTR_UNTERM_EXPR = 244, - JSMSG_SIMD_NOT_A_VECTOR = 245, - JSMSG_TOO_MANY_CASES = 246, - JSMSG_TOO_MANY_CATCH_VARS = 247, - JSMSG_TOO_MANY_CON_ARGS = 248, - JSMSG_TOO_MANY_DEFAULTS = 249, - JSMSG_TOO_MANY_FUN_ARGS = 250, - JSMSG_TOO_MANY_LOCALS = 251, - JSMSG_TOO_MANY_YIELDS = 252, - JSMSG_TOUGH_BREAK = 253, - JSMSG_UNEXPECTED_TOKEN = 254, - JSMSG_UNNAMED_CLASS_STMT = 255, - JSMSG_UNNAMED_FUNCTION_STMT = 256, - JSMSG_UNTERMINATED_COMMENT = 257, - JSMSG_UNTERMINATED_REGEXP = 258, - JSMSG_UNTERMINATED_STRING = 259, - JSMSG_USELESS_EXPR = 260, - JSMSG_USE_ASM_DIRECTIVE_FAIL = 261, - JSMSG_VAR_HIDES_ARG = 262, - JSMSG_WHILE_AFTER_DO = 263, - JSMSG_YIELD_IN_ARROW = 264, - JSMSG_YIELD_IN_DEFAULT = 265, - JSMSG_BAD_COLUMN_NUMBER = 266, - JSMSG_COMPUTED_NAME_IN_PATTERN = 267, - JSMSG_DEFAULT_IN_PATTERN = 268, - JSMSG_BAD_NEWTARGET = 269, - JSMSG_ESCAPED_KEYWORD = 270, - JSMSG_USE_ASM_TYPE_FAIL = 271, - JSMSG_USE_ASM_LINK_FAIL = 272, - JSMSG_USE_ASM_TYPE_OK = 273, - JSMSG_WASM_FAIL = 274, - JSMSG_WASM_DECODE_FAIL = 275, - JSMSG_WASM_TEXT_FAIL = 276, - JSMSG_WASM_BAD_IND_CALL = 277, - JSMSG_WASM_BAD_BUF_ARG = 278, - JSMSG_WASM_BAD_IMPORT_ARG = 279, - JSMSG_WASM_UNREACHABLE = 280, - JSMSG_WASM_INTEGER_OVERFLOW = 281, - JSMSG_WASM_INVALID_CONVERSION = 282, - JSMSG_WASM_INT_DIVIDE_BY_ZERO = 283, - JSMSG_WASM_OVERRECURSED = 284, - JSMSG_BAD_TRAP_RETURN_VALUE = 285, - JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 286, - JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 287, - JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 288, - JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 289, - JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 290, - JSMSG_CANT_CHANGE_EXTENSIBILITY = 291, - JSMSG_CANT_DEFINE_INVALID = 292, - JSMSG_CANT_DEFINE_NEW = 293, - JSMSG_CANT_DEFINE_NE_AS_NC = 294, - JSMSG_PROXY_DEFINE_RETURNED_FALSE = 295, - JSMSG_PROXY_DELETE_RETURNED_FALSE = 296, - JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 297, - JSMSG_PROXY_SET_RETURNED_FALSE = 298, - JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 299, - JSMSG_CANT_REPORT_C_AS_NC = 300, - JSMSG_CANT_REPORT_E_AS_NE = 301, - JSMSG_CANT_REPORT_INVALID = 302, - JSMSG_CANT_REPORT_NC_AS_NE = 303, - JSMSG_CANT_REPORT_NEW = 304, - JSMSG_CANT_REPORT_NE_AS_NC = 305, - JSMSG_CANT_SET_NW_NC = 306, - JSMSG_CANT_SET_WO_SETTER = 307, - JSMSG_CANT_SKIP_NC = 308, - JSMSG_ONWKEYS_STR_SYM = 309, - JSMSG_MUST_REPORT_SAME_VALUE = 310, - JSMSG_MUST_REPORT_UNDEFINED = 311, - JSMSG_OBJECT_ACCESS_DENIED = 312, - JSMSG_PROPERTY_ACCESS_DENIED = 313, - JSMSG_PROXY_CONSTRUCT_OBJECT = 314, - JSMSG_PROXY_EXTENSIBILITY = 315, - JSMSG_PROXY_GETOWN_OBJORUNDEF = 316, - JSMSG_PROXY_REVOKED = 317, - JSMSG_PROXY_ARG_REVOKED = 318, - JSMSG_BAD_TRAP = 319, - JSMSG_SC_BAD_CLONE_VERSION = 320, - JSMSG_SC_BAD_SERIALIZED_DATA = 321, - JSMSG_SC_DUP_TRANSFERABLE = 322, - JSMSG_SC_NOT_TRANSFERABLE = 323, - JSMSG_SC_UNSUPPORTED_TYPE = 324, - JSMSG_SC_SHMEM_MUST_TRANSFER = 325, - JSMSG_ASSIGN_FUNCTION_OR_NULL = 326, - JSMSG_DEBUG_BAD_LINE = 327, - JSMSG_DEBUG_BAD_OFFSET = 328, - JSMSG_DEBUG_BAD_REFERENT = 329, - JSMSG_DEBUG_BAD_RESUMPTION = 330, - JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 331, - JSMSG_DEBUG_CCW_REQUIRED = 332, - JSMSG_DEBUG_COMPARTMENT_MISMATCH = 333, - JSMSG_DEBUG_LOOP = 334, - JSMSG_DEBUG_NOT_DEBUGGEE = 335, - JSMSG_DEBUG_NOT_DEBUGGING = 336, - JSMSG_DEBUG_NOT_IDLE = 337, - JSMSG_DEBUG_NOT_LIVE = 338, - JSMSG_DEBUG_NO_SCOPE_OBJECT = 339, - JSMSG_DEBUG_OBJECT_PROTO = 340, - JSMSG_DEBUG_OBJECT_WRONG_OWNER = 341, - JSMSG_DEBUG_OPTIMIZED_OUT = 342, - JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 343, - JSMSG_DEBUG_VARIABLE_NOT_FOUND = 344, - JSMSG_DEBUG_WRAPPER_IN_WAY = 345, - JSMSG_DEBUGGEE_WOULD_RUN = 346, - JSMSG_NOT_CALLABLE_OR_UNDEFINED = 347, - JSMSG_NOT_TRACKING_ALLOCATIONS = 348, - JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 349, - JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 350, - JSMSG_QUERY_LINE_WITHOUT_URL = 351, - JSMSG_DEBUG_CANT_SET_OPT_ENV = 352, - JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 353, - JSMSG_DEBUG_CENSUS_BREAKDOWN = 354, - JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 355, - JSMSG_TRACELOGGER_ENABLE_FAIL = 356, - JSMSG_DATE_NOT_FINITE = 357, - JSMSG_INTERNAL_INTL_ERROR = 358, - JSMSG_INTL_OBJECT_NOT_INITED = 359, - JSMSG_INTL_OBJECT_REINITED = 360, - JSMSG_INVALID_CURRENCY_CODE = 361, - JSMSG_INVALID_DIGITS_VALUE = 362, - JSMSG_INVALID_LANGUAGE_TAG = 363, - JSMSG_INVALID_LOCALES_ELEMENT = 364, - JSMSG_INVALID_LOCALE_MATCHER = 365, - JSMSG_INVALID_OPTION_VALUE = 366, - JSMSG_INVALID_TIME_ZONE = 367, - JSMSG_UNDEFINED_CURRENCY = 368, - JSMSG_BACK_REF_OUT_OF_RANGE = 369, - JSMSG_BAD_CLASS_RANGE = 370, - JSMSG_ESCAPE_AT_END_OF_REGEXP = 371, - JSMSG_EXEC_NOT_OBJORNULL = 372, - JSMSG_INVALID_DECIMAL_ESCAPE = 373, - JSMSG_INVALID_GROUP = 374, - JSMSG_INVALID_IDENTITY_ESCAPE = 375, - JSMSG_INVALID_UNICODE_ESCAPE = 376, - JSMSG_MISSING_PAREN = 377, - JSMSG_NEWREGEXP_FLAGGED = 378, - JSMSG_NOTHING_TO_REPEAT = 379, - JSMSG_NUMBERS_OUT_OF_ORDER = 380, - JSMSG_RANGE_WITH_CLASS_ESCAPE = 381, - JSMSG_RAW_BRACE_IN_REGEP = 382, - JSMSG_RAW_BRACKET_IN_REGEP = 383, - JSMSG_TOO_MANY_PARENS = 384, - JSMSG_UNICODE_OVERFLOW = 385, - JSMSG_UNMATCHED_RIGHT_PAREN = 386, - JSMSG_UNTERM_CLASS = 387, - JSMSG_DEFAULT_LOCALE_ERROR = 388, - JSMSG_NO_SUCH_SELF_HOSTED_PROP = 389, - JSMSG_INVALID_PROTOTYPE = 390, - JSMSG_TYPEDOBJECT_BAD_ARGS = 391, - JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 392, - JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 393, - JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 394, - JSMSG_TYPEDOBJECT_TOO_BIG = 395, - JSMSG_SIMD_FAILED_CONVERSION = 396, - JSMSG_SIMD_TO_NUMBER = 397, - JSMSG_TOO_LONG_ARRAY = 398, - JSMSG_BAD_INDEX = 399, - JSMSG_NON_ARRAY_BUFFER_RETURNED = 400, - JSMSG_SAME_ARRAY_BUFFER_RETURNED = 401, - JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 402, - JSMSG_TYPED_ARRAY_BAD_ARGS = 403, - JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 404, - JSMSG_TYPED_ARRAY_DETACHED = 405, - JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 406, - JSMSG_SHARED_ARRAY_BAD_LENGTH = 407, - JSMSG_BAD_PARSE_NODE = 408, - JSMSG_SYMBOL_TO_STRING = 409, - JSMSG_SYMBOL_TO_NUMBER = 410, - JSMSG_ATOMICS_BAD_ARRAY = 411, - JSMSG_ATOMICS_TOO_LONG = 412, - JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 413, - JSMSG_CANT_SET_INTERPOSED = 414, - JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 415, - JSMSG_CANT_DELETE_WINDOW_ELEMENT = 416, - JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 417, - JSMSG_CANT_PREVENT_EXTENSIONS = 418, - JSMSG_NO_NAMED_SETTER = 419, - JSMSG_NO_INDEXED_SETTER = 420, - JSMSG_CANT_DELETE_SUPER = 421, - JSMSG_REINIT_THIS = 422, - JSMSG_BAD_DEFAULT_EXPORT = 423, - JSMSG_MISSING_INDIRECT_EXPORT = 424, - JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 425, - JSMSG_MISSING_IMPORT = 426, - JSMSG_AMBIGUOUS_IMPORT = 427, - JSMSG_MISSING_NAMESPACE_EXPORT = 428, - JSMSG_MISSING_EXPORT = 429, - JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 430, - JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 431, - JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 432, - JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 433, - JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 434, - JSErr_Limit = 435, + JSMSG_SELFHOSTED_METHOD_CALL = 237, + JSMSG_SELFHOSTED_UNBOUND_NAME = 238, + JSMSG_SEMI_AFTER_FOR_COND = 239, + JSMSG_SEMI_AFTER_FOR_INIT = 240, + JSMSG_SEMI_BEFORE_STMNT = 241, + JSMSG_SOURCE_TOO_LONG = 242, + JSMSG_STMT_AFTER_RETURN = 243, + JSMSG_STRICT_CODE_WITH = 244, + JSMSG_TEMPLSTR_UNTERM_EXPR = 245, + JSMSG_SIMD_NOT_A_VECTOR = 246, + JSMSG_TOO_MANY_CASES = 247, + JSMSG_TOO_MANY_CATCH_VARS = 248, + JSMSG_TOO_MANY_CON_ARGS = 249, + JSMSG_TOO_MANY_DEFAULTS = 250, + JSMSG_TOO_MANY_FUN_ARGS = 251, + JSMSG_TOO_MANY_LOCALS = 252, + JSMSG_TOO_MANY_YIELDS = 253, + JSMSG_TOUGH_BREAK = 254, + JSMSG_UNEXPECTED_TOKEN = 255, + JSMSG_UNNAMED_CLASS_STMT = 256, + JSMSG_UNNAMED_FUNCTION_STMT = 257, + JSMSG_UNTERMINATED_COMMENT = 258, + JSMSG_UNTERMINATED_REGEXP = 259, + JSMSG_UNTERMINATED_STRING = 260, + JSMSG_USELESS_EXPR = 261, + JSMSG_USE_ASM_DIRECTIVE_FAIL = 262, + JSMSG_VAR_HIDES_ARG = 263, + JSMSG_WHILE_AFTER_DO = 264, + JSMSG_YIELD_IN_ARROW = 265, + JSMSG_YIELD_IN_DEFAULT = 266, + JSMSG_YIELD_IN_METHOD = 267, + JSMSG_BAD_COLUMN_NUMBER = 268, + JSMSG_COMPUTED_NAME_IN_PATTERN = 269, + JSMSG_DEFAULT_IN_PATTERN = 270, + JSMSG_BAD_NEWTARGET = 271, + JSMSG_ESCAPED_KEYWORD = 272, + JSMSG_USE_ASM_TYPE_FAIL = 273, + JSMSG_USE_ASM_LINK_FAIL = 274, + JSMSG_USE_ASM_TYPE_OK = 275, + JSMSG_WASM_FAIL = 276, + JSMSG_WASM_DECODE_FAIL = 277, + JSMSG_WASM_TEXT_FAIL = 278, + JSMSG_WASM_BAD_IND_CALL = 279, + JSMSG_WASM_BAD_BUF_ARG = 280, + JSMSG_WASM_BAD_MOD_ARG = 281, + JSMSG_WASM_BAD_DESC_ARG = 282, + JSMSG_WASM_BAD_IMP_SIZE = 283, + JSMSG_WASM_BAD_SIZE = 284, + JSMSG_WASM_BAD_ELEMENT = 285, + JSMSG_WASM_BAD_IMPORT_ARG = 286, + JSMSG_WASM_BAD_IMPORT_FIELD = 287, + JSMSG_WASM_BAD_IMPORT_SIG = 288, + JSMSG_WASM_BAD_SET_VALUE = 289, + JSMSG_WASM_UNREACHABLE = 290, + JSMSG_WASM_INTEGER_OVERFLOW = 291, + JSMSG_WASM_INVALID_CONVERSION = 292, + JSMSG_WASM_INT_DIVIDE_BY_ZERO = 293, + JSMSG_WASM_UNALIGNED_ACCESS = 294, + JSMSG_WASM_OVERRECURSED = 295, + JSMSG_BAD_TRAP_RETURN_VALUE = 296, + JSMSG_BAD_GETPROTOTYPEOF_TRAP_RETURN = 297, + JSMSG_INCONSISTENT_GETPROTOTYPEOF_TRAP = 298, + JSMSG_PROXY_SETPROTOTYPEOF_RETURNED_FALSE = 299, + JSMSG_PROXY_ISEXTENSIBLE_RETURNED_FALSE = 300, + JSMSG_INCONSISTENT_SETPROTOTYPEOF_TRAP = 301, + JSMSG_CANT_CHANGE_EXTENSIBILITY = 302, + JSMSG_CANT_DEFINE_INVALID = 303, + JSMSG_CANT_DEFINE_NEW = 304, + JSMSG_CANT_DEFINE_NE_AS_NC = 305, + JSMSG_PROXY_DEFINE_RETURNED_FALSE = 306, + JSMSG_PROXY_DELETE_RETURNED_FALSE = 307, + JSMSG_PROXY_PREVENTEXTENSIONS_RETURNED_FALSE = 308, + JSMSG_PROXY_SET_RETURNED_FALSE = 309, + JSMSG_CANT_REPORT_AS_NON_EXTENSIBLE = 310, + JSMSG_CANT_REPORT_C_AS_NC = 311, + JSMSG_CANT_REPORT_E_AS_NE = 312, + JSMSG_CANT_REPORT_INVALID = 313, + JSMSG_CANT_REPORT_NC_AS_NE = 314, + JSMSG_CANT_REPORT_NEW = 315, + JSMSG_CANT_REPORT_NE_AS_NC = 316, + JSMSG_CANT_SET_NW_NC = 317, + JSMSG_CANT_SET_WO_SETTER = 318, + JSMSG_CANT_SKIP_NC = 319, + JSMSG_ONWKEYS_STR_SYM = 320, + JSMSG_MUST_REPORT_SAME_VALUE = 321, + JSMSG_MUST_REPORT_UNDEFINED = 322, + JSMSG_OBJECT_ACCESS_DENIED = 323, + JSMSG_PROPERTY_ACCESS_DENIED = 324, + JSMSG_PROXY_CONSTRUCT_OBJECT = 325, + JSMSG_PROXY_EXTENSIBILITY = 326, + JSMSG_PROXY_GETOWN_OBJORUNDEF = 327, + JSMSG_PROXY_REVOKED = 328, + JSMSG_PROXY_ARG_REVOKED = 329, + JSMSG_BAD_TRAP = 330, + JSMSG_SC_BAD_CLONE_VERSION = 331, + JSMSG_SC_BAD_SERIALIZED_DATA = 332, + JSMSG_SC_DUP_TRANSFERABLE = 333, + JSMSG_SC_NOT_TRANSFERABLE = 334, + JSMSG_SC_UNSUPPORTED_TYPE = 335, + JSMSG_SC_SHMEM_MUST_TRANSFER = 336, + JSMSG_ASSIGN_FUNCTION_OR_NULL = 337, + JSMSG_DEBUG_BAD_LINE = 338, + JSMSG_DEBUG_BAD_OFFSET = 339, + JSMSG_DEBUG_BAD_REFERENT = 340, + JSMSG_DEBUG_BAD_RESUMPTION = 341, + JSMSG_DEBUG_CANT_DEBUG_GLOBAL = 342, + JSMSG_DEBUG_CCW_REQUIRED = 343, + JSMSG_DEBUG_COMPARTMENT_MISMATCH = 344, + JSMSG_DEBUG_LOOP = 345, + JSMSG_DEBUG_NOT_DEBUGGEE = 346, + JSMSG_DEBUG_NOT_DEBUGGING = 347, + JSMSG_DEBUG_NOT_IDLE = 348, + JSMSG_DEBUG_NOT_LIVE = 349, + JSMSG_DEBUG_NO_SCOPE_OBJECT = 350, + JSMSG_DEBUG_OBJECT_PROTO = 351, + JSMSG_DEBUG_OBJECT_WRONG_OWNER = 352, + JSMSG_DEBUG_OPTIMIZED_OUT = 353, + JSMSG_DEBUG_RESUMPTION_VALUE_DISALLOWED = 354, + JSMSG_DEBUG_VARIABLE_NOT_FOUND = 355, + JSMSG_DEBUG_WRAPPER_IN_WAY = 356, + JSMSG_DEBUGGEE_WOULD_RUN = 357, + JSMSG_NOT_CALLABLE_OR_UNDEFINED = 358, + JSMSG_NOT_TRACKING_ALLOCATIONS = 359, + JSMSG_OBJECT_METADATA_CALLBACK_ALREADY_SET = 360, + JSMSG_QUERY_INNERMOST_WITHOUT_LINE_URL = 361, + JSMSG_QUERY_LINE_WITHOUT_URL = 362, + JSMSG_DEBUG_CANT_SET_OPT_ENV = 363, + JSMSG_DEBUG_INVISIBLE_COMPARTMENT = 364, + JSMSG_DEBUG_CENSUS_BREAKDOWN = 365, + JSMSG_DEBUG_PROMISE_NOT_RESOLVED = 366, + JSMSG_TRACELOGGER_ENABLE_FAIL = 367, + JSMSG_DATE_NOT_FINITE = 368, + JSMSG_INTERNAL_INTL_ERROR = 369, + JSMSG_INTL_OBJECT_NOT_INITED = 370, + JSMSG_INTL_OBJECT_REINITED = 371, + JSMSG_INVALID_CURRENCY_CODE = 372, + JSMSG_INVALID_DIGITS_VALUE = 373, + JSMSG_INVALID_LANGUAGE_TAG = 374, + JSMSG_INVALID_LOCALES_ELEMENT = 375, + JSMSG_INVALID_LOCALE_MATCHER = 376, + JSMSG_INVALID_OPTION_VALUE = 377, + JSMSG_INVALID_TIME_ZONE = 378, + JSMSG_UNDEFINED_CURRENCY = 379, + JSMSG_BACK_REF_OUT_OF_RANGE = 380, + JSMSG_BAD_CLASS_RANGE = 381, + JSMSG_ESCAPE_AT_END_OF_REGEXP = 382, + JSMSG_EXEC_NOT_OBJORNULL = 383, + JSMSG_INVALID_DECIMAL_ESCAPE = 384, + JSMSG_INVALID_GROUP = 385, + JSMSG_INVALID_IDENTITY_ESCAPE = 386, + JSMSG_INVALID_UNICODE_ESCAPE = 387, + JSMSG_MISSING_PAREN = 388, + JSMSG_NEWREGEXP_FLAGGED = 389, + JSMSG_NOTHING_TO_REPEAT = 390, + JSMSG_NUMBERS_OUT_OF_ORDER = 391, + JSMSG_RANGE_WITH_CLASS_ESCAPE = 392, + JSMSG_RAW_BRACE_IN_REGEP = 393, + JSMSG_RAW_BRACKET_IN_REGEP = 394, + JSMSG_TOO_MANY_PARENS = 395, + JSMSG_UNICODE_OVERFLOW = 396, + JSMSG_UNMATCHED_RIGHT_PAREN = 397, + JSMSG_UNTERM_CLASS = 398, + JSMSG_DEFAULT_LOCALE_ERROR = 399, + JSMSG_NO_SUCH_SELF_HOSTED_PROP = 400, + JSMSG_INVALID_PROTOTYPE = 401, + JSMSG_TYPEDOBJECT_BAD_ARGS = 402, + JSMSG_TYPEDOBJECT_BINARYARRAY_BAD_INDEX = 403, + JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED = 404, + JSMSG_TYPEDOBJECT_STRUCTTYPE_BAD_ARGS = 405, + JSMSG_TYPEDOBJECT_TOO_BIG = 406, + JSMSG_SIMD_FAILED_CONVERSION = 407, + JSMSG_SIMD_TO_NUMBER = 408, + JSMSG_TOO_LONG_ARRAY = 409, + JSMSG_BAD_INDEX = 410, + JSMSG_NON_ARRAY_BUFFER_RETURNED = 411, + JSMSG_SAME_ARRAY_BUFFER_RETURNED = 412, + JSMSG_SHORT_ARRAY_BUFFER_RETURNED = 413, + JSMSG_TYPED_ARRAY_BAD_ARGS = 414, + JSMSG_TYPED_ARRAY_NEGATIVE_ARG = 415, + JSMSG_TYPED_ARRAY_DETACHED = 416, + JSMSG_TYPED_ARRAY_CONSTRUCT_BOUNDS = 417, + JSMSG_SHARED_ARRAY_BAD_LENGTH = 418, + JSMSG_BAD_PARSE_NODE = 419, + JSMSG_SYMBOL_TO_STRING = 420, + JSMSG_SYMBOL_TO_NUMBER = 421, + JSMSG_ATOMICS_BAD_ARRAY = 422, + JSMSG_ATOMICS_TOO_LONG = 423, + JSMSG_ATOMICS_WAIT_NOT_ALLOWED = 424, + JSMSG_CANT_SET_INTERPOSED = 425, + JSMSG_CANT_DEFINE_WINDOW_ELEMENT = 426, + JSMSG_CANT_DELETE_WINDOW_ELEMENT = 427, + JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY = 428, + JSMSG_CANT_PREVENT_EXTENSIONS = 429, + JSMSG_NO_NAMED_SETTER = 430, + JSMSG_NO_INDEXED_SETTER = 431, + JSMSG_CANT_DELETE_SUPER = 432, + JSMSG_REINIT_THIS = 433, + JSMSG_BAD_DEFAULT_EXPORT = 434, + JSMSG_MISSING_INDIRECT_EXPORT = 435, + JSMSG_AMBIGUOUS_INDIRECT_EXPORT = 436, + JSMSG_MISSING_IMPORT = 437, + JSMSG_AMBIGUOUS_IMPORT = 438, + JSMSG_MISSING_NAMESPACE_EXPORT = 439, + JSMSG_MISSING_EXPORT = 440, + JSMSG_MODULE_INSTANTIATE_FAILED = 441, + JSMSG_BAD_MODULE_STATE = 442, + JSMSG_CANNOT_RESOLVE_PROMISE_WITH_ITSELF = 443, + JSMSG_PROMISE_CAPABILITY_HAS_SOMETHING_ALREADY = 444, + JSMSG_PROMISE_RESOLVE_FUNCTION_NOT_CALLABLE = 445, + JSMSG_PROMISE_REJECT_FUNCTION_NOT_CALLABLE = 446, + JSMSG_PROMISE_ERROR_IN_WRAPPED_REJECTION_REASON = 447, + JSErr_Limit = 448, } /** * Scalar types that can appear in typed arrays and typed objects. The enum @@ -4997,10 +5083,11 @@ pub enum Type { Float64 = 7, Uint8Clamped = 8, MaxTypedArrayViewType = 9, - Float32x4 = 10, - Int8x16 = 11, - Int16x8 = 12, - Int32x4 = 13, + Int64 = 10, + Float32x4 = 11, + Int8x16 = 12, + Int16x8 = 13, + Int32x4 = 14, } #[repr(u32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] @@ -5282,10 +5369,23 @@ pub struct _vftable_ScriptEnvironmentPreparer { } #[repr(C)] #[derive(Debug, Copy)] -pub struct ScriptEnvironmentPreparer_Closure; +pub struct ScriptEnvironmentPreparer_Closure { + pub _vftable: *const _vftable_ScriptEnvironmentPreparer_Closure, +} +#[repr(C)] +pub struct _vftable_ScriptEnvironmentPreparer_Closure { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for ScriptEnvironmentPreparer_Closure { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_ScriptEnvironmentPreparer_Closure() { + assert_eq!(::std::mem::size_of::() , + 8usize); + assert_eq!(::std::mem::align_of::() , + 8usize); +} impl ::std::clone::Clone for ScriptEnvironmentPreparer { fn clone(&self) -> Self { *self } } @@ -5319,10 +5419,21 @@ fn bindgen_test_layout_AutoCTypesActivityCallback() { } #[repr(C)] #[derive(Debug, Copy)] -pub struct AllocationMetadataBuilder; +pub struct AllocationMetadataBuilder { + pub _vftable: *const _vftable_AllocationMetadataBuilder, +} +#[repr(C)] +pub struct _vftable_AllocationMetadataBuilder { + pub _bindgen_empty_ctype_warning_fix: u64, +} impl ::std::clone::Clone for AllocationMetadataBuilder { fn clone(&self) -> Self { *self } } +#[test] +fn bindgen_test_layout_AllocationMetadataBuilder() { + assert_eq!(::std::mem::size_of::() , 8usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} #[repr(C)] #[derive(Debug)] pub struct NativeProfiler { @@ -5374,41 +5485,6 @@ fn bindgen_test_layout_GCHeapProfiler() { assert_eq!(::std::mem::size_of::() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5611,7 +5687,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5625,7 +5700,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5731,7 +5806,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5840,11 +5915,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5946,21 +6021,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5977,67 +6052,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEl"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEl"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEl"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEl"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -6047,8 +6122,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -6057,16 +6132,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6076,8 +6151,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6092,23 +6167,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6188,9 +6256,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPmmjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPmmjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6201,9 +6270,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPmS5_PK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPmS5_NS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6255,29 +6325,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6306,8 +6379,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6345,11 +6418,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6366,30 +6439,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6409,10 +6474,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6420,31 +6483,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFmPFmPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFmPFmPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcmE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcmE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6486,8 +6555,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6648,8 +6717,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContextm"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6663,77 +6730,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6775,8 +6842,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimemmm"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextmmm"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6854,6 +6921,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6913,8 +6984,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7780,6 +7849,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7924,10 +7997,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsmPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7937,10 +8013,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -8029,9 +8108,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8140,14 +8220,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8158,8 +8250,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8168,8 +8260,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8634,27 +8726,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8723,11 +8815,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8935,16 +9027,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8958,23 +9050,23 @@ extern "C" { #[link_name = "_Z16JS_GetGCZealBitsP9JSContextPjS1_S1_"] pub fn JS_GetGCZealBits(cx: *mut JSContext, zealBits: *mut u32, frequency: *mut u32, nextScheduled: *mut u32); - #[link_name = "_Z12JS_SetGCZealP9JSRuntimehj"] - pub fn JS_SetGCZeal(rt: *mut JSRuntime, zeal: u8, frequency: u32); + #[link_name = "_Z12JS_SetGCZealP9JSContexthj"] + pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32); #[link_name = "_Z13JS_ScheduleGCP9JSContextj"] pub fn JS_ScheduleGC(cx: *mut JSContext, count: u32); - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -9056,34 +9148,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLm0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9192,18 +9295,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9211,41 +9314,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePmS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPmS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimem"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbmPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContextm"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9314,8 +9410,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9550,8 +9646,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP8_IO_FILENS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP8_IO_FILENS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9569,8 +9665,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9700,8 +9796,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9739,22 +9835,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js24GetEnterCompartmentDepthEP9JSContext"] pub fn GetEnterCompartmentDepth(cx: *mut JSContext) @@ -10320,8 +10416,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10329,8 +10425,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10427,8 +10523,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10519,6 +10615,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10529,28 +10628,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10581,25 +10658,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFmPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFmPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } From d7ab415134331149a78a2564b3cfc658fde109c2 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Thu, 8 Sep 2016 00:19:34 -0400 Subject: [PATCH 7/8] Update README for Windows, and create build-windows-bindings.sh --- etc/README | 70 +++++++++++++++++++++++----- etc/build-windows-bindings.sh | 87 +++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 12 deletions(-) create mode 100644 etc/build-windows-bindings.sh diff --git a/etc/README b/etc/README index 1cee003a9..7ed5ed697 100644 --- a/etc/README +++ b/etc/README @@ -1,16 +1,67 @@ Building bindings requires rust-bindgen checked out and built in ../../rust-bindgen (it expects to find the binary in ../../rust-bindgen/target/debug/bindgen). +Generally, the steps for any platform require a rust-bindgen binary in +../rust-bindgen/target/debug/bindgen and an approprivate llvm/clang in the PATH. +Then: + +cargo clean +cargo build +[ ignore errors in building js if bindings are out of date ] +./etc/bindings.sh +mv out.rs src/jsapi_your_platform_goes_here.rs +cargo test + === Windows === rust-bindgen must be built using a rust for the pc-windows-gnu target, not msvc, even when generating msvc bindings. Within a MINGW64 env, install mingw-w64-x86_64-clang then build rust-bindgen with 'LIBCLANG_PATH=c:/msys64/mingw64/bin cargo build' (replace -c:/msys64 with the root of your msys2-64 install directory). +c:/msys64 with the root of your msys2-64 install directory). Alternatively, build +LLVM/Clang from source and set LLVM_CONFIG_PATH to point to llvm-config.exe, LIBCLANG_PATH +to the build/bin dir, and LIBCLANG_STATIC_PATH to the build/lib dir. + +Make sure your PATH has the MINGW64 LLVM/Clang bin dir in it at the start. + +The build-windows-bindings.sh script automates the below steps. +Prerequisites for running it: + +1. A built llvm/clang for the pc-windows-gnu default target in the PATH +2. A rust-bindgen in ../rust-bindgen/target/debug/bindgen.exe built against + the above llvm/clang +3. Visual Studio 2015 environment variables present (see below for moz_vs info) + +Running build-windows-bindings.sh and getting a cup of coffee *and drinking it* +(or having lunch, depending on host speed) will update all 4 of the windows +bindings files. If you come back without finishing at least a cup of coffee, +you'll be staring at cargo compiling lines. Espresso drinkers, you've been +warned. :) + +==== MINGW/GNU bindings ==== + +Using a pc-windows-gnu rust: + +rustup default x86_64-pc-windows-gnu + +cargo clean +cargo build +[wait for everything to build; if bindings are out of date, it'll error out at the end -- that's okay] +./etc/bindings.sh +cp out.rs src/jsapi_windows_gcc_64.rs +cargo test + +Then, do the same for debugmozjs: + +cargo clean +cargo build --features debugmozjs +[wait for everything to build; if bindings are out of date, it'll error out at the end -- that's okay] +./etc/bindings.sh +cp out.rs src/jsapi_windows_gcc_64_debug.rs +cargo test --features debugmozjs # this will take forever; can just do a build ==== MSVC bindings ==== -Now, build rust-mozjs using a pc-windows-msvc rust. Note that you'll need to be in an +Now, Do the same with a pc-windows-msvc rust. Note that you'll need to be in an environment that has the Visual C++ env vars already set up for your compiler -- the msys package http://people.mozilla.org/~vladimir/misc/moz-vs-0.1.2-any.pkg.tar.xz can help with this (install with pacman -U moz-vs-0.1.2-any.pkg.tar.xz). After installation, running @@ -20,25 +71,20 @@ a different compiler. To generate VC14 (VS2015) bindings, in rust-mozjs: +rustup default x86_64-pc-windows-msvc + moz_vs 2015 cargo build [wait for everything to build; if bindings are out of date, it'll error out at the end -- that's okay] ./etc/bindings.sh msvc14 cp out.rs src/jsapi_windows_msvc14_64.rs -cargo build # make sure the build finishes +cargo test The debug bindings: cargo clean cargo build --features debugmozjs -[wait for everything to build] +[wait for everything to build; if bindings are out of date, it'll error out at the end -- that's okay] ./etc/bindings.sh msvc14 cp out.rs src/jsapi_windows_msvc14_64_debug.rs -cargo build --features debugmozjs - -If you get errors about "static_assert expression is not an integral constant expression", -additional static_assert(offsetof(...)) sites need to be #if 0'd out (this ends up being -a non-constant-expression according to clang when built with the MSVC headers). - -For generating the bindings with MSVC, only MSVC 2013 and 2015 are -supported (VC12 and 14). Run 'bindings.sh msvc12' and/or 'bindings.sh msvc14'. +cargo test --features debugmozjs # this will take forever; can just do a build diff --git a/etc/build-windows-bindings.sh b/etc/build-windows-bindings.sh new file mode 100644 index 000000000..4ae084ea2 --- /dev/null +++ b/etc/build-windows-bindings.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +set -e + +# Make sure we're in the toplevel rust-mozjs dir +cd "`dirname $0`"/.. + +if [[ ! -f "Cargo.toml" || ! -f "./etc/bindings.sh" ]] ; then + echo "Expected to be in the toplevel rust-bindgen dir, but somehow in: `pwd`" + exit 1 +fi + +if [[ ! -f ../rust-bindgen/target/debug/bindgen.exe ]] ; then + echo "Can't find bindgen.exe in ../rust-bindgen/target/debug" + exit 1 +fi + +if [[ "$VSINSTALLDIR" == "" ]] ; then + echo "Visual Studio 2015 environment variables and paths must be set before running this!" + exit 1 +fi + +handle_error() { + set +x + local parent_lineno="$1" + local message="$2" + local code="${3:-1}" + if [[ -n "$message" ]] ; then + echo "Error on or near line ${parent_lineno}: ${message}; exiting with status ${code}" + else + echo "Error on or near line ${parent_lineno}; exiting with status ${code}" + fi + exit "${code}" +} + +trap 'handle_error ${LINENO}' ERR + +build_bindings() { + cargo clean + cargo build $3 || echo ... ignoring first build error ... + ./etc/bindings.sh $4 + cp out.rs src/jsapi_$1.rs + cargo $2 $3 +} + +# Unset these, to make sure nothing wants to build for msvc +echo "Saving and clearing Visual Studio environment variables..." +saved_vsinstalldir="$VSINSTALLDIR" +saved_include="$INCLUDE" +saved_lib="$LIB" +unset VSINSTALLDIR +unset INCLUDE +unset LIB + +set -x + +# gnu first +rustup default nightly-x86_64-pc-windows-gnu + +build_bindings windows_gcc_64 test "" + +# We don't test debugmozjs; it takes way too long +build_bindings windows_gcc_64_debug build "--features debugmozjs" + +set +x + +# MSVC next + +echo "Restoring Visual Studio variables..." +export VSINSTALLDIR="${saved_vsinstalldir}" +export INCLUDE="${saved_include}" +export LIB="${saved_lib}" + +set -x + +rustup default nightly-x86_64-pc-windows-msvc + +build_bindings windows_msvc14_64 test "" msvc14 + +# We don't test debugmozjs; it takes way too long +build_bindings windows_msvc14_64_debug build "--features debugmozjs" msvc14 + +set +x + +echo "==== Success! ====" + +rm out.rs From b9a888c06df272f3053cf7dca3e3072e521585b1 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Thu, 8 Sep 2016 00:19:42 -0400 Subject: [PATCH 8/8] Update Windows bindings --- src/jsapi_windows_gcc_64.rs | 1275 ++++++++++++------------- src/jsapi_windows_gcc_64_debug.rs | 1280 +++++++++++++------------- src/jsapi_windows_msvc14_64.rs | 1259 +++++++++++++------------ src/jsapi_windows_msvc14_64_debug.rs | 1264 +++++++++++++------------ 4 files changed, 2618 insertions(+), 2460 deletions(-) diff --git a/src/jsapi_windows_gcc_64.rs b/src/jsapi_windows_gcc_64.rs index 69ebe127c..637189809 100644 --- a/src/jsapi_windows_gcc_64.rs +++ b/src/jsapi_windows_gcc_64.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; pub const JSITER_KEYVALUE: ::std::os::raw::c_uint = 4; @@ -308,8 +308,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -445,61 +450,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 16usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 32usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -508,6 +479,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -650,43 +624,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContexty(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContexty(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -703,7 +677,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -800,6 +774,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -1160,6 +1139,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1167,6 +1150,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1809,8 +1800,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2136,6 +2127,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2276,6 +2274,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2293,7 +2292,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2585,12 +2584,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2607,20 +2606,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2761,7 +2764,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -2969,13 +2972,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3000,7 +3003,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3446,11 +3449,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3589,7 +3592,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3597,7 +3599,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3667,9 +3669,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3907,6 +3909,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4079,11 +4124,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4119,11 +4159,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5602,7 +5622,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5616,7 +5635,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5722,7 +5741,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5831,11 +5850,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5934,21 +5953,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5965,67 +5984,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEx"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEx"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEx"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEx"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -6035,8 +6054,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -6045,16 +6064,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6064,8 +6083,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6080,23 +6099,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6166,9 +6178,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPyyjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPyyjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6179,9 +6192,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyS5_PK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyS5_NS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6233,29 +6247,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6284,8 +6301,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6323,11 +6340,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6344,30 +6361,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6387,10 +6396,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6398,31 +6405,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFyPFyPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFyPFyPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcyE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcyE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6464,8 +6477,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6626,8 +6639,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContexty"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6641,77 +6652,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6753,8 +6764,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimeyyy"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextyyy"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6832,6 +6843,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6891,8 +6906,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7758,6 +7771,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7902,10 +7919,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsyPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7915,10 +7935,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -8007,9 +8030,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8118,14 +8142,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8136,8 +8172,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8146,8 +8182,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8612,27 +8648,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8701,11 +8737,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8913,16 +8949,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8933,19 +8969,19 @@ extern "C" { pub fn JS_NewObjectForConstructor(cx: *mut JSContext, clasp: *const JSClass, args: *const CallArgs) -> *mut JSObject; - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -9027,34 +9063,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLy0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLy0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9163,18 +9210,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9182,41 +9229,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePyS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPyS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimey"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbyPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContexty"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9285,8 +9325,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9479,8 +9519,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP6_iobufNS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP6_iobufNS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9498,8 +9538,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9627,8 +9667,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9666,22 +9706,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js23RegExpToSharedNonInlineEP9JSContextN2JS6HandleIP8JSObjectEEPNS_11RegExpGuardE"] @@ -10244,8 +10284,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10253,8 +10293,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10351,8 +10391,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10435,6 +10475,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10445,28 +10488,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10497,25 +10518,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFyPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFyPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFyPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFyPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } diff --git a/src/jsapi_windows_gcc_64_debug.rs b/src/jsapi_windows_gcc_64_debug.rs index fd6e43f93..00785366e 100644 --- a/src/jsapi_windows_gcc_64_debug.rs +++ b/src/jsapi_windows_gcc_64_debug.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JS_DEFAULT_ZEAL_FREQ: ::std::os::raw::c_uint = 100; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; @@ -309,8 +309,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -446,62 +451,27 @@ impl RootLists { } } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, - pub field3: u64, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 24usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 40usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -510,6 +480,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -652,43 +625,43 @@ fn bindgen_test_layout_GCDescription() { assert_eq!(::std::mem::align_of::() , 4usize); } extern "C" { - fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(this: + fn _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; - fn _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(this: + fn _ZNK2JS13GCDescription10formatJSONEP9JSContexty(this: *mut GCDescription, - rt: *mut JSRuntime, + cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription18formatSliceMessageEP9JSRuntime(&mut *self, rt) + _ZNK2JS13GCDescription18formatSliceMessageEP9JSContext(&mut *self, cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription20formatSummaryMessageEP9JSRuntime(&mut *self, - rt) + _ZNK2JS13GCDescription20formatSummaryMessageEP9JSContext(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _ZNK2JS13GCDescription10formatJSONEP9JSRuntimey(&mut *self, rt, + _ZNK2JS13GCDescription10formatJSONEP9JSContexty(&mut *self, cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -705,7 +678,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -820,6 +793,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -1180,6 +1158,10 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + fn _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(this: *mut ObjectPtr, + rt: *mut JSRuntime); + fn _ZN2JS9ObjectPtr8finalizeEP9JSContext(this: *mut ObjectPtr, + cx: *mut JSContext); fn _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(this: *mut ObjectPtr); fn _ZN2JS9ObjectPtr5traceEP8JSTracerPKc(this: *mut ObjectPtr, trc: *mut JSTracer, @@ -1187,6 +1169,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _ZN2JS9ObjectPtr8finalizeEP9JSRuntime(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _ZN2JS9ObjectPtr8finalizeEP9JSContext(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _ZN2JS9ObjectPtr24updateWeakPointerAfterGCEv(&mut *self) @@ -1864,8 +1854,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2191,6 +2181,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(u32)] @@ -2331,6 +2328,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2348,7 +2346,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2651,12 +2649,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(u32)] @@ -2673,20 +2671,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2827,7 +2829,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -3035,13 +3037,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3066,7 +3068,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option() , 4usize); } extern "C" { - fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(this: + fn _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(this: *mut CompartmentBehaviors, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSRuntime(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _ZNK2JS20CompartmentBehaviors13extraWarningsEP9JSContext(&mut *self, + cx) } } /** @@ -3512,11 +3514,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 24usize], + pub _bindgen_opaque_blob: [u64; 23usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 192usize); + assert_eq!(::std::mem::size_of::() , 184usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3655,7 +3657,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3663,7 +3664,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { @@ -3733,9 +3734,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3973,6 +3974,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4145,11 +4189,6 @@ impl PerformanceGroup { _ZN2js16PerformanceGroup7ReleaseEv(&mut *self) } } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4185,11 +4224,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option() , 8usize); assert_eq!(::std::mem::align_of::() , 8usize); } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct MemProfiler { - pub mGCHeapProfiler: *mut GCHeapProfiler, - pub mRuntime: *mut JSRuntime, -} -impl ::std::clone::Clone for MemProfiler { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_MemProfiler() { - assert_eq!(::std::mem::size_of::() , 16usize); - assert_eq!(::std::mem::align_of::() , 8usize); -} -extern "C" { - fn _ZN11MemProfiler5startEP14GCHeapProfiler(this: *mut MemProfiler, - aGCHeapProfiler: - *mut GCHeapProfiler); - fn _ZN11MemProfiler4stopEv(this: *mut MemProfiler); - fn _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime: *mut JSRuntime) - -> *mut MemProfiler; -} -impl MemProfiler { - #[inline] - pub unsafe fn start(&mut self, aGCHeapProfiler: *mut GCHeapProfiler) { - _ZN11MemProfiler5startEP14GCHeapProfiler(&mut *self, aGCHeapProfiler) - } - #[inline] - pub unsafe fn stop(&mut self) { _ZN11MemProfiler4stopEv(&mut *self) } - #[inline] - pub unsafe fn GetMemProfiler(runtime: *mut JSRuntime) - -> *mut MemProfiler { - _ZN11MemProfiler14GetMemProfilerEP9JSRuntime(runtime) - } -} #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum InitState { Uninitialized = 0, Running = 1, ShutDown = 2, } @@ -5668,7 +5687,6 @@ fn bindgen_test_layout_CodeSizes() { pub struct GCSizes { pub marker: usize, pub nurseryCommitted: usize, - pub nurseryDecommitted: usize, pub nurseryMallocedBuffers: usize, pub storeBufferVals: usize, pub storeBufferCells: usize, @@ -5682,7 +5700,7 @@ impl ::std::clone::Clone for GCSizes { } #[test] fn bindgen_test_layout_GCSizes() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5788,7 +5806,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5897,11 +5915,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -6003,21 +6021,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "_ZN2JS16PrepareForFullGCEP9JSRuntime"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS16PrepareForFullGCEP9JSContext"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSRuntime"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS23PrepareForIncrementalGCEP9JSContext"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "_ZN2JS13IsGCScheduledEP9JSRuntime"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS13IsGCScheduledEP9JSContext"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -6034,67 +6052,67 @@ extern "C" { * the system. */ #[link_name = - "_ZN2JS11GCForReasonEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonE"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS11GCForReasonEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonE"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18StartIncrementalGCEP9JSRuntime18JSGCInvocationKindNS_8gcreason6ReasonEx"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "_ZN2JS18StartIncrementalGCEP9JSContext18JSGCInvocationKindNS_8gcreason6ReasonEx"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "_ZN2JS18IncrementalGCSliceEP9JSRuntimeNS_8gcreason6ReasonEx"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "_ZN2JS18IncrementalGCSliceEP9JSContextNS_8gcreason6ReasonEx"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "_ZN2JS19FinishIncrementalGCEP9JSRuntimeNS_8gcreason6ReasonE"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "_ZN2JS19FinishIncrementalGCEP9JSContextNS_8gcreason6ReasonE"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSRuntime"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS18AbortIncrementalGCEP9JSContext"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "_ZN2JS18SetGCSliceCallbackEP9JSRuntimePFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "_ZN2JS18SetGCSliceCallbackEP9JSContextPFvS1_NS_10GCProgressERKNS_13GCDescriptionEE"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSRuntimePFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "_ZN2JS30SetGCNurseryCollectionCallbackEP9JSContextPFvS1_NS_17GCNurseryProgressENS_8gcreason6ReasonEE"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -6104,8 +6122,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSRuntime"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "_ZN2JS20DisableIncrementalGCEP9JSContext"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -6114,16 +6132,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSRuntime"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS22IsIncrementalGCEnabledEP9JSContext"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSRuntime"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSRuntime"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS25IsIncrementalGCInProgressEP9JSContext"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "_ZN2JS26IsIncrementalBarrierNeededEP9JSContext"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "_ZN2JS27IncrementalReferenceBarrierENS_9GCCellPtrE"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "_ZN2JS23IncrementalValueBarrierERKNS_5ValueE"] @@ -6133,8 +6151,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "_ZN2JS16WasIncrementalGCEP9JSRuntime"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2JS16WasIncrementalGCEP9JSContext"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -6149,23 +6167,16 @@ extern "C" { #[link_name = "_ZN2JS11GetGCNumberEv"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "_ZN2JS15ShrinkGCBuffersEP9JSRuntime"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "_ZN2JS28UnmarkGrayGCThingRecursivelyENS_9GCCellPtrE"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "_ZN2JS6PokeGCEP9JSRuntime"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "_ZN2JS14NotifyDidPaintEP9JSRuntime"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "_ZN2JS6PokeGCEP9JSContext"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "_ZN2JS14NotifyDidPaintEP9JSContext"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "_ZN2JS18GCTraceKindToAsciiENS_9TraceKindE"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -6245,9 +6256,10 @@ extern "C" { vp: MutableHandleValue) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "_Z22JS_ReadStructuredCloneP9JSContextPyyjN2JS13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] + "_Z22JS_ReadStructuredCloneP9JSContextPyyjN2JS20StructuredCloneScopeENS2_13MutableHandleINS2_5ValueEEEPK26JSStructuredCloneCallbacksPv"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -6258,9 +6270,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyS5_PK26JSStructuredCloneCallbacksPvS4_"] + "_Z23JS_WriteStructuredCloneP9JSContextN2JS6HandleINS1_5ValueEEEPPyS5_NS1_20StructuredCloneScopeEPK26JSStructuredCloneCallbacksPvS4_"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6312,29 +6325,32 @@ extern "C" { "_Z19JS_ObjectNotWrittenP23JSStructuredCloneWriterN2JS6HandleIP8JSObjectEE"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = "_Z26JS_GetStructuredCloneScopeP23JSStructuredCloneWriter"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "_Z17JS_HoldPrincipalsP12JSPrincipals"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); - #[link_name = "_Z17JS_DropPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z17JS_DropPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "_Z23JS_SetSecurityCallbacksP9JSRuntimePK19JSSecurityCallbacks"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "_Z23JS_SetSecurityCallbacksP9JSContextPK19JSSecurityCallbacks"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); - #[link_name = "_Z23JS_GetSecurityCallbacksP9JSRuntime"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z23JS_GetSecurityCallbacksP9JSContext"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; - #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSRuntimeP12JSPrincipals"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetTrustedPrincipalsP9JSContextP12JSPrincipals"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "_Z32JS_InitDestroyPrincipalsCallbackP9JSRuntimePFvP12JSPrincipalsE"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "_Z32JS_InitDestroyPrincipalsCallbackP9JSContextPFvP12JSPrincipalsE"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "_Z29JS_InitReadPrincipalsCallbackP9JSRuntimePFbP9JSContextP23JSStructuredCloneReaderPP12JSPrincipalsE"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "_Z29JS_InitReadPrincipalsCallbackP9JSContextPFbS0_P23JSStructuredCloneReaderPP12JSPrincipalsE"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = "_Z22JS_StringHasBeenPinnedP9JSContextP8JSString"] @@ -6363,8 +6379,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "_Z22JS_GetEmptyStringValueP9JSContext"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "_Z17JS_GetEmptyStringP9JSRuntime"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "_Z17JS_GetEmptyStringP9JSContext"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "_Z16JS_ValueToObjectP9JSContextN2JS6HandleINS1_5ValueEEENS1_13MutableHandleIP8JSObjectEE"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6402,11 +6418,11 @@ extern "C" { #[link_name = "_Z31JS_IsBuiltinFunctionConstructorP10JSFunction"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "_Z13JS_NewRuntimejjP9JSRuntime"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z17JS_DestroyRuntimeP9JSRuntime"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "_Z13JS_NewContextjjP9JSContext"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "_Z17JS_DestroyContextP9JSContext"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6423,30 +6439,22 @@ extern "C" { */ #[link_name = "_Z25JS_GetCurrentEmbedderTimev"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "_Z20JS_GetRuntimePrivateP9JSRuntime"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "_Z20JS_GetContextPrivateP9JSContext"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "_Z13JS_GetRuntimeP9JSContext"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "_Z19JS_GetParentRuntimeP9JSRuntime"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "_Z20JS_SetRuntimePrivateP9JSRuntimePv"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "_Z20JS_SetContextPrivateP9JSContextPv"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "_Z19JS_GetParentContextP9JSContext"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "_Z15JS_BeginRequestP9JSContext"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "_Z13JS_EndRequestP9JSContext"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "_Z18JS_SetFutexCanWaitP9JSRuntime"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); + #[link_name = "_Z18JS_SetFutexCanWaitP9JSContext"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "_ZN2js16AssertHeapIsIdleEP9JSRuntime"] pub fn AssertHeapIsIdle(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "_Z13JS_GetContextP9JSRuntime"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; #[link_name = "_Z13JS_GetVersionP9JSContext"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6466,10 +6474,8 @@ extern "C" { #[link_name = "_Z18JS_StringToVersionPKc"] pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSRuntime"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = "_ZN2JS17RuntimeOptionsRefEP9JSContext"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + #[link_name = "_ZN2JS17ContextOptionsRefEP9JSContext"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6477,31 +6483,37 @@ extern "C" { */ #[link_name = "_ZN2JS18InitSelfHostedCodeEP9JSContext"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = "_ZN2JS34AssertObjectBelongsToCurrentThreadEP8JSObject"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "_Z27JS_GetImplementationVersionv"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "_Z32JS_SetDestroyCompartmentCallbackP9JSRuntimePFvP8JSFreeOpP13JSCompartmentE"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "_Z32JS_SetDestroyCompartmentCallbackP9JSContextPFvP8JSFreeOpP13JSCompartmentE"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSRuntimePFyPFyPKvEP13JSCompartmentE"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "_Z44JS_SetSizeOfIncludingThisCompartmentCallbackP9JSContextPFyPFyPKvEP13JSCompartmentE"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); - #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z25JS_SetDestroyZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); - #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSRuntimePFvPN2JS4ZoneEE"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetSweepZoneCallbackP9JSContextPFvPN2JS4ZoneEE"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "_Z29JS_SetCompartmentNameCallbackP9JSRuntimePFvS0_P13JSCompartmentPcyE"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "_Z29JS_SetCompartmentNameCallbackP9JSContextPFvS0_P13JSCompartmentPcyE"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "_Z25JS_SetWrapObjectCallbacksP9JSRuntimePK21JSWrapObjectCallbacks"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "_Z25JS_SetWrapObjectCallbacksP9JSContextPK21JSWrapObjectCallbacks"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "_Z24JS_SetCompartmentPrivateP13JSCompartmentPv"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6543,8 +6555,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "_Z22JS_IterateCompartmentsP9JSRuntimePvPFvS0_S1_P13JSCompartmentE"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "_Z22JS_IterateCompartmentsP9JSContextPvPFvS0_S1_P13JSCompartmentE"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6705,8 +6717,6 @@ extern "C" { */ #[link_name = "_Z9JS_freeopP8JSFreeOpPv"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "_Z19JS_GetDefaultFreeOpP9JSRuntime"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "_Z22JS_updateMallocCounterP9JSContexty"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "_Z9JS_strdupP9JSContextPKc"] @@ -6720,77 +6730,77 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "_Z24JS_AddExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z24JS_AddExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "_Z27JS_RemoveExtraGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "_Z27JS_RemoveExtraGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z5JS_GCP9JSRuntime"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "_Z5JS_GCP9JSContext"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "_Z10JS_MaybeGCP9JSContext"] pub fn JS_MaybeGC(cx: *mut JSContext); - #[link_name = "_Z16JS_SetGCCallbackP9JSRuntimePFvS0_10JSGCStatusPvES2_"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + #[link_name = "_Z16JS_SetGCCallbackP9JSContextPFvS0_10JSGCStatusPvES2_"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); - #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetObjectsTenuredCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "_Z22JS_AddFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "_Z22JS_AddFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvES4_"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z25JS_RemoveFinalizeCallbackP9JSRuntimePFvP8JSFreeOp16JSFinalizeStatusbPvE"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "_Z25JS_RemoveFinalizeCallbackP9JSContextPFvP8JSFreeOp16JSFinalizeStatusbPvE"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvES1_"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z34JS_AddWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvES1_"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSRuntimePFvS0_PvE"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "_Z37JS_RemoveWeakPointerZoneGroupCallbackP9JSContextPFvS0_PvE"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "_Z36JS_AddWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvES3_"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z36JS_AddWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvES3_"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSRuntimePFvS0_P13JSCompartmentPvE"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "_Z39JS_RemoveWeakPointerCompartmentCallbackP9JSContextPFvS0_P13JSCompartmentPvE"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = "_Z27JS_UpdateWeakPointerAfterGCPN2JS4HeapIP8JSObjectEE"] pub fn JS_UpdateWeakPointerAfterGC(objp: *mut Heap<*mut JSObject>); #[link_name = "_Z38JS_UpdateWeakPointerAfterGCUnbarrieredPP8JSObject"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "_Z17JS_SetGCParameterP9JSRuntime12JSGCParamKeyj"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "_Z17JS_SetGCParameterP9JSContext12JSGCParamKeyj"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "_Z17JS_GetGCParameterP9JSRuntime12JSGCParamKey"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; - #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSRuntimej"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + #[link_name = "_Z17JS_GetGCParameterP9JSContext12JSGCParamKey"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; + #[link_name = "_Z40JS_SetGCParametersBasedOnAvailableMemoryP9JSContextj"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6832,8 +6842,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "_Z22JS_SetNativeStackQuotaP9JSRuntimeyyy"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "_Z22JS_SetNativeStackQuotaP9JSContextyyy"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6911,6 +6921,10 @@ extern "C" { "_Z14JS_HasInstanceP9JSContextN2JS6HandleIP8JSObjectEENS2_INS1_5ValueEEEPb"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "_ZN2JS19OrdinaryHasInstanceEP9JSContextNS_6HandleIP8JSObjectEENS2_INS_5ValueEEEPb"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "_Z13JS_GetPrivateP8JSObject"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "_Z13JS_SetPrivateP8JSObjectPv"] @@ -6970,8 +6984,6 @@ extern "C" { -> *mut JSObject; #[link_name = "_Z11JS_IsNativeP8JSObject"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "_Z19JS_GetObjectRuntimeP8JSObject"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7837,6 +7849,10 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "_Z18JS_IsFunctionBoundP10JSFunction"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = "_Z25JS_GetBoundFunctionTargetP10JSFunction"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7981,10 +7997,13 @@ extern "C" { length: usize, callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadScriptEP9JSContextPv"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "_ZN2JS21CancelOffThreadScriptEP9JSContextPv"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "_ZN2JS22CompileOffThreadModuleEP9JSContextRKNS_22ReadOnlyCompileOptionsEPKDsyPFvPvS7_ES7_"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7994,10 +8013,13 @@ extern "C" { callback: OffThreadCompileCallback, callbackData: *mut ::std::os::raw::c_void) -> bool; - #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextP9JSRuntimePv"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + #[link_name = "_ZN2JS21FinishOffThreadModuleEP9JSContextPv"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "_ZN2JS21CancelOffThreadModuleEP9JSContextPv"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -8086,9 +8108,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEE"] + "_ZN2JS21CloneAndExecuteScriptEP9JSContextNS_6HandleIP8JSScriptEENS_13MutableHandleINS_5ValueEEE"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -8197,14 +8220,26 @@ extern "C" { -> *mut JSScript; #[link_name = "_Z20JS_CheckForInterruptP9JSContext"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; - #[link_name = "_Z23JS_SetInterruptCallbackP9JSRuntimePFbP9JSContextE"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + #[link_name = "_Z23JS_SetInterruptCallbackP9JSContextPFbS0_E"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; - #[link_name = "_Z23JS_GetInterruptCallbackP9JSRuntime"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "_Z27JS_RequestInterruptCallbackP9JSRuntime"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + #[link_name = "_Z23JS_GetInterruptCallbackP9JSContext"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "_Z27JS_RequestInterruptCallbackP9JSContext"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ + #[link_name = + "_ZN2JS29SetGetIncumbentGlobalCallbackEP9JSContextPFP8JSObjectS1_E"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8215,8 +8250,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSRuntimePFbP9JSContextNS_6HandleIP8JSObjectEES7_PvES8_"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "_ZN2JS28SetEnqueuePromiseJobCallbackEP9JSContextPFbS1_NS_6HandleIP8JSObjectEES5_S5_PvES6_"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8225,8 +8260,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSRuntimePFvP9JSContextNS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES9_"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "_ZN2JS34SetPromiseRejectionTrackerCallbackEP9JSContextPFvS1_NS_6HandleIP8JSObjectEE29PromiseRejectionHandlingStatePvES7_"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8691,27 +8726,27 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "_Z19JS_SetDefaultLocaleP9JSRuntimePKc"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "_Z19JS_SetDefaultLocaleP9JSContextPKc"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "_Z21JS_ResetDefaultLocaleP9JSRuntime"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "_Z21JS_ResetDefaultLocaleP9JSContext"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ - #[link_name = "_Z21JS_SetLocaleCallbacksP9JSRuntimePK17JSLocaleCallbacks"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + #[link_name = "_Z21JS_SetLocaleCallbacksP9JSContextPK17JSLocaleCallbacks"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ - #[link_name = "_Z21JS_GetLocaleCallbacksP9JSRuntime"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + #[link_name = "_Z21JS_GetLocaleCallbacksP9JSContext"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8780,11 +8815,11 @@ extern "C" { #[link_name = "_Z27JS_ReportAllocationOverflowP9JSContext"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "_ZN2JS18SetWarningReporterEP9JSRuntimePFvP9JSContextPKcP13JSErrorReportE"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "_ZN2JS18SetWarningReporterEP9JSContextPFvS1_PKcP13JSErrorReportE"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; - #[link_name = "_ZN2JS18GetWarningReporterEP9JSRuntime"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + #[link_name = "_ZN2JS18GetWarningReporterEP9JSContext"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "_ZN2JS11CreateErrorEP9JSContext9JSExnTypeNS_6HandleIP8JSObjectEENS3_IP8JSStringEEjjP13JSErrorReportS9_NS_13MutableHandleINS_5ValueEEE"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8992,16 +9027,16 @@ extern "C" { #[link_name = "_Z19JS_GetCurrentThreadv"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "_Z21JS_AbortIfWrongThreadP9JSRuntime"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "_Z21JS_AbortIfWrongThreadP9JSContext"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -9015,23 +9050,23 @@ extern "C" { #[link_name = "_Z16JS_GetGCZealBitsP9JSContextPjS1_S1_"] pub fn JS_GetGCZealBits(cx: *mut JSContext, zealBits: *mut u32, frequency: *mut u32, nextScheduled: *mut u32); - #[link_name = "_Z12JS_SetGCZealP9JSRuntimehj"] - pub fn JS_SetGCZeal(rt: *mut JSRuntime, zeal: u8, frequency: u32); + #[link_name = "_Z12JS_SetGCZealP9JSContexthj"] + pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32); #[link_name = "_Z13JS_ScheduleGCP9JSContextj"] pub fn JS_ScheduleGC(cx: *mut JSContext, count: u32); - #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSRuntimeb"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); - #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSRuntimeb"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + #[link_name = "_Z28JS_SetParallelParsingEnabledP9JSContextb"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); + #[link_name = "_Z36JS_SetOffthreadIonCompilationEnabledP9JSContextb"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "_Z29JS_SetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOptionj"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_SetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOptionj"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "_Z29JS_GetGlobalJitCompilerOptionP9JSRuntime19JSJitCompilerOption"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "_Z29JS_GetGlobalJitCompilerOptionP9JSContext19JSJitCompilerOption"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -9113,34 +9148,45 @@ extern "C" { pub fn JS_DecodeInterpretedFunction(cx: *mut JSContext, data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; - #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSRuntimePKNS_13AsmJSCacheOpsE"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + #[link_name = "_ZN2JS16SetAsmJSCacheOpsEP9JSContextPKNS_13AsmJSCacheOpsE"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "_ZN2JS12SetBuildIdOpEP9JSRuntimePFbPN7mozilla6VectorIcLy0EN2js17SystemAllocPolicyEEEE"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "_ZN2JS12SetBuildIdOpEP9JSContextPFbPN7mozilla6VectorIcLy0EN2js17SystemAllocPolicyEEEE"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSRuntimePFvPvES2_"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "_ZN2JS33SetLargeAllocationFailureCallbackEP9JSContextPFvPvES2_"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); - #[link_name = - "_ZN2JS22SetOutOfMemoryCallbackEP9JSRuntimePFvP9JSContextPvES4_"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + #[link_name = "_ZN2JS22SetOutOfMemoryCallbackEP9JSContextPFvS1_PvES2_"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEj"] + "_ZN2JS19CaptureCurrentStackEP9JSContextNS_13MutableHandleIP8JSObjectEEON7mozilla7VariantIJNS_9AllFramesENS_9MaxFramesENS_18FirstSubsumedFrameEEEE"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "_ZN2JS14CopyAsyncStackEP9JSContextNS_6HandleIP8JSObjectEENS2_IP8JSStringEENS_13MutableHandleIS4_EEj"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9249,18 +9295,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSRuntime"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js26FlushPerformanceMonitoringEP9JSContext"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSRuntime"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js26ResetPerformanceMonitoringEP9JSContext"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSRuntime"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "_ZN2js28DisposePerformanceMonitoringEP9JSContext"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9268,41 +9314,34 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28SetStopwatchIsMonitoringCPOWEP9JSContextb"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSRuntimeb"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "_ZN2js28GetStopwatchIsMonitoringCPOWEP9JSContext"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "_ZN2js28SetStopwatchIsMonitoringJankEP9JSContextb"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSRuntime"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "_ZN2js17IsStopwatchActiveEP9JSRuntime"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js28GetStopwatchIsMonitoringJankEP9JSContext"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSRuntimePyS2_"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "_ZN2js36GetPerfMonitoringTestCpuReschedulingEP9JSContextPyS2_"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSRuntimey"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = "_ZN2js25SetStopwatchStartCallbackEP9JSRuntimePFbyPvES2_"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "_ZN2js23AddCPOWPerformanceDeltaEP9JSContexty"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "_ZN2JS6detail19CallMethodIfWrappedEP9JSContextPFbNS_6HandleINS_5ValueEEEEPFbS2_RKNS_8CallArgsEESA_"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; - #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSRuntimePFvP8JSTracerPvES3_"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + #[link_name = "_Z23JS_SetGrayGCRootsTracerP9JSContextPFvP8JSTracerPvES3_"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "_Z23JS_FindCompilationScopeP9JSContextN2JS6HandleIP8JSObjectEE"] @@ -9371,8 +9410,8 @@ extern "C" { "_Z41JS_TraceObjectGroupCycleCollectorChildrenPN2JS14CallbackTracerENS_9GCCellPtrE"] pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); - #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSRuntimePFvijPKcE"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + #[link_name = "_Z33JS_SetAccumulateTelemetryCallbackP9JSContextPFvijPKcE"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "_Z21JS_GetIsSecureContextP13JSCompartment"] @@ -9607,8 +9646,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "_ZN2js8DumpHeapEP9JSRuntimeP6_iobufNS_24DumpHeapNurseryBehaviourE"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "_ZN2js8DumpHeapEP9JSContextP6_iobufNS_24DumpHeapNurseryBehaviourE"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "_ZN2js16obj_defineGetterEP9JSContextjPN2JS5ValueE"] pub fn obj_defineGetter(cx: *mut JSContext, argc: ::std::os::raw::c_uint, @@ -9626,8 +9665,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "_ZN2js13TraceWeakMapsEPNS_13WeakMapTracerE"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSRuntime"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "_ZN2js18AreGCGrayBitsValidEP9JSContext"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "_ZN2js21ZoneGlobalsAreAllGrayEPN2JS4ZoneE"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9757,8 +9796,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "_ZN2js26SetPreserveWrapperCallbackEP9JSRuntimePFbP9JSContextP8JSObjectE"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "_ZN2js26SetPreserveWrapperCallbackEP9JSContextPFbS1_P8JSObjectE"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "_ZN2js28IsObjectInContextCompartmentEP8JSObjectPK9JSContext"] @@ -9796,22 +9835,22 @@ extern "C" { * last active request ceases - and begins activity - when it was * idle and a request begins. */ - #[link_name = "_ZN2js19SetActivityCallbackEP9JSRuntimePFvPvbES2_"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + #[link_name = "_ZN2js19SetActivityCallbackEP9JSContextPFvPvbES2_"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); - #[link_name = "_ZN2js15SetDOMCallbacksEP9JSRuntimePKNS_14JSDOMCallbacksE"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + #[link_name = "_ZN2js15SetDOMCallbacksEP9JSContextPKNS_14JSDOMCallbacksE"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); - #[link_name = "_ZN2js15GetDOMCallbacksEP9JSRuntime"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + #[link_name = "_ZN2js15GetDOMCallbacksEP9JSContext"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "_ZN2js19GetTestingFunctionsEP9JSContext"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; /** * Get an error type name from a JSExnType constant. * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ - #[link_name = "_ZN2js16GetErrorTypeNameEP9JSRuntimes"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + #[link_name = "_ZN2js16GetErrorTypeNameEP9JSContexts"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "_ZN2js24GetEnterCompartmentDepthEP9JSContext"] pub fn GetEnterCompartmentDepth(cx: *mut JSContext) @@ -10377,8 +10416,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "_ZN2js28SetScriptEnvironmentPreparerEP9JSRuntimePNS_25ScriptEnvironmentPreparerE"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "_ZN2js28SetScriptEnvironmentPreparerEP9JSContextPNS_25ScriptEnvironmentPreparerE"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10386,8 +10425,8 @@ extern "C" { * calling into C. */ #[link_name = - "_ZN2js25SetCTypesActivityCallbackEP9JSRuntimePFvP9JSContextNS_18CTypesActivityTypeEE"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "_ZN2js25SetCTypesActivityCallbackEP9JSContextPFvS1_NS_18CTypesActivityTypeEE"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10484,8 +10523,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "_ZN2js19SetWindowProxyClassEP9JSRuntimePKNS_5ClassE"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "_ZN2js19SetWindowProxyClassEP9JSContextPKNS_5ClassE"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10576,6 +10615,9 @@ extern "C" { "_ZN2JS19OrdinaryToPrimitiveEP9JSContextNS_6HandleIP8JSObjectEE6JSTypeNS_13MutableHandleINS_5ValueEEE"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "_ZN2JS6detail25InitWithFailureDiagnosticEb"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10586,28 +10628,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "_Z7JS_Initv"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "_Z28JS_InitWithFailureDiagnosticv"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10638,25 +10658,25 @@ extern "C" { #[link_name = "_ZN2js32MemoryReportingSundriesThresholdEv"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "_ZN2JS19CollectRuntimeStatsEP9JSRuntimePNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "_ZN2JS19CollectRuntimeStatsEP9JSContextPNS_12RuntimeStatsEPNS_20ObjectPrivateVisitorEb"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSRuntime"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS20UserCompartmentCountEP9JSRuntime"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSRuntime"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "_ZN2JS12AddSizeOfTabEP9JSRuntimeNS_6HandleIP8JSObjectEEPFyPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "_ZN2JS22SystemCompartmentCountEP9JSContext"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS20UserCompartmentCountEP9JSContext"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "_ZN2JS19PeakSizeOfTemporaryEPK9JSContext"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "_ZN2JS12AddSizeOfTabEP9JSContextNS_6HandleIP8JSObjectEEPFyPKvEPNS_20ObjectPrivateVisitorEPNS_8TabSizesE"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "_ZN2JS14AddServoSizeOfEP9JSRuntimePFyPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "_ZN2JS14AddServoSizeOfEP9JSContextPFyPKvEPNS_20ObjectPrivateVisitorEPNS_10ServoSizesE"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } diff --git a/src/jsapi_windows_msvc14_64.rs b/src/jsapi_windows_msvc14_64.rs index 2a5478611..b67e55118 100644 --- a/src/jsapi_windows_msvc14_64.rs +++ b/src/jsapi_windows_msvc14_64.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; pub const JSITER_KEYVALUE: ::std::os::raw::c_uint = 4; @@ -309,8 +309,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -423,61 +428,27 @@ fn bindgen_test_layout_RootLists() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 16usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 32usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -486,6 +457,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -630,52 +604,52 @@ fn bindgen_test_layout_GCDescription() { } extern "C" { #[link_name = - "?formatSliceMessage@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@@Z"] - fn _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(this: + "?formatSliceMessage@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@@Z"] + fn _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; #[link_name = - "?formatSummaryMessage@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@@Z"] - fn _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(this: + "?formatSummaryMessage@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@@Z"] + fn _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; #[link_name = - "?formatJSON@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@_K@Z"] - fn _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___K_Z_(this: + "?formatJSON@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@_K@Z"] + fn _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSContext___K_Z_(this: *mut GCDescription, - rt: - *mut JSRuntime, + cx: + *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(&mut *self, - rt) + _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(&mut *self, + cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(&mut *self, - rt) + _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___K_Z_(&mut *self, - rt, + _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSContext___K_Z_(&mut *self, + cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -692,7 +666,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -789,6 +763,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -1152,6 +1131,12 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + #[link_name = "?finalize@ObjectPtr@JS@@QEAAXPEAUJSRuntime@@@Z"] + fn _finalize_ObjectPtr_JS__QEAAXPEAUJSRuntime___Z_(this: *mut ObjectPtr, + rt: *mut JSRuntime); + #[link_name = "?finalize@ObjectPtr@JS@@QEAAXPEAUJSContext@@@Z"] + fn _finalize_ObjectPtr_JS__QEAAXPEAUJSContext___Z_(this: *mut ObjectPtr, + cx: *mut JSContext); #[link_name = "?updateWeakPointerAfterGC@ObjectPtr@JS@@QEAAXXZ"] fn _updateWeakPointerAfterGC_ObjectPtr_JS__QEAAXXZ_(this: *mut ObjectPtr); #[link_name = "?trace@ObjectPtr@JS@@QEAAXPEAVJSTracer@@PEBD@Z"] @@ -1161,6 +1146,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _finalize_ObjectPtr_JS__QEAAXPEAUJSRuntime___Z_(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _finalize_ObjectPtr_JS__QEAAXPEAUJSContext___Z_(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _updateWeakPointerAfterGC_ObjectPtr_JS__QEAAXXZ_(&mut *self) @@ -1804,8 +1797,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2134,6 +2127,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(i32)] @@ -2274,6 +2274,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2291,7 +2292,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2594,12 +2595,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(i32)] @@ -2616,20 +2617,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2770,7 +2775,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -2978,13 +2983,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3009,7 +3014,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _extraWarnings_CompartmentBehaviors_JS__QEBA_NPEAUJSRuntime___Z_(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _extraWarnings_CompartmentBehaviors_JS__QEBA_NPEAUJSContext___Z_(&mut *self, + cx) } } /** @@ -3456,11 +3461,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 25usize], + pub _bindgen_opaque_blob: [u64; 24usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 200usize); + assert_eq!(::std::mem::size_of::() , 192usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3580,7 +3585,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3588,7 +3592,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } pub type WarningReporter = @@ -3643,9 +3647,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3894,6 +3898,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -3932,11 +3979,6 @@ fn bindgen_test_layout_PerformanceGroup() { assert_eq!(::std::mem::size_of::() , 64usize); assert_eq!(::std::mem::align_of::() , 8usize); } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -3972,11 +4014,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5463,7 +5519,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5550,11 +5606,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5653,21 +5709,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "?PrepareForFullGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "?PrepareForFullGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "?PrepareForIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?PrepareForIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "?IsGCScheduled@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsGCScheduled@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5684,67 +5740,67 @@ extern "C" { * the system. */ #[link_name = - "?GCForReason@JS@@YAXPEAUJSRuntime@@W4JSGCInvocationKind@@W4Reason@gcreason@1@@Z"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "?GCForReason@JS@@YAXPEAUJSContext@@W4JSGCInvocationKind@@W4Reason@gcreason@1@@Z"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "?StartIncrementalGC@JS@@YAXPEAUJSRuntime@@W4JSGCInvocationKind@@W4Reason@gcreason@1@_J@Z"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "?StartIncrementalGC@JS@@YAXPEAUJSContext@@W4JSGCInvocationKind@@W4Reason@gcreason@1@_J@Z"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "?IncrementalGCSlice@JS@@YAXPEAUJSRuntime@@W4Reason@gcreason@1@_J@Z"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "?IncrementalGCSlice@JS@@YAXPEAUJSContext@@W4Reason@gcreason@1@_J@Z"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "?FinishIncrementalGC@JS@@YAXPEAUJSRuntime@@W4Reason@gcreason@1@@Z"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "?FinishIncrementalGC@JS@@YAXPEAUJSContext@@W4Reason@gcreason@1@@Z"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "?AbortIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?AbortIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "?SetGCSliceCallback@JS@@YAP6AXPEAUJSRuntime@@W4GCProgress@1@AEBUGCDescription@1@@Z0P6AX012@Z@Z"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "?SetGCSliceCallback@JS@@YAP6AXPEAUJSContext@@W4GCProgress@1@AEBUGCDescription@1@@Z0P6AX012@Z@Z"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "?SetGCNurseryCollectionCallback@JS@@YAP6AXPEAUJSRuntime@@W4GCNurseryProgress@1@W4Reason@gcreason@1@@Z0P6AX012@Z@Z"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "?SetGCNurseryCollectionCallback@JS@@YAP6AXPEAUJSContext@@W4GCNurseryProgress@1@W4Reason@gcreason@1@@Z0P6AX012@Z@Z"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -5754,8 +5810,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "?DisableIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?DisableIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -5764,16 +5820,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "?IsIncrementalGCEnabled@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsIncrementalGCEnabled@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "?IsIncrementalGCInProgress@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "?IsIncrementalBarrierNeeded@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsIncrementalGCInProgress@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "?IsIncrementalBarrierNeeded@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "?IncrementalReferenceBarrier@JS@@YAXVGCCellPtr@1@@Z"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "?IncrementalValueBarrier@JS@@YAXAEBVValue@1@@Z"] @@ -5783,8 +5839,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "?WasIncrementalGC@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "?WasIncrementalGC@JS@@YA_NPEAUJSContext@@@Z"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -5799,23 +5855,16 @@ extern "C" { #[link_name = "?GetGCNumber@JS@@YA_KXZ"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "?ShrinkGCBuffers@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "?UnmarkGrayGCThingRecursively@JS@@YA_NVGCCellPtr@1@@Z"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "?PokeGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "?NotifyDidPaint@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "?PokeGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "?NotifyDidPaint@JS@@YAXPEAUJSContext@@@Z"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "?GCTraceKindToAscii@JS@@YAPEBDW4TraceKind@1@@Z"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -5885,9 +5934,10 @@ extern "C" { answer: *mut IsArrayAnswer) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "?JS_ReadStructuredClone@@YA_NPEAUJSContext@@PEA_K_KIV?$MutableHandle@VValue@JS@@@JS@@PEBUJSStructuredCloneCallbacks@@PEAX@Z"] + "?JS_ReadStructuredClone@@YA_NPEAUJSContext@@PEA_K_KIW4StructuredCloneScope@JS@@V?$MutableHandle@VValue@JS@@@3@PEBUJSStructuredCloneCallbacks@@PEAX@Z"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -5898,9 +5948,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "?JS_WriteStructuredClone@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@PEAPEA_KPEA_KPEBUJSStructuredCloneCallbacks@@PEAX1@Z"] + "?JS_WriteStructuredClone@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@PEAPEA_KPEA_KW4StructuredCloneScope@3@PEBUJSStructuredCloneCallbacks@@PEAX1@Z"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -5954,32 +6005,36 @@ extern "C" { "?JS_ObjectNotWritten@@YA_NPEAUJSStructuredCloneWriter@@V?$Handle@PEAVJSObject@@@JS@@@Z"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = + "?JS_GetStructuredCloneScope@@YA?AW4StructuredCloneScope@JS@@PEAUJSStructuredCloneWriter@@@Z"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "?JS_HoldPrincipals@@YAXPEAUJSPrincipals@@@Z"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); #[link_name = - "?JS_DropPrincipals@@YAXPEAUJSRuntime@@PEAUJSPrincipals@@@Z"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + "?JS_DropPrincipals@@YAXPEAUJSContext@@PEAUJSPrincipals@@@Z"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "?JS_SetSecurityCallbacks@@YAXPEAUJSRuntime@@PEBUJSSecurityCallbacks@@@Z"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "?JS_SetSecurityCallbacks@@YAXPEAUJSContext@@PEBUJSSecurityCallbacks@@@Z"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); #[link_name = - "?JS_GetSecurityCallbacks@@YAPEBUJSSecurityCallbacks@@PEAUJSRuntime@@@Z"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + "?JS_GetSecurityCallbacks@@YAPEBUJSSecurityCallbacks@@PEAUJSContext@@@Z"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; #[link_name = - "?JS_SetTrustedPrincipals@@YAXPEAUJSRuntime@@PEAUJSPrincipals@@@Z"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + "?JS_SetTrustedPrincipals@@YAXPEAUJSContext@@PEAUJSPrincipals@@@Z"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "?JS_InitDestroyPrincipalsCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSPrincipals@@@Z@Z"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "?JS_InitDestroyPrincipalsCallback@@YAXPEAUJSContext@@P6AXPEAUJSPrincipals@@@Z@Z"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "?JS_InitReadPrincipalsCallback@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@PEAUJSStructuredCloneReader@@PEAPEAUJSPrincipals@@@Z@Z"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "?JS_InitReadPrincipalsCallback@@YAXPEAUJSContext@@P6A_N0PEAUJSStructuredCloneReader@@PEAPEAUJSPrincipals@@@Z@Z"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = @@ -6011,8 +6066,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "?JS_GetEmptyStringValue@@YA?AVValue@JS@@PEAUJSContext@@@Z"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "?JS_GetEmptyString@@YAPEAVJSString@@PEAUJSRuntime@@@Z"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "?JS_GetEmptyString@@YAPEAVJSString@@PEAUJSContext@@@Z"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "?JS_ValueToObject@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@V?$MutableHandle@PEAVJSObject@@@3@@Z"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6053,11 +6108,11 @@ extern "C" { #[link_name = "?JS_IsBuiltinFunctionConstructor@@YA_NPEAVJSFunction@@@Z"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "?JS_NewRuntime@@YAPEAUJSRuntime@@IIPEAU1@@Z"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "?JS_DestroyRuntime@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "?JS_NewContext@@YAPEAUJSContext@@IIPEAU1@@Z"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "?JS_DestroyContext@@YAXPEAUJSContext@@@Z"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6074,28 +6129,20 @@ extern "C" { */ #[link_name = "?JS_GetCurrentEmbedderTime@@YANXZ"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "?JS_GetRuntimePrivate@@YAPEAXPEAUJSRuntime@@@Z"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "?JS_GetContextPrivate@@YAPEAXPEAUJSContext@@@Z"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "?JS_GetRuntime@@YAPEAUJSRuntime@@PEAUJSContext@@@Z"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "?JS_GetParentRuntime@@YAPEAUJSRuntime@@PEAU1@@Z"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "?JS_SetRuntimePrivate@@YAXPEAUJSRuntime@@PEAX@Z"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "?JS_SetContextPrivate@@YAXPEAUJSContext@@PEAX@Z"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "?JS_GetParentContext@@YAPEAUJSContext@@PEAU1@@Z"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "?JS_BeginRequest@@YAXPEAUJSContext@@@Z"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "?JS_EndRequest@@YAXPEAUJSContext@@@Z"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "?JS_SetFutexCanWait@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "?JS_GetContext@@YAPEAUJSContext@@PEAUJSRuntime@@@Z"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; + #[link_name = "?JS_SetFutexCanWait@@YAXPEAUJSContext@@@Z"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "?JS_GetVersion@@YA?AW4JSVersion@@PEAUJSContext@@@Z"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6117,11 +6164,8 @@ extern "C" { pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; #[link_name = - "?RuntimeOptionsRef@JS@@YAAEAVRuntimeOptions@1@PEAUJSRuntime@@@Z"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = - "?RuntimeOptionsRef@JS@@YAAEAVRuntimeOptions@1@PEAUJSContext@@@Z"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + "?ContextOptionsRef@JS@@YAAEAVContextOptions@1@PEAUJSContext@@@Z"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6129,33 +6173,40 @@ extern "C" { */ #[link_name = "?InitSelfHostedCode@JS@@YA_NPEAUJSContext@@@Z"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = + "?AssertObjectBelongsToCurrentThread@JS@@YAXPEAVJSObject@@@Z"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "?JS_GetImplementationVersion@@YAPEBDXZ"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "?JS_SetDestroyCompartmentCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSFreeOp@@PEAUJSCompartment@@@Z@Z"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "?JS_SetDestroyCompartmentCallback@@YAXPEAUJSContext@@P6AXPEAUJSFreeOp@@PEAUJSCompartment@@@Z@Z"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "?JS_SetSizeOfIncludingThisCompartmentCallback@@YAXPEAUJSRuntime@@P6A_KP6A_KPEBX@ZPEAUJSCompartment@@@Z@Z"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "?JS_SetSizeOfIncludingThisCompartmentCallback@@YAXPEAUJSContext@@P6A_KP6A_KPEBX@ZPEAUJSCompartment@@@Z@Z"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); #[link_name = - "?JS_SetDestroyZoneCallback@@YAXPEAUJSRuntime@@P6AXPEAUZone@JS@@@Z@Z"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + "?JS_SetDestroyZoneCallback@@YAXPEAUJSContext@@P6AXPEAUZone@JS@@@Z@Z"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "?JS_SetSweepZoneCallback@@YAXPEAUJSRuntime@@P6AXPEAUZone@JS@@@Z@Z"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + "?JS_SetSweepZoneCallback@@YAXPEAUJSContext@@P6AXPEAUZone@JS@@@Z@Z"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "?JS_SetCompartmentNameCallback@@YAXPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAD_K@Z@Z"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "?JS_SetCompartmentNameCallback@@YAXPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAD_K@Z@Z"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "?JS_SetWrapObjectCallbacks@@YAXPEAUJSRuntime@@PEBUJSWrapObjectCallbacks@@@Z"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "?JS_SetWrapObjectCallbacks@@YAXPEAUJSContext@@PEBUJSWrapObjectCallbacks@@@Z"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "?JS_SetCompartmentPrivate@@YAXPEAUJSCompartment@@PEAX@Z"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6199,8 +6250,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "?JS_IterateCompartments@@YAXPEAUJSRuntime@@PEAXP6AX01PEAUJSCompartment@@@Z@Z"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "?JS_IterateCompartments@@YAXPEAUJSContext@@PEAXP6AX01PEAUJSCompartment@@@Z@Z"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6369,8 +6420,6 @@ extern "C" { */ #[link_name = "?JS_freeop@@YAXPEAUJSFreeOp@@PEAX@Z"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "?JS_GetDefaultFreeOp@@YAPEAUJSFreeOp@@PEAUJSRuntime@@@Z"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "?JS_updateMallocCounter@@YAXPEAUJSContext@@_K@Z"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "?JS_strdup@@YAPEADPEAUJSContext@@PEBD@Z"] @@ -6384,66 +6433,66 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "?JS_AddExtraGCRootsTracer@@YA_NPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "?JS_AddExtraGCRootsTracer@@YA_NPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "?JS_RemoveExtraGCRootsTracer@@YAXPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "?JS_RemoveExtraGCRootsTracer@@YAXPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "?JS_GC@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "?JS_GC@@YAXPEAUJSContext@@@Z"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "?JS_MaybeGC@@YAXPEAUJSContext@@@Z"] pub fn JS_MaybeGC(cx: *mut JSContext); #[link_name = - "?JS_SetGCCallback@@YAXPEAUJSRuntime@@P6AX0W4JSGCStatus@@PEAX@Z2@Z"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + "?JS_SetGCCallback@@YAXPEAUJSContext@@P6AX0W4JSGCStatus@@PEAX@Z2@Z"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?JS_SetObjectsTenuredCallback@@YAXPEAUJSRuntime@@P6AX0PEAX@Z1@Z"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + "?JS_SetObjectsTenuredCallback@@YAXPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?JS_AddFinalizeCallback@@YA_NPEAUJSRuntime@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z4@Z"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "?JS_AddFinalizeCallback@@YA_NPEAUJSContext@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z4@Z"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveFinalizeCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z@Z"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "?JS_RemoveFinalizeCallback@@YAXPEAUJSContext@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z@Z"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "?JS_AddWeakPointerZoneGroupCallback@@YA_NPEAUJSRuntime@@P6AX0PEAX@Z1@Z"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "?JS_AddWeakPointerZoneGroupCallback@@YA_NPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveWeakPointerZoneGroupCallback@@YAXPEAUJSRuntime@@P6AX0PEAX@Z@Z"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "?JS_RemoveWeakPointerZoneGroupCallback@@YAXPEAUJSContext@@P6AX0PEAX@Z@Z"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "?JS_AddWeakPointerCompartmentCallback@@YA_NPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAX@Z2@Z"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "?JS_AddWeakPointerCompartmentCallback@@YA_NPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAX@Z2@Z"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveWeakPointerCompartmentCallback@@YAXPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAX@Z@Z"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "?JS_RemoveWeakPointerCompartmentCallback@@YAXPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAX@Z@Z"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = @@ -6452,14 +6501,14 @@ extern "C" { #[link_name = "?JS_UpdateWeakPointerAfterGCUnbarriered@@YAXPEAPEAVJSObject@@@Z"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "?JS_SetGCParameter@@YAXPEAUJSRuntime@@W4JSGCParamKey@@I@Z"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "?JS_SetGCParameter@@YAXPEAUJSContext@@W4JSGCParamKey@@I@Z"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "?JS_GetGCParameter@@YAIPEAUJSRuntime@@W4JSGCParamKey@@@Z"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; + #[link_name = "?JS_GetGCParameter@@YAIPEAUJSContext@@W4JSGCParamKey@@@Z"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; #[link_name = - "?JS_SetGCParametersBasedOnAvailableMemory@@YAXPEAUJSRuntime@@I@Z"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + "?JS_SetGCParametersBasedOnAvailableMemory@@YAXPEAUJSContext@@I@Z"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6502,8 +6551,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "?JS_SetNativeStackQuota@@YAXPEAUJSRuntime@@_K11@Z"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "?JS_SetNativeStackQuota@@YAXPEAUJSContext@@_K11@Z"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6581,6 +6630,10 @@ extern "C" { "?JS_HasInstance@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@V?$Handle@VValue@JS@@@3@PEA_N@Z"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "?OrdinaryHasInstance@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@V?$Handle@VValue@JS@@@1@PEA_N@Z"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "?JS_GetPrivate@@YAPEAXPEAVJSObject@@@Z"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "?JS_SetPrivate@@YAXPEAVJSObject@@PEAX@Z"] @@ -6649,8 +6702,6 @@ extern "C" { -> *mut JSObject; #[link_name = "?JS_IsNative@@YA_NPEAVJSObject@@@Z"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "?JS_GetObjectRuntime@@YAPEAUJSRuntime@@PEAVJSObject@@@Z"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7533,6 +7584,11 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "?JS_IsFunctionBound@@YA_NPEAVJSFunction@@@Z"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = + "?JS_GetBoundFunctionTarget@@YAPEAVJSObject@@PEAVJSFunction@@@Z"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7679,10 +7735,13 @@ extern "C" { callbackData: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?FinishOffThreadScript@JS@@YAPEAVJSScript@@PEAUJSContext@@PEAUJSRuntime@@PEAX@Z"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + "?FinishOffThreadScript@JS@@YAPEAVJSScript@@PEAUJSContext@@PEAX@Z"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "?CancelOffThreadScript@JS@@YAXPEAUJSContext@@PEAX@Z"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "?CompileOffThreadModule@JS@@YA_NPEAUJSContext@@AEBVReadOnlyCompileOptions@1@PEB_S_KP6AXPEAX4@Z4@Z"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7693,10 +7752,13 @@ extern "C" { callbackData: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?FinishOffThreadModule@JS@@YAPEAVJSObject@@PEAUJSContext@@PEAUJSRuntime@@PEAX@Z"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + "?FinishOffThreadModule@JS@@YAPEAVJSObject@@PEAUJSContext@@PEAX@Z"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "?CancelOffThreadModule@JS@@YAXPEAUJSContext@@PEAX@Z"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -7786,9 +7848,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "?CloneAndExecuteScript@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSScript@@@1@@Z"] + "?CloneAndExecuteScript@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSScript@@@1@V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -7901,15 +7964,26 @@ extern "C" { #[link_name = "?JS_CheckForInterrupt@@YA_NPEAUJSContext@@@Z"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; #[link_name = - "?JS_SetInterruptCallback@@YAP6A_NPEAUJSContext@@@ZPEAUJSRuntime@@P6A_N0@Z@Z"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + "?JS_SetInterruptCallback@@YAP6A_NPEAUJSContext@@@Z0P6A_N0@Z@Z"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; + #[link_name = "?JS_GetInterruptCallback@@YAP6A_NPEAUJSContext@@@Z0@Z"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "?JS_RequestInterruptCallback@@YAXPEAUJSContext@@@Z"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ #[link_name = - "?JS_GetInterruptCallback@@YAP6A_NPEAUJSContext@@@ZPEAUJSRuntime@@@Z"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "?JS_RequestInterruptCallback@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + "?SetGetIncumbentGlobalCallback@JS@@YAXPEAUJSContext@@P6APEAVJSObject@@0@Z@Z"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -7920,8 +7994,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "?SetEnqueuePromiseJobCallback@JS@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@2PEAX@Z3@Z"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "?SetEnqueuePromiseJobCallback@JS@@YAXPEAUJSContext@@P6A_N0V?$Handle@PEAVJSObject@@@1@11PEAX@Z2@Z"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -7930,8 +8004,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "?SetPromiseRejectionTrackerCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@W4PromiseRejectionHandlingState@@PEAX@Z4@Z"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "?SetPromiseRejectionTrackerCallback@JS@@YAXPEAUJSContext@@P6AX0V?$Handle@PEAVJSObject@@@1@W4PromiseRejectionHandlingState@@PEAX@Z3@Z"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8427,29 +8501,29 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "?JS_SetDefaultLocale@@YA_NPEAUJSRuntime@@PEBD@Z"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "?JS_SetDefaultLocale@@YA_NPEAUJSContext@@PEBD@Z"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "?JS_ResetDefaultLocale@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "?JS_ResetDefaultLocale@@YAXPEAUJSContext@@@Z"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ #[link_name = - "?JS_SetLocaleCallbacks@@YAXPEAUJSRuntime@@PEBUJSLocaleCallbacks@@@Z"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + "?JS_SetLocaleCallbacks@@YAXPEAUJSContext@@PEBUJSLocaleCallbacks@@@Z"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ #[link_name = - "?JS_GetLocaleCallbacks@@YAPEBUJSLocaleCallbacks@@PEAUJSRuntime@@@Z"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + "?JS_GetLocaleCallbacks@@YAPEBUJSLocaleCallbacks@@PEAUJSContext@@@Z"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8518,12 +8592,12 @@ extern "C" { #[link_name = "?JS_ReportAllocationOverflow@@YAXPEAUJSContext@@@Z"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "?SetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@ZPEAUJSRuntime@@P6AX012@Z@Z"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "?SetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@Z0P6AX012@Z@Z"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; #[link_name = - "?GetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@ZPEAUJSRuntime@@@Z"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + "?GetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@Z0@Z"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "?CreateError@JS@@YA_NPEAUJSContext@@W4JSExnType@@V?$Handle@PEAVJSObject@@@1@V?$Handle@PEAVJSString@@@1@IIPEAVJSErrorReport@@3V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8744,16 +8818,16 @@ extern "C" { #[link_name = "?JS_GetCurrentThread@@YA_JXZ"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "?JS_AbortIfWrongThread@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "?JS_AbortIfWrongThread@@YAXPEAUJSContext@@@Z"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8764,20 +8838,20 @@ extern "C" { pub fn JS_NewObjectForConstructor(cx: *mut JSContext, clasp: *const JSClass, args: *const CallArgs) -> *mut JSObject; - #[link_name = "?JS_SetParallelParsingEnabled@@YAXPEAUJSRuntime@@_N@Z"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); + #[link_name = "?JS_SetParallelParsingEnabled@@YAXPEAUJSContext@@_N@Z"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "?JS_SetOffthreadIonCompilationEnabled@@YAXPEAUJSRuntime@@_N@Z"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + "?JS_SetOffthreadIonCompilationEnabled@@YAXPEAUJSContext@@_N@Z"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "?JS_SetGlobalJitCompilerOption@@YAXPEAUJSRuntime@@W4JSJitCompilerOption@@I@Z"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "?JS_SetGlobalJitCompilerOption@@YAXPEAUJSContext@@W4JSJitCompilerOption@@I@Z"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "?JS_GetGlobalJitCompilerOption@@YAHPEAUJSRuntime@@W4JSJitCompilerOption@@@Z"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "?JS_GetGlobalJitCompilerOption@@YAHPEAUJSContext@@W4JSJitCompilerOption@@@Z"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -8865,34 +8939,46 @@ extern "C" { data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; #[link_name = - "?SetAsmJSCacheOps@JS@@YAXPEAUJSRuntime@@PEBUAsmJSCacheOps@1@@Z"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + "?SetAsmJSCacheOps@JS@@YAXPEAUJSContext@@PEBUAsmJSCacheOps@1@@Z"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "?SetBuildIdOp@JS@@YAXPEAUJSRuntime@@P6A_NPEAV?$Vector@D$0A@VSystemAllocPolicy@js@@@mozilla@@@Z@Z"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "?SetBuildIdOp@JS@@YAXPEAUJSContext@@P6A_NPEAV?$Vector@D$0A@VSystemAllocPolicy@js@@@mozilla@@@Z@Z"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "?SetLargeAllocationFailureCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAX@Z1@Z"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "?SetLargeAllocationFailureCallback@JS@@YAXPEAUJSContext@@P6AXPEAX@Z1@Z"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?SetOutOfMemoryCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@PEAX@Z2@Z"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + "?SetOutOfMemoryCallback@JS@@YAXPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "?CaptureCurrentStack@JS@@YA_NPEAUJSContext@@V?$MutableHandle@PEAVJSObject@@@1@I@Z"] + "?CaptureCurrentStack@JS@@YA_NPEAUJSContext@@V?$MutableHandle@PEAVJSObject@@@1@$$QEAV?$Variant@UAllFrames@JS@@UMaxFrames@2@UFirstSubsumedFrame@2@@mozilla@@@Z"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "?CopyAsyncStack@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@V?$Handle@PEAVJSString@@@1@V?$MutableHandle@PEAVJSObject@@@1@I@Z"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9001,18 +9087,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "?FlushPerformanceMonitoring@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "?FlushPerformanceMonitoring@js@@YA_NPEAUJSContext@@@Z"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "?ResetPerformanceMonitoring@js@@YAXPEAUJSRuntime@@@Z"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "?ResetPerformanceMonitoring@js@@YAXPEAUJSContext@@@Z"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "?DisposePerformanceMonitoring@js@@YAXPEAUJSRuntime@@@Z"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "?DisposePerformanceMonitoring@js@@YAXPEAUJSContext@@@Z"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9020,43 +9106,35 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "?SetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSRuntime@@_N@Z"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "?SetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSContext@@_N@Z"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "?GetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "?SetStopwatchIsMonitoringJank@js@@YA_NPEAUJSRuntime@@_N@Z"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "?GetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSContext@@@Z"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "?SetStopwatchIsMonitoringJank@js@@YA_NPEAUJSContext@@_N@Z"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "?GetStopwatchIsMonitoringJank@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "?IsStopwatchActive@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "?GetStopwatchIsMonitoringJank@js@@YA_NPEAUJSContext@@@Z"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "?GetPerfMonitoringTestCpuRescheduling@js@@YAXPEAUJSRuntime@@PEA_K1@Z"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "?GetPerfMonitoringTestCpuRescheduling@js@@YAXPEAUJSContext@@PEA_K1@Z"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "?AddCPOWPerformanceDelta@js@@YAXPEAUJSRuntime@@_K@Z"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = - "?SetStopwatchStartCallback@js@@YA_NPEAUJSRuntime@@P6A_N_KPEAX@Z2@Z"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "?AddCPOWPerformanceDelta@js@@YAXPEAUJSContext@@_K@Z"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "?CallMethodIfWrapped@detail@JS@@YA_NPEAUJSContext@@P6A_NV?$Handle@VValue@JS@@@2@@ZP6A_N0AEBVCallArgs@2@@Z3@Z"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; #[link_name = - "?JS_SetGrayGCRootsTracer@@YAXPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + "?JS_SetGrayGCRootsTracer@@YAXPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "?JS_FindCompilationScope@@YAPEAVJSObject@@PEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@@Z"] @@ -9127,8 +9205,8 @@ extern "C" { pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); #[link_name = - "?JS_SetAccumulateTelemetryCallback@@YAXPEAUJSRuntime@@P6AXHIPEBD@Z@Z"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + "?JS_SetAccumulateTelemetryCallback@@YAXPEAUJSContext@@P6AXHIPEBD@Z@Z"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "?JS_GetIsSecureContext@@YA_NPEAUJSCompartment@@@Z"] @@ -9328,8 +9406,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "?DumpHeap@js@@YAXPEAUJSRuntime@@PEAU_iobuf@@W4DumpHeapNurseryBehaviour@1@@Z"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "?DumpHeap@js@@YAXPEAUJSContext@@PEAU_iobuf@@W4DumpHeapNurseryBehaviour@1@@Z"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "?obj_defineGetter@js@@YA_NPEAUJSContext@@IPEAVValue@JS@@@Z"] @@ -9349,8 +9427,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "?TraceWeakMaps@js@@YAXPEAUWeakMapTracer@1@@Z"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "?AreGCGrayBitsValid@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "?AreGCGrayBitsValid@js@@YA_NPEAUJSContext@@@Z"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "?ZoneGlobalsAreAllGray@js@@YA_NPEAUZone@JS@@@Z"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9483,8 +9561,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "?SetPreserveWrapperCallback@js@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@PEAVJSObject@@@Z@Z"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "?SetPreserveWrapperCallback@js@@YAXPEAUJSContext@@P6A_N0PEAVJSObject@@@Z@Z"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "?IsObjectInContextCompartment@js@@YA_NPEAVJSObject@@PEBUJSContext@@@Z"] @@ -9525,16 +9603,16 @@ extern "C" { * idle and a request begins. */ #[link_name = - "?SetActivityCallback@js@@YAXPEAUJSRuntime@@P6AXPEAX_N@Z1@Z"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + "?SetActivityCallback@js@@YAXPEAUJSContext@@P6AXPEAX_N@Z1@Z"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); #[link_name = - "?SetDOMCallbacks@js@@YAXPEAUJSRuntime@@PEBUJSDOMCallbacks@1@@Z"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + "?SetDOMCallbacks@js@@YAXPEAUJSContext@@PEBUJSDOMCallbacks@1@@Z"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); #[link_name = - "?GetDOMCallbacks@js@@YAPEBUJSDOMCallbacks@1@PEAUJSRuntime@@@Z"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + "?GetDOMCallbacks@js@@YAPEBUJSDOMCallbacks@1@PEAUJSContext@@@Z"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "?GetTestingFunctions@js@@YAPEAVJSObject@@PEAUJSContext@@@Z"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; @@ -9543,8 +9621,8 @@ extern "C" { * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ #[link_name = - "?GetErrorTypeName@js@@YAPEAVJSFlatString@@PEAUJSRuntime@@F@Z"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + "?GetErrorTypeName@js@@YAPEAVJSFlatString@@PEAUJSContext@@F@Z"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "?RegExpToSharedNonInline@js@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@PEAVRegExpGuard@1@@Z"] @@ -10118,8 +10196,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "?SetScriptEnvironmentPreparer@js@@YAXPEAUJSRuntime@@PEAUScriptEnvironmentPreparer@1@@Z"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "?SetScriptEnvironmentPreparer@js@@YAXPEAUJSContext@@PEAUScriptEnvironmentPreparer@1@@Z"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10127,8 +10205,8 @@ extern "C" { * calling into C. */ #[link_name = - "?SetCTypesActivityCallback@js@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@W4CTypesActivityType@1@@Z@Z"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "?SetCTypesActivityCallback@js@@YAXPEAUJSContext@@P6AX0W4CTypesActivityType@1@@Z@Z"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10226,8 +10304,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "?SetWindowProxyClass@js@@YAXPEAUJSRuntime@@PEBUClass@1@@Z"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "?SetWindowProxyClass@js@@YAXPEAUJSContext@@PEBUClass@1@@Z"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10312,6 +10390,9 @@ extern "C" { "?OrdinaryToPrimitive@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@W4JSType@@V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "?InitWithFailureDiagnostic@detail@JS@@YAPEBD_N@Z"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10323,28 +10404,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "?JS_Init@@YA_NXZ"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "?JS_InitWithFailureDiagnostic@@YAPEBDXZ"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10375,25 +10434,25 @@ extern "C" { #[link_name = "?MemoryReportingSundriesThreshold@js@@YA_KXZ"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "?CollectRuntimeStats@JS@@YA_NPEAUJSRuntime@@PEAURuntimeStats@1@PEAVObjectPrivateVisitor@1@_N@Z"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "?CollectRuntimeStats@JS@@YA_NPEAUJSContext@@PEAURuntimeStats@1@PEAVObjectPrivateVisitor@1@_N@Z"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "?SystemCompartmentCount@JS@@YA_KPEAUJSRuntime@@@Z"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "?UserCompartmentCount@JS@@YA_KPEAUJSRuntime@@@Z"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "?PeakSizeOfTemporary@JS@@YA_KPEBUJSRuntime@@@Z"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "?AddSizeOfTab@JS@@YA_NPEAUJSRuntime@@V?$Handle@PEAVJSObject@@@1@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUTabSizes@1@@Z"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "?SystemCompartmentCount@JS@@YA_KPEAUJSContext@@@Z"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "?UserCompartmentCount@JS@@YA_KPEAUJSContext@@@Z"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "?PeakSizeOfTemporary@JS@@YA_KPEBUJSContext@@@Z"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "?AddSizeOfTab@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUTabSizes@1@@Z"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "?AddServoSizeOf@JS@@YA_NPEAUJSRuntime@@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUServoSizes@1@@Z"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "?AddServoSizeOf@JS@@YA_NPEAUJSContext@@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUServoSizes@1@@Z"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; } diff --git a/src/jsapi_windows_msvc14_64_debug.rs b/src/jsapi_windows_msvc14_64_debug.rs index dbdc5368a..8c3dfc8af 100644 --- a/src/jsapi_windows_msvc14_64_debug.rs +++ b/src/jsapi_windows_msvc14_64_debug.rs @@ -31,7 +31,7 @@ pub const JSCLASS_RESERVED_SLOTS_SHIFT: ::std::os::raw::c_uint = 8; pub const JSCLASS_RESERVED_SLOTS_WIDTH: ::std::os::raw::c_uint = 8; pub const JSCLASS_GLOBAL_APPLICATION_SLOTS: ::std::os::raw::c_uint = 5; pub const JSCLASS_NO_OPTIONAL_MEMBERS: ::std::os::raw::c_uint = 0; -pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 6; +pub const JS_STRUCTURED_CLONE_VERSION: ::std::os::raw::c_uint = 7; pub const JS_SCERR_RECURSION: ::std::os::raw::c_uint = 0; pub const JS_SCERR_TRANSFERABLE: ::std::os::raw::c_uint = 1; pub const JS_SCERR_DUP_TRANSFERABLE: ::std::os::raw::c_uint = 2; @@ -58,7 +58,7 @@ pub const JSREPORT_ERROR: ::std::os::raw::c_uint = 0; pub const JSREPORT_WARNING: ::std::os::raw::c_uint = 1; pub const JSREPORT_EXCEPTION: ::std::os::raw::c_uint = 2; pub const JSREPORT_STRICT: ::std::os::raw::c_uint = 4; -pub const JSREPORT_STRICT_MODE_ERROR: ::std::os::raw::c_uint = 8; +pub const JSREPORT_USER_1: ::std::os::raw::c_uint = 8; pub const JS_DEFAULT_ZEAL_FREQ: ::std::os::raw::c_uint = 100; pub const JSITER_ENUMERATE: ::std::os::raw::c_uint = 1; pub const JSITER_FOREACH: ::std::os::raw::c_uint = 2; @@ -310,8 +310,13 @@ pub enum JSProtoKey { JSProto_Atomics = 45, JSProto_SavedFrame = 46, JSProto_Wasm = 47, - JSProto_Promise = 48, - JSProto_LIMIT = 49, + JSProto_WebAssembly = 48, + JSProto_WasmModule = 49, + JSProto_WasmInstance = 50, + JSProto_WasmMemory = 51, + JSProto_WasmTable = 52, + JSProto_Promise = 53, + JSProto_LIMIT = 54, } pub enum JSCompartment { } pub enum JSCrossCompartmentCall { } @@ -424,62 +429,27 @@ fn bindgen_test_layout_RootLists() { assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] -pub struct ContextFriendFields { - pub runtime_: *mut JSRuntime, - pub compartment_: *mut JSCompartment, - pub zone_: *mut Zone, +pub struct RootingContext { pub roots: RootLists, } #[test] -fn bindgen_test_layout_ContextFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_RootingContext() { + assert_eq!(::std::mem::size_of::() , 392usize); + assert_eq!(::std::mem::align_of::() , 8usize); } -pub enum PerThreadData { } #[repr(C)] -pub struct PerThreadDataFriendFields { - pub roots: RootLists, +pub struct ContextFriendFields { + pub _base: RootingContext, + pub compartment_: *mut JSCompartment, + pub zone_: *mut Zone, pub nativeStackLimit: [usize; 3usize], } -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy { - pub _base: Runtime, - pub mainThread: PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy, -} -#[repr(C)] -#[derive(Debug, Copy)] -pub struct PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - pub field1: *mut ::std::os::raw::c_void, - pub field2: usize, - pub field3: u64, -} -impl ::std::clone::Clone for - PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy { - fn clone(&self) -> Self { *self } -} #[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy_PerThreadDummy() { - assert_eq!(::std::mem::size_of::() - , 24usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -impl ::std::clone::Clone for PerThreadDataFriendFields_RuntimeDummy { - fn clone(&self) -> Self { *self } -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields_RuntimeDummy() { - assert_eq!(::std::mem::size_of::() - , 40usize); - assert_eq!(::std::mem::align_of::() - , 8usize); -} -#[test] -fn bindgen_test_layout_PerThreadDataFriendFields() { - assert_eq!(::std::mem::size_of::() , 416usize); - assert_eq!(::std::mem::align_of::() , 8usize); +fn bindgen_test_layout_ContextFriendFields() { + assert_eq!(::std::mem::size_of::() , 432usize); + assert_eq!(::std::mem::align_of::() , 8usize); } +pub enum PRFileDesc { } #[repr(C)] #[derive(Debug, Copy)] pub struct MallocAllocPolicy; @@ -488,6 +458,9 @@ impl ::std::clone::Clone for MallocAllocPolicy { } pub enum VectorTesting { } pub enum Cell { } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ChunkLocation { Invalid = 0, Nursery = 1, TenuredHeap = 2, } #[repr(C)] pub struct Zone { pub runtime_: *mut JSRuntime, @@ -632,52 +605,52 @@ fn bindgen_test_layout_GCDescription() { } extern "C" { #[link_name = - "?formatSliceMessage@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@@Z"] - fn _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(this: + "?formatSliceMessage@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@@Z"] + fn _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; #[link_name = - "?formatSummaryMessage@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@@Z"] - fn _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(this: + "?formatSummaryMessage@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@@Z"] + fn _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(this: *mut GCDescription, - rt: - *mut JSRuntime) + cx: + *mut JSContext) -> *mut ::std::os::raw::c_ushort; #[link_name = - "?formatJSON@GCDescription@JS@@QEBAPEA_SPEAUJSRuntime@@_K@Z"] - fn _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___K_Z_(this: + "?formatJSON@GCDescription@JS@@QEBAPEA_SPEAUJSContext@@_K@Z"] + fn _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSContext___K_Z_(this: *mut GCDescription, - rt: - *mut JSRuntime, + cx: + *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort; } impl GCDescription { #[inline] - pub unsafe fn formatSliceMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSliceMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(&mut *self, - rt) + _formatSliceMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(&mut *self, + cx) } #[inline] - pub unsafe fn formatSummaryMessage(&mut self, rt: *mut JSRuntime) + pub unsafe fn formatSummaryMessage(&mut self, cx: *mut JSContext) -> *mut ::std::os::raw::c_ushort { - _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___Z_(&mut *self, - rt) + _formatSummaryMessage_GCDescription_JS__QEBAPEA_SPEAUJSContext___Z_(&mut *self, + cx) } #[inline] - pub unsafe fn formatJSON(&mut self, rt: *mut JSRuntime, timestamp: u64) + pub unsafe fn formatJSON(&mut self, cx: *mut JSContext, timestamp: u64) -> *mut ::std::os::raw::c_ushort { - _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSRuntime___K_Z_(&mut *self, - rt, + _formatJSON_GCDescription_JS__QEBAPEA_SPEAUJSContext___K_Z_(&mut *self, + cx, timestamp) } } pub type GCSliceCallback = - ::std::option::Option; /** @@ -694,7 +667,7 @@ pub enum GCNurseryProgress { * and the reason for the collection. */ pub type GCNurseryCollectionCallback = - ::std::option::Option; /** Ensure that generational GC is disabled within some scope. */ @@ -812,6 +785,11 @@ impl ::std::clone::Clone for CStringHasher { } #[repr(C)] #[derive(Debug, Copy, Clone)] +pub struct FallibleHashMethods { + pub _phantom0: ::std::marker::PhantomData, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] pub struct HashMapEntry { pub key_: Key, pub value_: Value, @@ -1175,6 +1153,12 @@ fn bindgen_test_layout_ObjectPtr() { assert_eq!(::std::mem::align_of::() , 8usize); } extern "C" { + #[link_name = "?finalize@ObjectPtr@JS@@QEAAXPEAUJSRuntime@@@Z"] + fn _finalize_ObjectPtr_JS__QEAAXPEAUJSRuntime___Z_(this: *mut ObjectPtr, + rt: *mut JSRuntime); + #[link_name = "?finalize@ObjectPtr@JS@@QEAAXPEAUJSContext@@@Z"] + fn _finalize_ObjectPtr_JS__QEAAXPEAUJSContext___Z_(this: *mut ObjectPtr, + cx: *mut JSContext); #[link_name = "?updateWeakPointerAfterGC@ObjectPtr@JS@@QEAAXXZ"] fn _updateWeakPointerAfterGC_ObjectPtr_JS__QEAAXXZ_(this: *mut ObjectPtr); #[link_name = "?trace@ObjectPtr@JS@@QEAAXPEAVJSTracer@@PEBD@Z"] @@ -1184,6 +1168,14 @@ extern "C" { *const ::std::os::raw::c_char); } impl ObjectPtr { + #[inline] + pub unsafe fn finalize(&mut self, rt: *mut JSRuntime) { + _finalize_ObjectPtr_JS__QEAAXPEAUJSRuntime___Z_(&mut *self, rt) + } + #[inline] + pub unsafe fn finalize1(&mut self, cx: *mut JSContext) { + _finalize_ObjectPtr_JS__QEAAXPEAUJSContext___Z_(&mut *self, cx) + } #[inline] pub unsafe fn updateWeakPointerAfterGC(&mut self) { _updateWeakPointerAfterGC_ObjectPtr_JS__QEAAXXZ_(&mut *self) @@ -1862,8 +1854,8 @@ pub type JSHasInstanceOp = /** * Function type for trace operation of the class called to enumerate all * traceable things reachable from obj's private data structure. For each such - * thing, a trace implementation must call one of the JS_Call*Tracer variants - * on the thing. + * thing, a trace implementation must call JS::TraceEdge on the thing's + * location. * * JSTraceOp implementation can assume that no other threads mutates object * state. It must not change state of the object or corresponding native @@ -2192,6 +2184,13 @@ pub enum ESClass { Error = 15, Other = 16, } +#[repr(i32)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum StructuredCloneScope { + SameProcessSameThread = 0, + SameProcessDifferentThread = 1, + DifferentProcess = 2, +} pub const SCTAG_TMO_ALLOC_DATA: TransferableOwnership = TransferableOwnership::SCTAG_TMO_FIRST_OWNED; #[repr(i32)] @@ -2332,6 +2331,7 @@ fn bindgen_test_layout_JSStructuredCloneCallbacks() { #[repr(C)] #[derive(Debug)] pub struct JSAutoStructuredCloneBuffer { + pub scope_: StructuredCloneScope, pub data_: *mut u64, pub nbytes_: usize, pub version_: u32, @@ -2349,7 +2349,7 @@ pub enum JSAutoStructuredCloneBuffer_StructuredClone_h_unnamed_7 { #[test] fn bindgen_test_layout_JSAutoStructuredCloneBuffer() { assert_eq!(::std::mem::size_of::() , - 40usize); + 48usize); assert_eq!(::std::mem::align_of::() , 8usize); } @@ -2663,12 +2663,12 @@ fn bindgen_test_layout_JSFreeOp() { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum JSGCStatus { JSGC_BEGIN = 0, JSGC_END = 1, } pub type JSGCCallback = - ::std::option::Option; pub type JSObjectsTenuredCallback = - ::std::option::Option; #[repr(i32)] @@ -2685,20 +2685,24 @@ pub type JSFinalizeCallback = data: *mut ::std::os::raw::c_void)>; pub type JSWeakPointerZoneGroupCallback = - ::std::option::Option; pub type JSWeakPointerCompartmentCallback = - ::std::option::Option; pub type JSInterruptCallback = ::std::option::Option bool>; +pub type JSGetIncumbentGlobalCallback = + ::std::option::Option *mut JSObject>; pub type JSEnqueuePromiseJobCallback = ::std::option::Option bool>; @@ -2839,7 +2843,7 @@ pub type JSSizeOfIncludingThisCompartmentCallback = pub type JSZoneCallback = ::std::option::Option; pub type JSCompartmentNameCallback = - ::std::option::Option u8 { (self._bitfield_1 & (1usize as u8)) >> 0usize @@ -3047,13 +3051,13 @@ impl RuntimeOptions { ((extraWarnings_ as u8) << 5u32) } } -impl ::std::clone::Clone for RuntimeOptions { +impl ::std::clone::Clone for ContextOptions { fn clone(&self) -> Self { *self } } #[test] -fn bindgen_test_layout_RuntimeOptions() { - assert_eq!(::std::mem::size_of::() , 2usize); - assert_eq!(::std::mem::align_of::() , 1usize); +fn bindgen_test_layout_ContextOptions() { + assert_eq!(::std::mem::size_of::() , 2usize); + assert_eq!(::std::mem::align_of::() , 1usize); } #[repr(C)] #[derive(Debug)] @@ -3078,7 +3082,7 @@ fn bindgen_test_layout_JSAutoNullableCompartment() { assert_eq!(::std::mem::align_of::() , 8usize); } pub type JSIterateCompartmentCallback = - ::std::option::Option bool; } impl CompartmentBehaviors { #[inline] - pub unsafe fn extraWarnings(&mut self, rt: *mut JSRuntime) -> bool { - _extraWarnings_CompartmentBehaviors_JS__QEBA_NPEAUJSRuntime___Z_(&mut *self, - rt) + pub unsafe fn extraWarnings(&mut self, cx: *mut JSContext) -> bool { + _extraWarnings_CompartmentBehaviors_JS__QEBA_NPEAUJSContext___Z_(&mut *self, + cx) } } /** @@ -3525,11 +3529,11 @@ fn bindgen_test_layout_ReadOnlyCompileOptions() { } #[repr(C)] pub struct OwningCompileOptions { - pub _bindgen_opaque_blob: [u64; 25usize], + pub _bindgen_opaque_blob: [u64; 24usize], } #[test] fn bindgen_test_layout_OwningCompileOptions() { - assert_eq!(::std::mem::size_of::() , 200usize); + assert_eq!(::std::mem::size_of::() , 192usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -3649,7 +3653,6 @@ pub struct JSErrorReport { pub flags: ::std::os::raw::c_uint, pub errorNumber: ::std::os::raw::c_uint, pub ucmessage: *const ::std::os::raw::c_ushort, - pub messageArgs: *mut *const ::std::os::raw::c_ushort, pub exnType: i16, } impl ::std::clone::Clone for JSErrorReport { @@ -3657,7 +3660,7 @@ impl ::std::clone::Clone for JSErrorReport { } #[test] fn bindgen_test_layout_JSErrorReport() { - assert_eq!(::std::mem::size_of::() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } pub type WarningReporter = @@ -3712,9 +3715,9 @@ pub enum JSJitCompilerOption { JSJITCOMPILER_ION_ENABLE = 4, JSJITCOMPILER_BASELINE_ENABLE = 5, JSJITCOMPILER_OFFTHREAD_COMPILATION_ENABLE = 6, - JSJITCOMPILER_SIGNALS_ENABLE = 7, - JSJITCOMPILER_JUMP_THRESHOLD = 8, - JSJITCOMPILER_WASM_TEST_MODE = 9, + JSJITCOMPILER_JUMP_THRESHOLD = 7, + JSJITCOMPILER_WASM_TEST_MODE = 8, + JSJITCOMPILER_WASM_EXPLICIT_BOUNDS_CHECKS = 9, JSJITCOMPILER_NOT_AN_OPTION = 10, } pub enum ScriptSource { } @@ -3963,6 +3966,49 @@ pub type OutOfMemoryCallback = ::std::option::Option; +/** + * Capture all frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct AllFrames; +impl ::std::clone::Clone for AllFrames { + fn clone(&self) -> Self { *self } +} +/** + * Capture at most this many frames. + */ +#[repr(C)] +#[derive(Debug, Copy)] +pub struct MaxFrames { + pub maxFrames: u32, +} +impl ::std::clone::Clone for MaxFrames { + fn clone(&self) -> Self { *self } +} +#[test] +fn bindgen_test_layout_MaxFrames() { + assert_eq!(::std::mem::size_of::() , 4usize); + assert_eq!(::std::mem::align_of::() , 4usize); +} +/** + * Capture the first frame with the given principals. By default, do not + * consider self-hosted frames with the given principals as satisfying the stack + * capture. + */ +#[repr(C)] +#[derive(Debug)] +pub struct FirstSubsumedFrame { + pub cx: *mut JSContext, + pub principals: *mut JSPrincipals, + pub ignoreSelfHosted: bool, +} +#[test] +fn bindgen_test_layout_FirstSubsumedFrame() { + assert_eq!(::std::mem::size_of::() , 24usize); + assert_eq!(::std::mem::align_of::() , 8usize); +} +pub type StackCapture = ::std::os::raw::c_void; #[repr(i32)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum SavedFrameResult { Ok = 0, AccessDenied = 1, } @@ -4001,11 +4047,6 @@ fn bindgen_test_layout_PerformanceGroup() { assert_eq!(::std::mem::size_of::() , 64usize); assert_eq!(::std::mem::align_of::() , 8usize); } -pub type StopwatchStartCallback = - ::std::option::Option bool>; pub type jsbytecode = u8; pub type IsAcceptableThis = ::std::option::Option bool>; @@ -4041,11 +4082,12 @@ pub enum jsfriendapi_h_unnamed_10 { JS_TELEMETRY_GC_MINOR_REASON = 19, JS_TELEMETRY_GC_MINOR_REASON_LONG = 20, JS_TELEMETRY_GC_MINOR_US = 21, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 22, - JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 23, - JS_TELEMETRY_ADDON_EXCEPTIONS = 24, - JS_TELEMETRY_DEFINE_GETTER_SETTER_THIS_NULL_UNDEFINED = 25, - JS_TELEMETRY_END = 26, + JS_TELEMETRY_GC_NURSERY_BYTES = 22, + JS_TELEMETRY_GC_PRETENURE_COUNT = 23, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT = 24, + JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_ADDONS = 25, + JS_TELEMETRY_ADDON_EXCEPTIONS = 26, + JS_TELEMETRY_END = 27, } pub type JSAccumulateTelemetryDataCallback = ::std::option::Option() , 80usize); + assert_eq!(::std::mem::size_of::() , 72usize); assert_eq!(::std::mem::align_of::() , 8usize); } /** @@ -5532,7 +5587,7 @@ pub struct RuntimeSizes { } #[test] fn bindgen_test_layout_RuntimeSizes() { - assert_eq!(::std::mem::size_of::() , 256usize); + assert_eq!(::std::mem::size_of::() , 248usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5619,11 +5674,11 @@ pub type CompartmentStatsVector = ::std::os::raw::c_void; pub type ZoneStatsVector = ::std::os::raw::c_void; #[repr(C)] pub struct RuntimeStats { - pub _bindgen_opaque_blob: [u64; 125usize], + pub _bindgen_opaque_blob: [u64; 124usize], } #[test] fn bindgen_test_layout_RuntimeStats() { - assert_eq!(::std::mem::size_of::() , 1000usize); + assert_eq!(::std::mem::size_of::() , 992usize); assert_eq!(::std::mem::align_of::() , 8usize); } #[repr(C)] @@ -5725,21 +5780,21 @@ extern "C" { /** * Schedule all zones to be collected in the next GC. */ - #[link_name = "?PrepareForFullGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PrepareForFullGC(rt: *mut JSRuntime); + #[link_name = "?PrepareForFullGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PrepareForFullGC(cx: *mut JSContext); /** * When performing an incremental GC, the zones that were selected for the * previous incremental slice must be selected in subsequent slices as well. * This function selects those slices automatically. */ - #[link_name = "?PrepareForIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PrepareForIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?PrepareForIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PrepareForIncrementalGC(cx: *mut JSContext); /** * Returns true if any zone in the system has been scheduled for GC with one of * the functions above or by the JS engine. */ - #[link_name = "?IsGCScheduled@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsGCScheduled(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsGCScheduled@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsGCScheduled(cx: *mut JSContext) -> bool; /** * Undoes the effect of the Prepare methods above. The given zone will not be * collected in the next GC. @@ -5756,67 +5811,67 @@ extern "C" { * the system. */ #[link_name = - "?GCForReason@JS@@YAXPEAUJSRuntime@@W4JSGCInvocationKind@@W4Reason@gcreason@1@@Z"] - pub fn GCForReason(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "?GCForReason@JS@@YAXPEAUJSContext@@W4JSGCInvocationKind@@W4Reason@gcreason@1@@Z"] + pub fn GCForReason(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason); /** * Begin an incremental collection and perform one slice worth of work. When * this function returns, the collection may not be complete. * IncrementalGCSlice() must be called repeatedly until - * !IsIncrementalGCInProgress(rt). + * !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "?StartIncrementalGC@JS@@YAXPEAUJSRuntime@@W4JSGCInvocationKind@@W4Reason@gcreason@1@_J@Z"] - pub fn StartIncrementalGC(rt: *mut JSRuntime, gckind: JSGCInvocationKind, + "?StartIncrementalGC@JS@@YAXPEAUJSContext@@W4JSGCInvocationKind@@W4Reason@gcreason@1@_J@Z"] + pub fn StartIncrementalGC(cx: *mut JSContext, gckind: JSGCInvocationKind, reason: Reason, millis: i64); /** * Perform a slice of an ongoing incremental collection. When this function * returns, the collection may not be complete. It must be called repeatedly - * until !IsIncrementalGCInProgress(rt). + * until !IsIncrementalGCInProgress(cx). * * Note: SpiderMonkey's GC is not realtime. Slices in practice may be longer or * shorter than the requested interval. */ #[link_name = - "?IncrementalGCSlice@JS@@YAXPEAUJSRuntime@@W4Reason@gcreason@1@_J@Z"] - pub fn IncrementalGCSlice(rt: *mut JSRuntime, reason: Reason, + "?IncrementalGCSlice@JS@@YAXPEAUJSContext@@W4Reason@gcreason@1@_J@Z"] + pub fn IncrementalGCSlice(cx: *mut JSContext, reason: Reason, millis: i64); /** - * If IsIncrementalGCInProgress(rt), this call finishes the ongoing collection - * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(rt), + * If IsIncrementalGCInProgress(cx), this call finishes the ongoing collection + * by performing an arbitrarily long slice. If !IsIncrementalGCInProgress(cx), * this is equivalent to GCForReason. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ #[link_name = - "?FinishIncrementalGC@JS@@YAXPEAUJSRuntime@@W4Reason@gcreason@1@@Z"] - pub fn FinishIncrementalGC(rt: *mut JSRuntime, reason: Reason); + "?FinishIncrementalGC@JS@@YAXPEAUJSContext@@W4Reason@gcreason@1@@Z"] + pub fn FinishIncrementalGC(cx: *mut JSContext, reason: Reason); /** - * If IsIncrementalGCInProgress(rt), this call aborts the ongoing collection and + * If IsIncrementalGCInProgress(cx), this call aborts the ongoing collection and * performs whatever work needs to be done to return the collector to its idle * state. This may take an arbitrarily long time. When this function returns, - * IsIncrementalGCInProgress(rt) will always be false. + * IsIncrementalGCInProgress(cx) will always be false. */ - #[link_name = "?AbortIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn AbortIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?AbortIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn AbortIncrementalGC(cx: *mut JSContext); /** * The GC slice callback is called at the beginning and end of each slice. This * callback may be used for GC notifications as well as to perform additional * marking. */ #[link_name = - "?SetGCSliceCallback@JS@@YAP6AXPEAUJSRuntime@@W4GCProgress@1@AEBUGCDescription@1@@Z0P6AX012@Z@Z"] - pub fn SetGCSliceCallback(rt: *mut JSRuntime, callback: GCSliceCallback) + "?SetGCSliceCallback@JS@@YAP6AXPEAUJSContext@@W4GCProgress@1@AEBUGCDescription@1@@Z0P6AX012@Z@Z"] + pub fn SetGCSliceCallback(cx: *mut JSContext, callback: GCSliceCallback) -> GCSliceCallback; /** * Set the nursery collection callback for the given runtime. When set, it will * be called at the start and end of every nursery collection. */ #[link_name = - "?SetGCNurseryCollectionCallback@JS@@YAP6AXPEAUJSRuntime@@W4GCNurseryProgress@1@W4Reason@gcreason@1@@Z0P6AX012@Z@Z"] - pub fn SetGCNurseryCollectionCallback(rt: *mut JSRuntime, + "?SetGCNurseryCollectionCallback@JS@@YAP6AXPEAUJSContext@@W4GCNurseryProgress@1@W4Reason@gcreason@1@@Z0P6AX012@Z@Z"] + pub fn SetGCNurseryCollectionCallback(cx: *mut JSContext, callback: GCNurseryCollectionCallback) -> GCNurseryCollectionCallback; @@ -5826,8 +5881,8 @@ extern "C" { * There is not currently a way to re-enable incremental GC once it has been * disabled on the runtime. */ - #[link_name = "?DisableIncrementalGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn DisableIncrementalGC(rt: *mut JSRuntime); + #[link_name = "?DisableIncrementalGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn DisableIncrementalGC(cx: *mut JSContext); /** * Returns true if incremental GC is enabled. Simply having incremental GC * enabled is not sufficient to ensure incremental collections are happening. @@ -5836,16 +5891,16 @@ extern "C" { * GCDescription returned by GCSliceCallback may help narrow down the cause if * collections are not happening incrementally when expected. */ - #[link_name = "?IsIncrementalGCEnabled@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalGCEnabled(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsIncrementalGCEnabled@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalGCEnabled(cx: *mut JSContext) -> bool; /** * Returns true while an incremental GC is ongoing, both when actively * collecting and between slices. */ - #[link_name = "?IsIncrementalGCInProgress@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalGCInProgress(rt: *mut JSRuntime) -> bool; - #[link_name = "?IsIncrementalBarrierNeeded@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsIncrementalBarrierNeeded(rt: *mut JSRuntime) -> bool; + #[link_name = "?IsIncrementalGCInProgress@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalGCInProgress(cx: *mut JSContext) -> bool; + #[link_name = "?IsIncrementalBarrierNeeded@JS@@YA_NPEAUJSContext@@@Z"] + pub fn IsIncrementalBarrierNeeded(cx: *mut JSContext) -> bool; #[link_name = "?IncrementalReferenceBarrier@JS@@YAXVGCCellPtr@1@@Z"] pub fn IncrementalReferenceBarrier(thing: GCCellPtr); #[link_name = "?IncrementalValueBarrier@JS@@YAXAEBVValue@1@@Z"] @@ -5855,8 +5910,8 @@ extern "C" { /** * Returns true if the most recent GC ran incrementally. */ - #[link_name = "?WasIncrementalGC@JS@@YA_NPEAUJSRuntime@@@Z"] - pub fn WasIncrementalGC(rt: *mut JSRuntime) -> bool; + #[link_name = "?WasIncrementalGC@JS@@YA_NPEAUJSContext@@@Z"] + pub fn WasIncrementalGC(cx: *mut JSContext) -> bool; /** * Returns true if generational allocation and collection is currently enabled * on the given runtime. @@ -5871,23 +5926,16 @@ extern "C" { #[link_name = "?GetGCNumber@JS@@YA_KXZ"] pub fn GetGCNumber() -> usize; /** - * The GC does not immediately return the unused memory freed by a collection - * back to the system incase it is needed soon afterwards. This call forces the - * GC to return this memory immediately. - */ - #[link_name = "?ShrinkGCBuffers@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn ShrinkGCBuffers(rt: *mut JSRuntime); - /** * Unsets the gray bit for anything reachable from |thing|. |kind| should not be * JS::TraceKind::Shape. |thing| should be non-null. The return value indicates * if anything was unmarked. */ #[link_name = "?UnmarkGrayGCThingRecursively@JS@@YA_NVGCCellPtr@1@@Z"] pub fn UnmarkGrayGCThingRecursively(thing: GCCellPtr) -> bool; - #[link_name = "?PokeGC@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn PokeGC(rt: *mut JSRuntime); - #[link_name = "?NotifyDidPaint@JS@@YAXPEAUJSRuntime@@@Z"] - pub fn NotifyDidPaint(rt: *mut JSRuntime); + #[link_name = "?PokeGC@JS@@YAXPEAUJSContext@@@Z"] + pub fn PokeGC(cx: *mut JSContext); + #[link_name = "?NotifyDidPaint@JS@@YAXPEAUJSContext@@@Z"] + pub fn NotifyDidPaint(cx: *mut JSContext); /** Returns a static string equivalent of |kind|. */ #[link_name = "?GCTraceKindToAscii@JS@@YAPEBDW4TraceKind@1@@Z"] pub fn GCTraceKindToAscii(kind: TraceKind) @@ -5968,9 +6016,10 @@ extern "C" { answer: *mut IsArrayAnswer) -> bool; /** Note: if the *data contains transferable objects, it can be read only once. */ #[link_name = - "?JS_ReadStructuredClone@@YA_NPEAUJSContext@@PEA_K_KIV?$MutableHandle@VValue@JS@@@JS@@PEBUJSStructuredCloneCallbacks@@PEAX@Z"] + "?JS_ReadStructuredClone@@YA_NPEAUJSContext@@PEA_K_KIW4StructuredCloneScope@JS@@V?$MutableHandle@VValue@JS@@@3@PEBUJSStructuredCloneCallbacks@@PEAX@Z"] pub fn JS_ReadStructuredClone(cx: *mut JSContext, data: *mut u64, nbytes: usize, version: u32, + scope: StructuredCloneScope, vp: MutableHandleValue, optionalCallbacks: *const JSStructuredCloneCallbacks, @@ -5981,9 +6030,10 @@ extern "C" { * JS_ClearStructuredClone(*datap, nbytes, optionalCallbacks, closure). */ #[link_name = - "?JS_WriteStructuredClone@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@PEAPEA_KPEA_KPEBUJSStructuredCloneCallbacks@@PEAX1@Z"] + "?JS_WriteStructuredClone@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@PEAPEA_KPEA_KW4StructuredCloneScope@3@PEBUJSStructuredCloneCallbacks@@PEAX1@Z"] pub fn JS_WriteStructuredClone(cx: *mut JSContext, v: HandleValue, datap: *mut *mut u64, nbytesp: *mut usize, + scope: StructuredCloneScope, optionalCallbacks: *const JSStructuredCloneCallbacks, closure: *mut ::std::os::raw::c_void, @@ -6037,32 +6087,36 @@ extern "C" { "?JS_ObjectNotWritten@@YA_NPEAUJSStructuredCloneWriter@@V?$Handle@PEAVJSObject@@@JS@@@Z"] pub fn JS_ObjectNotWritten(w: *mut JSStructuredCloneWriter, obj: HandleObject) -> bool; + #[link_name = + "?JS_GetStructuredCloneScope@@YA?AW4StructuredCloneScope@JS@@PEAUJSStructuredCloneWriter@@@Z"] + pub fn JS_GetStructuredCloneScope(w: *mut JSStructuredCloneWriter) + -> StructuredCloneScope; #[link_name = "?JS_HoldPrincipals@@YAXPEAUJSPrincipals@@@Z"] pub fn JS_HoldPrincipals(principals: *mut JSPrincipals); #[link_name = - "?JS_DropPrincipals@@YAXPEAUJSRuntime@@PEAUJSPrincipals@@@Z"] - pub fn JS_DropPrincipals(rt: *mut JSRuntime, + "?JS_DropPrincipals@@YAXPEAUJSContext@@PEAUJSPrincipals@@@Z"] + pub fn JS_DropPrincipals(cx: *mut JSContext, principals: *mut JSPrincipals); #[link_name = - "?JS_SetSecurityCallbacks@@YAXPEAUJSRuntime@@PEBUJSSecurityCallbacks@@@Z"] - pub fn JS_SetSecurityCallbacks(rt: *mut JSRuntime, + "?JS_SetSecurityCallbacks@@YAXPEAUJSContext@@PEBUJSSecurityCallbacks@@@Z"] + pub fn JS_SetSecurityCallbacks(cx: *mut JSContext, callbacks: *const JSSecurityCallbacks); #[link_name = - "?JS_GetSecurityCallbacks@@YAPEBUJSSecurityCallbacks@@PEAUJSRuntime@@@Z"] - pub fn JS_GetSecurityCallbacks(rt: *mut JSRuntime) + "?JS_GetSecurityCallbacks@@YAPEBUJSSecurityCallbacks@@PEAUJSContext@@@Z"] + pub fn JS_GetSecurityCallbacks(cx: *mut JSContext) -> *const JSSecurityCallbacks; #[link_name = - "?JS_SetTrustedPrincipals@@YAXPEAUJSRuntime@@PEAUJSPrincipals@@@Z"] - pub fn JS_SetTrustedPrincipals(rt: *mut JSRuntime, + "?JS_SetTrustedPrincipals@@YAXPEAUJSContext@@PEAUJSPrincipals@@@Z"] + pub fn JS_SetTrustedPrincipals(cx: *mut JSContext, prin: *mut JSPrincipals); #[link_name = - "?JS_InitDestroyPrincipalsCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSPrincipals@@@Z@Z"] - pub fn JS_InitDestroyPrincipalsCallback(rt: *mut JSRuntime, + "?JS_InitDestroyPrincipalsCallback@@YAXPEAUJSContext@@P6AXPEAUJSPrincipals@@@Z@Z"] + pub fn JS_InitDestroyPrincipalsCallback(cx: *mut JSContext, destroyPrincipals: JSDestroyPrincipalsOp); #[link_name = - "?JS_InitReadPrincipalsCallback@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@PEAUJSStructuredCloneReader@@PEAPEAUJSPrincipals@@@Z@Z"] - pub fn JS_InitReadPrincipalsCallback(rt: *mut JSRuntime, + "?JS_InitReadPrincipalsCallback@@YAXPEAUJSContext@@P6A_N0PEAUJSStructuredCloneReader@@PEAPEAUJSPrincipals@@@Z@Z"] + pub fn JS_InitReadPrincipalsCallback(cx: *mut JSContext, read: JSReadPrincipalsOp); /************************************************************************/ #[link_name = @@ -6094,8 +6148,8 @@ extern "C" { pub fn JS_GetPositiveInfinityValue(cx: *mut JSContext) -> Value; #[link_name = "?JS_GetEmptyStringValue@@YA?AVValue@JS@@PEAUJSContext@@@Z"] pub fn JS_GetEmptyStringValue(cx: *mut JSContext) -> Value; - #[link_name = "?JS_GetEmptyString@@YAPEAVJSString@@PEAUJSRuntime@@@Z"] - pub fn JS_GetEmptyString(rt: *mut JSRuntime) -> *mut JSString; + #[link_name = "?JS_GetEmptyString@@YAPEAVJSString@@PEAUJSContext@@@Z"] + pub fn JS_GetEmptyString(cx: *mut JSContext) -> *mut JSString; #[link_name = "?JS_ValueToObject@@YA_NPEAUJSContext@@V?$Handle@VValue@JS@@@JS@@V?$MutableHandle@PEAVJSObject@@@3@@Z"] pub fn JS_ValueToObject(cx: *mut JSContext, v: HandleValue, @@ -6136,11 +6190,11 @@ extern "C" { #[link_name = "?JS_IsBuiltinFunctionConstructor@@YA_NPEAVJSFunction@@@Z"] pub fn JS_IsBuiltinFunctionConstructor(fun: *mut JSFunction) -> bool; /************************************************************************/ - #[link_name = "?JS_NewRuntime@@YAPEAUJSRuntime@@IIPEAU1@@Z"] - pub fn JS_NewRuntime(maxbytes: u32, maxNurseryBytes: u32, - parentRuntime: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "?JS_DestroyRuntime@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_DestroyRuntime(rt: *mut JSRuntime); + #[link_name = "?JS_NewContext@@YAPEAUJSContext@@IIPEAU1@@Z"] + pub fn JS_NewContext(maxbytes: u32, maxNurseryBytes: u32, + parentContext: *mut JSContext) -> *mut JSContext; + #[link_name = "?JS_DestroyContext@@YAXPEAUJSContext@@@Z"] + pub fn JS_DestroyContext(cx: *mut JSContext); /** * The embedding can specify a time function that will be used in some * situations. The function can return the time however it likes; but @@ -6157,28 +6211,20 @@ extern "C" { */ #[link_name = "?JS_GetCurrentEmbedderTime@@YANXZ"] pub fn JS_GetCurrentEmbedderTime() -> f64; - #[link_name = "?JS_GetRuntimePrivate@@YAPEAXPEAUJSRuntime@@@Z"] - pub fn JS_GetRuntimePrivate(rt: *mut JSRuntime) + #[link_name = "?JS_GetContextPrivate@@YAPEAXPEAUJSContext@@@Z"] + pub fn JS_GetContextPrivate(cx: *mut JSContext) -> *mut ::std::os::raw::c_void; - #[link_name = "?JS_GetRuntime@@YAPEAUJSRuntime@@PEAUJSContext@@@Z"] - pub fn JS_GetRuntime(cx: *mut JSContext) -> *mut JSRuntime; - #[link_name = "?JS_GetParentRuntime@@YAPEAUJSRuntime@@PEAU1@@Z"] - pub fn JS_GetParentRuntime(rt: *mut JSRuntime) -> *mut JSRuntime; - #[link_name = "?JS_SetRuntimePrivate@@YAXPEAUJSRuntime@@PEAX@Z"] - pub fn JS_SetRuntimePrivate(rt: *mut JSRuntime, + #[link_name = "?JS_SetContextPrivate@@YAXPEAUJSContext@@PEAX@Z"] + pub fn JS_SetContextPrivate(cx: *mut JSContext, data: *mut ::std::os::raw::c_void); + #[link_name = "?JS_GetParentContext@@YAPEAUJSContext@@PEAU1@@Z"] + pub fn JS_GetParentContext(cx: *mut JSContext) -> *mut JSContext; #[link_name = "?JS_BeginRequest@@YAXPEAUJSContext@@@Z"] pub fn JS_BeginRequest(cx: *mut JSContext); #[link_name = "?JS_EndRequest@@YAXPEAUJSContext@@@Z"] pub fn JS_EndRequest(cx: *mut JSContext); - #[link_name = "?JS_SetFutexCanWait@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_SetFutexCanWait(rt: *mut JSRuntime); - /** - * Returns the runtime's JSContext. The plan is to expose a single type to the - * API, so this function will likely be removed soon. - */ - #[link_name = "?JS_GetContext@@YAPEAUJSContext@@PEAUJSRuntime@@@Z"] - pub fn JS_GetContext(rt: *mut JSRuntime) -> *mut JSContext; + #[link_name = "?JS_SetFutexCanWait@@YAXPEAUJSContext@@@Z"] + pub fn JS_SetFutexCanWait(cx: *mut JSContext); #[link_name = "?JS_GetVersion@@YA?AW4JSVersion@@PEAUJSContext@@@Z"] pub fn JS_GetVersion(cx: *mut JSContext) -> JSVersion; /** @@ -6200,11 +6246,8 @@ extern "C" { pub fn JS_StringToVersion(string: *const ::std::os::raw::c_char) -> JSVersion; #[link_name = - "?RuntimeOptionsRef@JS@@YAAEAVRuntimeOptions@1@PEAUJSRuntime@@@Z"] - pub fn RuntimeOptionsRef(rt: *mut JSRuntime) -> *mut RuntimeOptions; - #[link_name = - "?RuntimeOptionsRef@JS@@YAAEAVRuntimeOptions@1@PEAUJSContext@@@Z"] - pub fn RuntimeOptionsRef1(cx: *mut JSContext) -> *mut RuntimeOptions; + "?ContextOptionsRef@JS@@YAAEAVContextOptions@1@PEAUJSContext@@@Z"] + pub fn ContextOptionsRef(cx: *mut JSContext) -> *mut ContextOptions; /** * Initialize the runtime's self-hosted code. Embeddings should call this * exactly once per runtime/context, before the first JS_NewGlobalObject @@ -6212,33 +6255,40 @@ extern "C" { */ #[link_name = "?InitSelfHostedCode@JS@@YA_NPEAUJSContext@@@Z"] pub fn InitSelfHostedCode(cx: *mut JSContext) -> bool; + /** + * Asserts (in debug and release builds) that `obj` belongs to the current + * thread's context. + */ + #[link_name = + "?AssertObjectBelongsToCurrentThread@JS@@YAXPEAVJSObject@@@Z"] + pub fn AssertObjectBelongsToCurrentThread(obj: *mut JSObject); #[link_name = "?JS_GetImplementationVersion@@YAPEBDXZ"] pub fn JS_GetImplementationVersion() -> *const ::std::os::raw::c_char; #[link_name = - "?JS_SetDestroyCompartmentCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSFreeOp@@PEAUJSCompartment@@@Z@Z"] - pub fn JS_SetDestroyCompartmentCallback(rt: *mut JSRuntime, + "?JS_SetDestroyCompartmentCallback@@YAXPEAUJSContext@@P6AXPEAUJSFreeOp@@PEAUJSCompartment@@@Z@Z"] + pub fn JS_SetDestroyCompartmentCallback(cx: *mut JSContext, callback: JSDestroyCompartmentCallback); #[link_name = - "?JS_SetSizeOfIncludingThisCompartmentCallback@@YAXPEAUJSRuntime@@P6A_KP6A_KPEBX@ZPEAUJSCompartment@@@Z@Z"] - pub fn JS_SetSizeOfIncludingThisCompartmentCallback(rt: *mut JSRuntime, + "?JS_SetSizeOfIncludingThisCompartmentCallback@@YAXPEAUJSContext@@P6A_KP6A_KPEBX@ZPEAUJSCompartment@@@Z@Z"] + pub fn JS_SetSizeOfIncludingThisCompartmentCallback(cx: *mut JSContext, callback: JSSizeOfIncludingThisCompartmentCallback); #[link_name = - "?JS_SetDestroyZoneCallback@@YAXPEAUJSRuntime@@P6AXPEAUZone@JS@@@Z@Z"] - pub fn JS_SetDestroyZoneCallback(rt: *mut JSRuntime, + "?JS_SetDestroyZoneCallback@@YAXPEAUJSContext@@P6AXPEAUZone@JS@@@Z@Z"] + pub fn JS_SetDestroyZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "?JS_SetSweepZoneCallback@@YAXPEAUJSRuntime@@P6AXPEAUZone@JS@@@Z@Z"] - pub fn JS_SetSweepZoneCallback(rt: *mut JSRuntime, + "?JS_SetSweepZoneCallback@@YAXPEAUJSContext@@P6AXPEAUZone@JS@@@Z@Z"] + pub fn JS_SetSweepZoneCallback(cx: *mut JSContext, callback: JSZoneCallback); #[link_name = - "?JS_SetCompartmentNameCallback@@YAXPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAD_K@Z@Z"] - pub fn JS_SetCompartmentNameCallback(rt: *mut JSRuntime, + "?JS_SetCompartmentNameCallback@@YAXPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAD_K@Z@Z"] + pub fn JS_SetCompartmentNameCallback(cx: *mut JSContext, callback: JSCompartmentNameCallback); #[link_name = - "?JS_SetWrapObjectCallbacks@@YAXPEAUJSRuntime@@PEBUJSWrapObjectCallbacks@@@Z"] - pub fn JS_SetWrapObjectCallbacks(rt: *mut JSRuntime, + "?JS_SetWrapObjectCallbacks@@YAXPEAUJSContext@@PEBUJSWrapObjectCallbacks@@@Z"] + pub fn JS_SetWrapObjectCallbacks(cx: *mut JSContext, callbacks: *const JSWrapObjectCallbacks); #[link_name = "?JS_SetCompartmentPrivate@@YAXPEAUJSCompartment@@PEAX@Z"] pub fn JS_SetCompartmentPrivate(compartment: *mut JSCompartment, @@ -6282,8 +6332,8 @@ extern "C" { * returns. Also, barriers are disabled via the TraceSession. */ #[link_name = - "?JS_IterateCompartments@@YAXPEAUJSRuntime@@PEAXP6AX01PEAUJSCompartment@@@Z@Z"] - pub fn JS_IterateCompartments(rt: *mut JSRuntime, + "?JS_IterateCompartments@@YAXPEAUJSContext@@PEAXP6AX01PEAUJSCompartment@@@Z@Z"] + pub fn JS_IterateCompartments(cx: *mut JSContext, data: *mut ::std::os::raw::c_void, compartmentCallback: JSIterateCompartmentCallback); @@ -6452,8 +6502,6 @@ extern "C" { */ #[link_name = "?JS_freeop@@YAXPEAUJSFreeOp@@PEAX@Z"] pub fn JS_freeop(fop: *mut JSFreeOp, p: *mut ::std::os::raw::c_void); - #[link_name = "?JS_GetDefaultFreeOp@@YAPEAUJSFreeOp@@PEAUJSRuntime@@@Z"] - pub fn JS_GetDefaultFreeOp(rt: *mut JSRuntime) -> *mut JSFreeOp; #[link_name = "?JS_updateMallocCounter@@YAXPEAUJSContext@@_K@Z"] pub fn JS_updateMallocCounter(cx: *mut JSContext, nbytes: usize); #[link_name = "?JS_strdup@@YAPEADPEAUJSContext@@PEBD@Z"] @@ -6467,66 +6515,66 @@ extern "C" { * Register externally maintained GC roots. * * traceOp: the trace operation. For each root the implementation should call - * JS_CallTracer whenever the root contains a traceable thing. + * JS::TraceEdge whenever the root contains a traceable thing. * data: the data argument to pass to each invocation of traceOp. */ #[link_name = - "?JS_AddExtraGCRootsTracer@@YA_NPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_AddExtraGCRootsTracer(rt: *mut JSRuntime, + "?JS_AddExtraGCRootsTracer@@YA_NPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_AddExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void) -> bool; /** Undo a call to JS_AddExtraGCRootsTracer. */ #[link_name = - "?JS_RemoveExtraGCRootsTracer@@YAXPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_RemoveExtraGCRootsTracer(rt: *mut JSRuntime, + "?JS_RemoveExtraGCRootsTracer@@YAXPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_RemoveExtraGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); - #[link_name = "?JS_GC@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_GC(rt: *mut JSRuntime); + #[link_name = "?JS_GC@@YAXPEAUJSContext@@@Z"] + pub fn JS_GC(cx: *mut JSContext); #[link_name = "?JS_MaybeGC@@YAXPEAUJSContext@@@Z"] pub fn JS_MaybeGC(cx: *mut JSContext); #[link_name = - "?JS_SetGCCallback@@YAXPEAUJSRuntime@@P6AX0W4JSGCStatus@@PEAX@Z2@Z"] - pub fn JS_SetGCCallback(rt: *mut JSRuntime, cb: JSGCCallback, + "?JS_SetGCCallback@@YAXPEAUJSContext@@P6AX0W4JSGCStatus@@PEAX@Z2@Z"] + pub fn JS_SetGCCallback(cx: *mut JSContext, cb: JSGCCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?JS_SetObjectsTenuredCallback@@YAXPEAUJSRuntime@@P6AX0PEAX@Z1@Z"] - pub fn JS_SetObjectsTenuredCallback(rt: *mut JSRuntime, + "?JS_SetObjectsTenuredCallback@@YAXPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn JS_SetObjectsTenuredCallback(cx: *mut JSContext, cb: JSObjectsTenuredCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?JS_AddFinalizeCallback@@YA_NPEAUJSRuntime@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z4@Z"] - pub fn JS_AddFinalizeCallback(rt: *mut JSRuntime, cb: JSFinalizeCallback, + "?JS_AddFinalizeCallback@@YA_NPEAUJSContext@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z4@Z"] + pub fn JS_AddFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveFinalizeCallback@@YAXPEAUJSRuntime@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z@Z"] - pub fn JS_RemoveFinalizeCallback(rt: *mut JSRuntime, + "?JS_RemoveFinalizeCallback@@YAXPEAUJSContext@@P6AXPEAUJSFreeOp@@W4JSFinalizeStatus@@_NPEAX@Z@Z"] + pub fn JS_RemoveFinalizeCallback(cx: *mut JSContext, cb: JSFinalizeCallback); #[link_name = - "?JS_AddWeakPointerZoneGroupCallback@@YA_NPEAUJSRuntime@@P6AX0PEAX@Z1@Z"] - pub fn JS_AddWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "?JS_AddWeakPointerZoneGroupCallback@@YA_NPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn JS_AddWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveWeakPointerZoneGroupCallback@@YAXPEAUJSRuntime@@P6AX0PEAX@Z@Z"] - pub fn JS_RemoveWeakPointerZoneGroupCallback(rt: *mut JSRuntime, + "?JS_RemoveWeakPointerZoneGroupCallback@@YAXPEAUJSContext@@P6AX0PEAX@Z@Z"] + pub fn JS_RemoveWeakPointerZoneGroupCallback(cx: *mut JSContext, cb: JSWeakPointerZoneGroupCallback); #[link_name = - "?JS_AddWeakPointerCompartmentCallback@@YA_NPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAX@Z2@Z"] - pub fn JS_AddWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "?JS_AddWeakPointerCompartmentCallback@@YA_NPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAX@Z2@Z"] + pub fn JS_AddWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback, data: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?JS_RemoveWeakPointerCompartmentCallback@@YAXPEAUJSRuntime@@P6AX0PEAUJSCompartment@@PEAX@Z@Z"] - pub fn JS_RemoveWeakPointerCompartmentCallback(rt: *mut JSRuntime, + "?JS_RemoveWeakPointerCompartmentCallback@@YAXPEAUJSContext@@P6AX0PEAUJSCompartment@@PEAX@Z@Z"] + pub fn JS_RemoveWeakPointerCompartmentCallback(cx: *mut JSContext, cb: JSWeakPointerCompartmentCallback); #[link_name = @@ -6535,14 +6583,14 @@ extern "C" { #[link_name = "?JS_UpdateWeakPointerAfterGCUnbarriered@@YAXPEAPEAVJSObject@@@Z"] pub fn JS_UpdateWeakPointerAfterGCUnbarriered(objp: *mut *mut JSObject); - #[link_name = "?JS_SetGCParameter@@YAXPEAUJSRuntime@@W4JSGCParamKey@@I@Z"] - pub fn JS_SetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey, + #[link_name = "?JS_SetGCParameter@@YAXPEAUJSContext@@W4JSGCParamKey@@I@Z"] + pub fn JS_SetGCParameter(cx: *mut JSContext, key: JSGCParamKey, value: u32); - #[link_name = "?JS_GetGCParameter@@YAIPEAUJSRuntime@@W4JSGCParamKey@@@Z"] - pub fn JS_GetGCParameter(rt: *mut JSRuntime, key: JSGCParamKey) -> u32; + #[link_name = "?JS_GetGCParameter@@YAIPEAUJSContext@@W4JSGCParamKey@@@Z"] + pub fn JS_GetGCParameter(cx: *mut JSContext, key: JSGCParamKey) -> u32; #[link_name = - "?JS_SetGCParametersBasedOnAvailableMemory@@YAXPEAUJSRuntime@@I@Z"] - pub fn JS_SetGCParametersBasedOnAvailableMemory(rt: *mut JSRuntime, + "?JS_SetGCParametersBasedOnAvailableMemory@@YAXPEAUJSContext@@I@Z"] + pub fn JS_SetGCParametersBasedOnAvailableMemory(cx: *mut JSContext, availMem: u32); /** * Create a new JSString whose chars member refers to external memory, i.e., @@ -6585,8 +6633,8 @@ extern "C" { * This function may only be called immediately after the runtime is initialized * and before any code is executed and/or interrupts requested. */ - #[link_name = "?JS_SetNativeStackQuota@@YAXPEAUJSRuntime@@_K11@Z"] - pub fn JS_SetNativeStackQuota(cx: *mut JSRuntime, + #[link_name = "?JS_SetNativeStackQuota@@YAXPEAUJSContext@@_K11@Z"] + pub fn JS_SetNativeStackQuota(cx: *mut JSContext, systemCodeStackSize: usize, trustedScriptStackSize: usize, untrustedScriptStackSize: usize); @@ -6664,6 +6712,10 @@ extern "C" { "?JS_HasInstance@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@V?$Handle@VValue@JS@@@3@PEA_N@Z"] pub fn JS_HasInstance(cx: *mut JSContext, obj: Handle<*mut JSObject>, v: Handle, bp: *mut bool) -> bool; + #[link_name = + "?OrdinaryHasInstance@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@V?$Handle@VValue@JS@@@1@PEA_N@Z"] + pub fn OrdinaryHasInstance(cx: *mut JSContext, objArg: HandleObject, + v: HandleValue, bp: *mut bool) -> bool; #[link_name = "?JS_GetPrivate@@YAPEAXPEAVJSObject@@@Z"] pub fn JS_GetPrivate(obj: *mut JSObject) -> *mut ::std::os::raw::c_void; #[link_name = "?JS_SetPrivate@@YAXPEAVJSObject@@PEAX@Z"] @@ -6732,8 +6784,6 @@ extern "C" { -> *mut JSObject; #[link_name = "?JS_IsNative@@YA_NPEAVJSObject@@@Z"] pub fn JS_IsNative(obj: *mut JSObject) -> bool; - #[link_name = "?JS_GetObjectRuntime@@YAPEAUJSRuntime@@PEAVJSObject@@@Z"] - pub fn JS_GetObjectRuntime(obj: *mut JSObject) -> *mut JSRuntime; /** * Unlike JS_NewObject, JS_NewObjectWithGivenProto does not compute a default * proto. If proto is nullptr, the JS object will have `null` as [[Prototype]]. @@ -7616,6 +7666,11 @@ extern "C" { nargs: ::std::os::raw::c_uint, attrs: ::std::os::raw::c_uint) -> *mut JSFunction; + #[link_name = "?JS_IsFunctionBound@@YA_NPEAVJSFunction@@@Z"] + pub fn JS_IsFunctionBound(fun: *mut JSFunction) -> bool; + #[link_name = + "?JS_GetBoundFunctionTarget@@YAPEAVJSObject@@PEAVJSFunction@@@Z"] + pub fn JS_GetBoundFunctionTarget(fun: *mut JSFunction) -> *mut JSObject; /** * Clone a top-level function into cx's global. This function will dynamically * fail if funobj was lexically nested inside some other function. @@ -7762,10 +7817,13 @@ extern "C" { callbackData: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?FinishOffThreadScript@JS@@YAPEAVJSScript@@PEAUJSContext@@PEAUJSRuntime@@PEAX@Z"] - pub fn FinishOffThreadScript(maybecx: *mut JSContext, rt: *mut JSRuntime, + "?FinishOffThreadScript@JS@@YAPEAVJSScript@@PEAUJSContext@@PEAX@Z"] + pub fn FinishOffThreadScript(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSScript; + #[link_name = "?CancelOffThreadScript@JS@@YAXPEAUJSContext@@PEAX@Z"] + pub fn CancelOffThreadScript(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); #[link_name = "?CompileOffThreadModule@JS@@YA_NPEAUJSContext@@AEBVReadOnlyCompileOptions@1@PEB_S_KP6AXPEAX4@Z4@Z"] pub fn CompileOffThreadModule(cx: *mut JSContext, @@ -7776,10 +7834,13 @@ extern "C" { callbackData: *mut ::std::os::raw::c_void) -> bool; #[link_name = - "?FinishOffThreadModule@JS@@YAPEAVJSObject@@PEAUJSContext@@PEAUJSRuntime@@PEAX@Z"] - pub fn FinishOffThreadModule(maybecx: *mut JSContext, rt: *mut JSRuntime, + "?FinishOffThreadModule@JS@@YAPEAVJSObject@@PEAUJSContext@@PEAX@Z"] + pub fn FinishOffThreadModule(cx: *mut JSContext, token: *mut ::std::os::raw::c_void) -> *mut JSObject; + #[link_name = "?CancelOffThreadModule@JS@@YAXPEAUJSContext@@PEAX@Z"] + pub fn CancelOffThreadModule(cx: *mut JSContext, + token: *mut ::std::os::raw::c_void); /** * Compile a function with scopeChain plus the global as its scope chain. * scopeChain must contain objects in the current compartment of cx. The actual @@ -7869,9 +7930,10 @@ extern "C" { * cross-compartment, it is cloned into the current compartment before executing. */ #[link_name = - "?CloneAndExecuteScript@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSScript@@@1@@Z"] + "?CloneAndExecuteScript@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSScript@@@1@V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn CloneAndExecuteScript(cx: *mut JSContext, - script: Handle<*mut JSScript>) -> bool; + script: Handle<*mut JSScript>, + rval: MutableHandleValue) -> bool; /** * Evaluate the given source buffer in the scope of the current global of cx. */ @@ -7984,15 +8046,26 @@ extern "C" { #[link_name = "?JS_CheckForInterrupt@@YA_NPEAUJSContext@@@Z"] pub fn JS_CheckForInterrupt(cx: *mut JSContext) -> bool; #[link_name = - "?JS_SetInterruptCallback@@YAP6A_NPEAUJSContext@@@ZPEAUJSRuntime@@P6A_N0@Z@Z"] - pub fn JS_SetInterruptCallback(rt: *mut JSRuntime, + "?JS_SetInterruptCallback@@YAP6A_NPEAUJSContext@@@Z0P6A_N0@Z@Z"] + pub fn JS_SetInterruptCallback(cx: *mut JSContext, callback: JSInterruptCallback) -> JSInterruptCallback; + #[link_name = "?JS_GetInterruptCallback@@YAP6A_NPEAUJSContext@@@Z0@Z"] + pub fn JS_GetInterruptCallback(cx: *mut JSContext) -> JSInterruptCallback; + #[link_name = "?JS_RequestInterruptCallback@@YAXPEAUJSContext@@@Z"] + pub fn JS_RequestInterruptCallback(cx: *mut JSContext); + /** + * Sets the callback that's invoked whenever an incumbent global is required. + * + * SpiderMonkey doesn't itself have a notion of incumbent globals as defined + * by the html spec, so we need the embedding to provide this. + * See dom/base/ScriptSettings.h for details. + */ #[link_name = - "?JS_GetInterruptCallback@@YAP6A_NPEAUJSContext@@@ZPEAUJSRuntime@@@Z"] - pub fn JS_GetInterruptCallback(rt: *mut JSRuntime) -> JSInterruptCallback; - #[link_name = "?JS_RequestInterruptCallback@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_RequestInterruptCallback(rt: *mut JSRuntime); + "?SetGetIncumbentGlobalCallback@JS@@YAXPEAUJSContext@@P6APEAVJSObject@@0@Z@Z"] + pub fn SetGetIncumbentGlobalCallback(cx: *mut JSContext, + callback: + JSGetIncumbentGlobalCallback); /** * Sets the callback that's invoked whenever a Promise job should be enqeued. * @@ -8003,8 +8076,8 @@ extern "C" { * passed here as arguments. */ #[link_name = - "?SetEnqueuePromiseJobCallback@JS@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@2PEAX@Z3@Z"] - pub fn SetEnqueuePromiseJobCallback(rt: *mut JSRuntime, + "?SetEnqueuePromiseJobCallback@JS@@YAXPEAUJSContext@@P6A_N0V?$Handle@PEAVJSObject@@@1@11PEAX@Z2@Z"] + pub fn SetEnqueuePromiseJobCallback(cx: *mut JSContext, callback: JSEnqueuePromiseJobCallback, data: *mut ::std::os::raw::c_void); /** @@ -8013,8 +8086,8 @@ extern "C" { * without a handler gets a handler attached. */ #[link_name = - "?SetPromiseRejectionTrackerCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@W4PromiseRejectionHandlingState@@PEAX@Z4@Z"] - pub fn SetPromiseRejectionTrackerCallback(rt: *mut JSRuntime, + "?SetPromiseRejectionTrackerCallback@JS@@YAXPEAUJSContext@@P6AX0V?$Handle@PEAVJSObject@@@1@W4PromiseRejectionHandlingState@@PEAX@Z3@Z"] + pub fn SetPromiseRejectionTrackerCallback(cx: *mut JSContext, callback: JSPromiseRejectionTrackerCallback, data: @@ -8510,29 +8583,29 @@ extern "C" { * specify their own locales. * The locale string remains owned by the caller. */ - #[link_name = "?JS_SetDefaultLocale@@YA_NPEAUJSRuntime@@PEBD@Z"] - pub fn JS_SetDefaultLocale(rt: *mut JSRuntime, + #[link_name = "?JS_SetDefaultLocale@@YA_NPEAUJSContext@@PEBD@Z"] + pub fn JS_SetDefaultLocale(cx: *mut JSContext, locale: *const ::std::os::raw::c_char) -> bool; /** * Reset the default locale to OS defaults. */ - #[link_name = "?JS_ResetDefaultLocale@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_ResetDefaultLocale(rt: *mut JSRuntime); + #[link_name = "?JS_ResetDefaultLocale@@YAXPEAUJSContext@@@Z"] + pub fn JS_ResetDefaultLocale(cx: *mut JSContext); /** * Establish locale callbacks. The pointer must persist as long as the - * JSRuntime. Passing nullptr restores the default behaviour. + * JSContext. Passing nullptr restores the default behaviour. */ #[link_name = - "?JS_SetLocaleCallbacks@@YAXPEAUJSRuntime@@PEBUJSLocaleCallbacks@@@Z"] - pub fn JS_SetLocaleCallbacks(rt: *mut JSRuntime, + "?JS_SetLocaleCallbacks@@YAXPEAUJSContext@@PEBUJSLocaleCallbacks@@@Z"] + pub fn JS_SetLocaleCallbacks(cx: *mut JSContext, callbacks: *const JSLocaleCallbacks); /** * Return the address of the current locale callbacks struct, which may * be nullptr. */ #[link_name = - "?JS_GetLocaleCallbacks@@YAPEBUJSLocaleCallbacks@@PEAUJSRuntime@@@Z"] - pub fn JS_GetLocaleCallbacks(rt: *mut JSRuntime) + "?JS_GetLocaleCallbacks@@YAPEBUJSLocaleCallbacks@@PEAUJSContext@@@Z"] + pub fn JS_GetLocaleCallbacks(cx: *mut JSContext) -> *const JSLocaleCallbacks; /** * Report an exception represented by the sprintf-like conversion of format @@ -8601,12 +8674,12 @@ extern "C" { #[link_name = "?JS_ReportAllocationOverflow@@YAXPEAUJSContext@@@Z"] pub fn JS_ReportAllocationOverflow(cx: *mut JSContext); #[link_name = - "?SetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@ZPEAUJSRuntime@@P6AX012@Z@Z"] - pub fn SetWarningReporter(rt: *mut JSRuntime, reporter: WarningReporter) + "?SetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@Z0P6AX012@Z@Z"] + pub fn SetWarningReporter(cx: *mut JSContext, reporter: WarningReporter) -> WarningReporter; #[link_name = - "?GetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@ZPEAUJSRuntime@@@Z"] - pub fn GetWarningReporter(rt: *mut JSRuntime) -> WarningReporter; + "?GetWarningReporter@JS@@YAP6AXPEAUJSContext@@PEBDPEAVJSErrorReport@@@Z0@Z"] + pub fn GetWarningReporter(cx: *mut JSContext) -> WarningReporter; #[link_name = "?CreateError@JS@@YA_NPEAUJSContext@@W4JSExnType@@V?$Handle@PEAVJSObject@@@1@V?$Handle@PEAVJSString@@@1@IIPEAVJSErrorReport@@3V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn CreateError(cx: *mut JSContext, type_: JSExnType, @@ -8827,16 +8900,16 @@ extern "C" { #[link_name = "?JS_GetCurrentThread@@YA_JXZ"] pub fn JS_GetCurrentThread() -> isize; /** - * A JS runtime always has an "owner thread". The owner thread is set when the - * runtime is created (to the current thread) and practically all entry points - * into the JS engine check that a runtime (or anything contained in the - * runtime: context, compartment, object, etc) is only touched by its owner + * A JS context always has an "owner thread". The owner thread is set when the + * context is created (to the current thread) and practically all entry points + * into the JS engine check that a context (or anything contained in the + * context: runtime, compartment, object, etc) is only touched by its owner * thread. Embeddings may check this invariant outside the JS engine by calling * JS_AbortIfWrongThread (which will abort if not on the owner thread, even for * non-debug builds). */ - #[link_name = "?JS_AbortIfWrongThread@@YAXPEAUJSRuntime@@@Z"] - pub fn JS_AbortIfWrongThread(rt: *mut JSRuntime); + #[link_name = "?JS_AbortIfWrongThread@@YAXPEAUJSContext@@@Z"] + pub fn JS_AbortIfWrongThread(cx: *mut JSContext); /** * A constructor can request that the JS engine create a default new 'this' * object of the given class, using the callee to determine parentage and @@ -8850,24 +8923,24 @@ extern "C" { #[link_name = "?JS_GetGCZealBits@@YAXPEAUJSContext@@PEAI11@Z"] pub fn JS_GetGCZealBits(cx: *mut JSContext, zealBits: *mut u32, frequency: *mut u32, nextScheduled: *mut u32); - #[link_name = "?JS_SetGCZeal@@YAXPEAUJSRuntime@@EI@Z"] - pub fn JS_SetGCZeal(rt: *mut JSRuntime, zeal: u8, frequency: u32); + #[link_name = "?JS_SetGCZeal@@YAXPEAUJSContext@@EI@Z"] + pub fn JS_SetGCZeal(cx: *mut JSContext, zeal: u8, frequency: u32); #[link_name = "?JS_ScheduleGC@@YAXPEAUJSContext@@I@Z"] pub fn JS_ScheduleGC(cx: *mut JSContext, count: u32); - #[link_name = "?JS_SetParallelParsingEnabled@@YAXPEAUJSRuntime@@_N@Z"] - pub fn JS_SetParallelParsingEnabled(rt: *mut JSRuntime, enabled: bool); + #[link_name = "?JS_SetParallelParsingEnabled@@YAXPEAUJSContext@@_N@Z"] + pub fn JS_SetParallelParsingEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "?JS_SetOffthreadIonCompilationEnabled@@YAXPEAUJSRuntime@@_N@Z"] - pub fn JS_SetOffthreadIonCompilationEnabled(rt: *mut JSRuntime, + "?JS_SetOffthreadIonCompilationEnabled@@YAXPEAUJSContext@@_N@Z"] + pub fn JS_SetOffthreadIonCompilationEnabled(cx: *mut JSContext, enabled: bool); #[link_name = - "?JS_SetGlobalJitCompilerOption@@YAXPEAUJSRuntime@@W4JSJitCompilerOption@@I@Z"] - pub fn JS_SetGlobalJitCompilerOption(rt: *mut JSRuntime, + "?JS_SetGlobalJitCompilerOption@@YAXPEAUJSContext@@W4JSJitCompilerOption@@I@Z"] + pub fn JS_SetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption, value: u32); #[link_name = - "?JS_GetGlobalJitCompilerOption@@YAHPEAUJSRuntime@@W4JSJitCompilerOption@@@Z"] - pub fn JS_GetGlobalJitCompilerOption(rt: *mut JSRuntime, + "?JS_GetGlobalJitCompilerOption@@YAHPEAUJSContext@@W4JSJitCompilerOption@@@Z"] + pub fn JS_GetGlobalJitCompilerOption(cx: *mut JSContext, opt: JSJitCompilerOption) -> ::std::os::raw::c_int; /** @@ -8955,34 +9028,46 @@ extern "C" { data: *const ::std::os::raw::c_void, length: u32) -> *mut JSObject; #[link_name = - "?SetAsmJSCacheOps@JS@@YAXPEAUJSRuntime@@PEBUAsmJSCacheOps@1@@Z"] - pub fn SetAsmJSCacheOps(rt: *mut JSRuntime, + "?SetAsmJSCacheOps@JS@@YAXPEAUJSContext@@PEBUAsmJSCacheOps@1@@Z"] + pub fn SetAsmJSCacheOps(cx: *mut JSContext, callbacks: *const AsmJSCacheOps); #[link_name = - "?SetBuildIdOp@JS@@YAXPEAUJSRuntime@@P6A_NPEAV?$Vector@D$0A@VSystemAllocPolicy@js@@@mozilla@@@Z@Z"] - pub fn SetBuildIdOp(rt: *mut JSRuntime, buildIdOp: BuildIdOp); + "?SetBuildIdOp@JS@@YAXPEAUJSContext@@P6A_NPEAV?$Vector@D$0A@VSystemAllocPolicy@js@@@mozilla@@@Z@Z"] + pub fn SetBuildIdOp(cx: *mut JSContext, buildIdOp: BuildIdOp); #[link_name = - "?SetLargeAllocationFailureCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAX@Z1@Z"] - pub fn SetLargeAllocationFailureCallback(rt: *mut JSRuntime, + "?SetLargeAllocationFailureCallback@JS@@YAXPEAUJSContext@@P6AXPEAX@Z1@Z"] + pub fn SetLargeAllocationFailureCallback(cx: *mut JSContext, afc: LargeAllocationFailureCallback, data: *mut ::std::os::raw::c_void); #[link_name = - "?SetOutOfMemoryCallback@JS@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@PEAX@Z2@Z"] - pub fn SetOutOfMemoryCallback(rt: *mut JSRuntime, cb: OutOfMemoryCallback, + "?SetOutOfMemoryCallback@JS@@YAXPEAUJSContext@@P6AX0PEAX@Z1@Z"] + pub fn SetOutOfMemoryCallback(cx: *mut JSContext, cb: OutOfMemoryCallback, data: *mut ::std::os::raw::c_void); /** * Capture the current call stack as a chain of SavedFrame JSObjects, and set * |stackp| to the SavedFrame for the youngest stack frame, or nullptr if there - * are no JS frames on the stack. If |maxFrameCount| is non-zero, capture at - * most the youngest |maxFrameCount| frames. + * are no JS frames on the stack. + * + * The |capture| parameter describes the portion of the JS stack to capture: + * + * * |JS::AllFrames|: Capture all frames on the stack. + * + * * |JS::MaxFrames|: Capture no more than |JS::MaxFrames::maxFrames| from the + * stack. + * + * * |JS::FirstSubsumedFrame|: Capture the first frame whose principals are + * subsumed by |JS::FirstSubsumedFrame::principals|. By default, do not + * consider self-hosted frames; this can be controlled via the + * |JS::FirstSubsumedFrame::ignoreSelfHosted| flag. Do not capture any async + * stack. */ #[link_name = - "?CaptureCurrentStack@JS@@YA_NPEAUJSContext@@V?$MutableHandle@PEAVJSObject@@@1@I@Z"] + "?CaptureCurrentStack@JS@@YA_NPEAUJSContext@@V?$MutableHandle@PEAVJSObject@@@1@$$QEAV?$Variant@UAllFrames@JS@@UMaxFrames@2@UFirstSubsumedFrame@2@@mozilla@@@Z"] pub fn CaptureCurrentStack(cx: *mut JSContext, stackp: MutableHandleObject, - maxFrameCount: ::std::os::raw::c_uint) -> bool; + capture: ::std::os::raw::c_void) -> bool; #[link_name = "?CopyAsyncStack@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@V?$Handle@PEAVJSString@@@1@V?$MutableHandle@PEAVJSObject@@@1@I@Z"] pub fn CopyAsyncStack(cx: *mut JSContext, asyncStack: HandleObject, @@ -9091,18 +9176,18 @@ extern "C" { * Until `FlushMonitoring` has been called, all PerformanceMonitoring data is invisible * to the outside world and can cancelled with a call to `ResetMonitoring`. */ - #[link_name = "?FlushPerformanceMonitoring@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn FlushPerformanceMonitoring(arg1: *mut JSRuntime) -> bool; + #[link_name = "?FlushPerformanceMonitoring@js@@YA_NPEAUJSContext@@@Z"] + pub fn FlushPerformanceMonitoring(arg1: *mut JSContext) -> bool; /** * Cancel any measurement that hasn't been committed. */ - #[link_name = "?ResetPerformanceMonitoring@js@@YAXPEAUJSRuntime@@@Z"] - pub fn ResetPerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "?ResetPerformanceMonitoring@js@@YAXPEAUJSContext@@@Z"] + pub fn ResetPerformanceMonitoring(arg1: *mut JSContext); /** * Cleanup any memory used by performance monitoring. */ - #[link_name = "?DisposePerformanceMonitoring@js@@YAXPEAUJSRuntime@@@Z"] - pub fn DisposePerformanceMonitoring(arg1: *mut JSRuntime); + #[link_name = "?DisposePerformanceMonitoring@js@@YAXPEAUJSContext@@@Z"] + pub fn DisposePerformanceMonitoring(arg1: *mut JSContext); /** * Turn on/off stopwatch-based CPU monitoring. * @@ -9110,43 +9195,35 @@ extern "C" { * may return `false` if monitoring could not be activated, which may * happen if we are out of memory. */ - #[link_name = "?SetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSRuntime@@_N@Z"] - pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "?SetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSContext@@_N@Z"] + pub fn SetStopwatchIsMonitoringCPOW(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "?GetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSRuntime) -> bool; - #[link_name = "?SetStopwatchIsMonitoringJank@js@@YA_NPEAUJSRuntime@@_N@Z"] - pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSRuntime, arg2: bool) + #[link_name = "?GetStopwatchIsMonitoringCPOW@js@@YA_NPEAUJSContext@@@Z"] + pub fn GetStopwatchIsMonitoringCPOW(arg1: *mut JSContext) -> bool; + #[link_name = "?SetStopwatchIsMonitoringJank@js@@YA_NPEAUJSContext@@_N@Z"] + pub fn SetStopwatchIsMonitoringJank(arg1: *mut JSContext, arg2: bool) -> bool; - #[link_name = "?GetStopwatchIsMonitoringJank@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSRuntime) -> bool; - #[link_name = "?IsStopwatchActive@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn IsStopwatchActive(arg1: *mut JSRuntime) -> bool; + #[link_name = "?GetStopwatchIsMonitoringJank@js@@YA_NPEAUJSContext@@@Z"] + pub fn GetStopwatchIsMonitoringJank(arg1: *mut JSContext) -> bool; #[link_name = - "?GetPerfMonitoringTestCpuRescheduling@js@@YAXPEAUJSRuntime@@PEA_K1@Z"] - pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSRuntime, + "?GetPerfMonitoringTestCpuRescheduling@js@@YAXPEAUJSContext@@PEA_K1@Z"] + pub fn GetPerfMonitoringTestCpuRescheduling(arg1: *mut JSContext, stayed: *mut u64, moved: *mut u64); /** * Add a number of microseconds to the time spent waiting on CPOWs * since process start. */ - #[link_name = "?AddCPOWPerformanceDelta@js@@YAXPEAUJSRuntime@@_K@Z"] - pub fn AddCPOWPerformanceDelta(arg1: *mut JSRuntime, delta: u64); - #[link_name = - "?SetStopwatchStartCallback@js@@YA_NPEAUJSRuntime@@P6A_N_KPEAX@Z2@Z"] - pub fn SetStopwatchStartCallback(arg1: *mut JSRuntime, - arg2: StopwatchStartCallback, - arg3: *mut ::std::os::raw::c_void) - -> bool; + #[link_name = "?AddCPOWPerformanceDelta@js@@YAXPEAUJSContext@@_K@Z"] + pub fn AddCPOWPerformanceDelta(arg1: *mut JSContext, delta: u64); #[link_name = "?CallMethodIfWrapped@detail@JS@@YA_NPEAUJSContext@@P6A_NV?$Handle@VValue@JS@@@2@@ZP6A_N0AEBVCallArgs@2@@Z3@Z"] pub fn CallMethodIfWrapped(cx: *mut JSContext, test: IsAcceptableThis, impl_: NativeImpl, args: *const CallArgs) -> bool; #[link_name = - "?JS_SetGrayGCRootsTracer@@YAXPEAUJSRuntime@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] - pub fn JS_SetGrayGCRootsTracer(rt: *mut JSRuntime, traceOp: JSTraceDataOp, + "?JS_SetGrayGCRootsTracer@@YAXPEAUJSContext@@P6AXPEAVJSTracer@@PEAX@Z2@Z"] + pub fn JS_SetGrayGCRootsTracer(cx: *mut JSContext, traceOp: JSTraceDataOp, data: *mut ::std::os::raw::c_void); #[link_name = "?JS_FindCompilationScope@@YAPEAVJSObject@@PEAUJSContext@@V?$Handle@PEAVJSObject@@@JS@@@Z"] @@ -9217,8 +9294,8 @@ extern "C" { pub fn JS_TraceObjectGroupCycleCollectorChildren(trc: *mut CallbackTracer, group: GCCellPtr); #[link_name = - "?JS_SetAccumulateTelemetryCallback@@YAXPEAUJSRuntime@@P6AXHIPEBD@Z@Z"] - pub fn JS_SetAccumulateTelemetryCallback(rt: *mut JSRuntime, + "?JS_SetAccumulateTelemetryCallback@@YAXPEAUJSContext@@P6AXHIPEBD@Z@Z"] + pub fn JS_SetAccumulateTelemetryCallback(cx: *mut JSContext, callback: JSAccumulateTelemetryDataCallback); #[link_name = "?JS_GetIsSecureContext@@YA_NPEAUJSCompartment@@@Z"] @@ -9461,8 +9538,8 @@ extern "C" { * fp is the file for the dump output. */ #[link_name = - "?DumpHeap@js@@YAXPEAUJSRuntime@@PEAU_iobuf@@W4DumpHeapNurseryBehaviour@1@@Z"] - pub fn DumpHeap(rt: *mut JSRuntime, fp: *mut FILE, + "?DumpHeap@js@@YAXPEAUJSContext@@PEAU_iobuf@@W4DumpHeapNurseryBehaviour@1@@Z"] + pub fn DumpHeap(cx: *mut JSContext, fp: *mut FILE, nurseryBehaviour: DumpHeapNurseryBehaviour); #[link_name = "?obj_defineGetter@js@@YA_NPEAUJSContext@@IPEAVValue@JS@@@Z"] @@ -9482,8 +9559,8 @@ extern "C" { pub fn IsAtomsZone(zone: *mut Zone) -> bool; #[link_name = "?TraceWeakMaps@js@@YAXPEAUWeakMapTracer@1@@Z"] pub fn TraceWeakMaps(trc: *mut WeakMapTracer); - #[link_name = "?AreGCGrayBitsValid@js@@YA_NPEAUJSRuntime@@@Z"] - pub fn AreGCGrayBitsValid(rt: *mut JSRuntime) -> bool; + #[link_name = "?AreGCGrayBitsValid@js@@YA_NPEAUJSContext@@@Z"] + pub fn AreGCGrayBitsValid(cx: *mut JSContext) -> bool; #[link_name = "?ZoneGlobalsAreAllGray@js@@YA_NPEAUZone@JS@@@Z"] pub fn ZoneGlobalsAreAllGray(zone: *mut Zone) -> bool; #[link_name = @@ -9618,8 +9695,8 @@ extern "C" { pub fn StringIsArrayIndex(str: *mut JSLinearString, indexp: *mut u32) -> bool; #[link_name = - "?SetPreserveWrapperCallback@js@@YAXPEAUJSRuntime@@P6A_NPEAUJSContext@@PEAVJSObject@@@Z@Z"] - pub fn SetPreserveWrapperCallback(rt: *mut JSRuntime, + "?SetPreserveWrapperCallback@js@@YAXPEAUJSContext@@P6A_N0PEAVJSObject@@@Z@Z"] + pub fn SetPreserveWrapperCallback(cx: *mut JSContext, callback: PreserveWrapperCallback); #[link_name = "?IsObjectInContextCompartment@js@@YA_NPEAVJSObject@@PEBUJSContext@@@Z"] @@ -9660,16 +9737,16 @@ extern "C" { * idle and a request begins. */ #[link_name = - "?SetActivityCallback@js@@YAXPEAUJSRuntime@@P6AXPEAX_N@Z1@Z"] - pub fn SetActivityCallback(rt: *mut JSRuntime, cb: ActivityCallback, + "?SetActivityCallback@js@@YAXPEAUJSContext@@P6AXPEAX_N@Z1@Z"] + pub fn SetActivityCallback(cx: *mut JSContext, cb: ActivityCallback, arg: *mut ::std::os::raw::c_void); #[link_name = - "?SetDOMCallbacks@js@@YAXPEAUJSRuntime@@PEBUJSDOMCallbacks@1@@Z"] - pub fn SetDOMCallbacks(rt: *mut JSRuntime, + "?SetDOMCallbacks@js@@YAXPEAUJSContext@@PEBUJSDOMCallbacks@1@@Z"] + pub fn SetDOMCallbacks(cx: *mut JSContext, callbacks: *const DOMCallbacks); #[link_name = - "?GetDOMCallbacks@js@@YAPEBUJSDOMCallbacks@1@PEAUJSRuntime@@@Z"] - pub fn GetDOMCallbacks(rt: *mut JSRuntime) -> *const DOMCallbacks; + "?GetDOMCallbacks@js@@YAPEBUJSDOMCallbacks@1@PEAUJSContext@@@Z"] + pub fn GetDOMCallbacks(cx: *mut JSContext) -> *const DOMCallbacks; #[link_name = "?GetTestingFunctions@js@@YAPEAVJSObject@@PEAUJSContext@@@Z"] pub fn GetTestingFunctions(cx: *mut JSContext) -> *mut JSObject; @@ -9678,8 +9755,8 @@ extern "C" { * Returns nullptr for invalid arguments and JSEXN_INTERNALERR */ #[link_name = - "?GetErrorTypeName@js@@YAPEAVJSFlatString@@PEAUJSRuntime@@F@Z"] - pub fn GetErrorTypeName(rt: *mut JSRuntime, exnType: i16) + "?GetErrorTypeName@js@@YAPEAVJSFlatString@@PEAUJSContext@@F@Z"] + pub fn GetErrorTypeName(cx: *mut JSContext, exnType: i16) -> *mut JSFlatString; #[link_name = "?GetEnterCompartmentDepth@js@@YAIPEAUJSContext@@@Z"] pub fn GetEnterCompartmentDepth(cx: *mut JSContext) @@ -10256,8 +10333,8 @@ extern "C" { closure: *mut ScriptEnvironmentPreparer_Closure); #[link_name = - "?SetScriptEnvironmentPreparer@js@@YAXPEAUJSRuntime@@PEAUScriptEnvironmentPreparer@1@@Z"] - pub fn SetScriptEnvironmentPreparer(rt: *mut JSRuntime, + "?SetScriptEnvironmentPreparer@js@@YAXPEAUJSContext@@PEAUScriptEnvironmentPreparer@1@@Z"] + pub fn SetScriptEnvironmentPreparer(cx: *mut JSContext, preparer: *mut ScriptEnvironmentPreparer); /** @@ -10265,8 +10342,8 @@ extern "C" { * calling into C. */ #[link_name = - "?SetCTypesActivityCallback@js@@YAXPEAUJSRuntime@@P6AXPEAUJSContext@@W4CTypesActivityType@1@@Z@Z"] - pub fn SetCTypesActivityCallback(rt: *mut JSRuntime, + "?SetCTypesActivityCallback@js@@YAXPEAUJSContext@@P6AX0W4CTypesActivityType@1@@Z@Z"] + pub fn SetCTypesActivityCallback(cx: *mut JSContext, cb: CTypesActivityCallback); /** * Specify a callback to invoke when creating each JS object in the current @@ -10364,8 +10441,8 @@ extern "C" { * Tell the JS engine which Class is used for WindowProxy objects. Used by the * functions below. */ - #[link_name = "?SetWindowProxyClass@js@@YAXPEAUJSRuntime@@PEBUClass@1@@Z"] - pub fn SetWindowProxyClass(rt: *mut JSRuntime, clasp: *const Class); + #[link_name = "?SetWindowProxyClass@js@@YAXPEAUJSContext@@PEBUClass@1@@Z"] + pub fn SetWindowProxyClass(cx: *mut JSContext, clasp: *const Class); /** * Associates a WindowProxy with a Window (global object). `windowProxy` must * have the Class set by SetWindowProxyClass. @@ -10458,6 +10535,9 @@ extern "C" { "?OrdinaryToPrimitive@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@W4JSType@@V?$MutableHandle@VValue@JS@@@1@@Z"] pub fn OrdinaryToPrimitive(cx: *mut JSContext, obj: HandleObject, type_: JSType, vp: MutableHandleValue) -> bool; + #[link_name = "?InitWithFailureDiagnostic@detail@JS@@YAPEBD_N@Z"] + pub fn InitWithFailureDiagnostic(isDebugBuild: bool) + -> *const ::std::os::raw::c_char; /** * This function can be used to track memory used by ICU. If it is called, it * *must* be called before JS_Init. Don't use it unless you know what you're @@ -10469,28 +10549,6 @@ extern "C" { reallocFn: JS_ICUReallocFn, freeFn: JS_ICUFreeFn) -> bool; /** - * Initialize SpiderMonkey, returning true only if initialization succeeded. - * Once this method has succeeded, it is safe to call JS_NewRuntime and other - * JSAPI methods. - * - * This method must be called before any other JSAPI method is used on any - * thread. Once it has been used, it is safe to call any JSAPI method, and it - * remains safe to do so until JS_ShutDown is correctly called. - * - * It is currently not possible to initialize SpiderMonkey multiple times (that - * is, calling JS_Init/JSAPI methods/JS_ShutDown in that order, then doing so - * again). This restriction may eventually be lifted. - */ - #[link_name = "?JS_Init@@YA_NXZ"] - pub fn JS_Init() -> bool; - /** - * A variant of JS_Init. On success it returns nullptr. On failure it returns a - * pointer to a string literal that describes how initialization failed, which - * can be useful for debugging purposes. - */ - #[link_name = "?JS_InitWithFailureDiagnostic@@YAPEBDXZ"] - pub fn JS_InitWithFailureDiagnostic() -> *const ::std::os::raw::c_char; - /** * Destroy free-standing resources allocated by SpiderMonkey, not associated * with any runtime, context, or other structure. * @@ -10521,25 +10579,25 @@ extern "C" { #[link_name = "?MemoryReportingSundriesThreshold@js@@YA_KXZ"] pub fn MemoryReportingSundriesThreshold() -> usize; #[link_name = - "?CollectRuntimeStats@JS@@YA_NPEAUJSRuntime@@PEAURuntimeStats@1@PEAVObjectPrivateVisitor@1@_N@Z"] - pub fn CollectRuntimeStats(rt: *mut JSRuntime, rtStats: *mut RuntimeStats, + "?CollectRuntimeStats@JS@@YA_NPEAUJSContext@@PEAURuntimeStats@1@PEAVObjectPrivateVisitor@1@_N@Z"] + pub fn CollectRuntimeStats(cx: *mut JSContext, rtStats: *mut RuntimeStats, opv: *mut ObjectPrivateVisitor, anonymize: bool) -> bool; - #[link_name = "?SystemCompartmentCount@JS@@YA_KPEAUJSRuntime@@@Z"] - pub fn SystemCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "?UserCompartmentCount@JS@@YA_KPEAUJSRuntime@@@Z"] - pub fn UserCompartmentCount(rt: *mut JSRuntime) -> usize; - #[link_name = "?PeakSizeOfTemporary@JS@@YA_KPEBUJSRuntime@@@Z"] - pub fn PeakSizeOfTemporary(rt: *const JSRuntime) -> usize; - #[link_name = - "?AddSizeOfTab@JS@@YA_NPEAUJSRuntime@@V?$Handle@PEAVJSObject@@@1@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUTabSizes@1@@Z"] - pub fn AddSizeOfTab(rt: *mut JSRuntime, obj: HandleObject, + #[link_name = "?SystemCompartmentCount@JS@@YA_KPEAUJSContext@@@Z"] + pub fn SystemCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "?UserCompartmentCount@JS@@YA_KPEAUJSContext@@@Z"] + pub fn UserCompartmentCount(cx: *mut JSContext) -> usize; + #[link_name = "?PeakSizeOfTemporary@JS@@YA_KPEBUJSContext@@@Z"] + pub fn PeakSizeOfTemporary(cx: *const JSContext) -> usize; + #[link_name = + "?AddSizeOfTab@JS@@YA_NPEAUJSContext@@V?$Handle@PEAVJSObject@@@1@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUTabSizes@1@@Z"] + pub fn AddSizeOfTab(cx: *mut JSContext, obj: HandleObject, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut TabSizes) -> bool; #[link_name = - "?AddServoSizeOf@JS@@YA_NPEAUJSRuntime@@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUServoSizes@1@@Z"] - pub fn AddServoSizeOf(rt: *mut JSRuntime, mallocSizeOf: MallocSizeOf, + "?AddServoSizeOf@JS@@YA_NPEAUJSContext@@P6A_KPEBX@ZPEAVObjectPrivateVisitor@1@PEAUServoSizes@1@@Z"] + pub fn AddServoSizeOf(cx: *mut JSContext, mallocSizeOf: MallocSizeOf, opv: *mut ObjectPrivateVisitor, sizes: *mut ServoSizes) -> bool; }