mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #23299 - jdm:minimize-mozjs-deps, r=Manishearth
Remove mozjs dep from malloc_size_of. This makes making local changes to mozjs_sys much more frustrating than it should be, and blocks merging #22130. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23299) <!-- Reviewable:end -->
This commit is contained in:
commit
64c848950c
21 changed files with 30 additions and 16 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2580,7 +2580,6 @@ dependencies = [
|
||||||
"hyper 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper_serde 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"keyboard-types 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"keyboard-types 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"mozjs 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"selectors 0.21.0",
|
"selectors 0.21.0",
|
||||||
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -14,7 +14,6 @@ servo = [
|
||||||
"hyper",
|
"hyper",
|
||||||
"hyper_serde",
|
"hyper_serde",
|
||||||
"keyboard-types",
|
"keyboard-types",
|
||||||
"mozjs",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"string_cache",
|
"string_cache",
|
||||||
|
@ -33,7 +32,6 @@ hashglobe = { path = "../hashglobe" }
|
||||||
hyper = { version = "0.12", optional = true }
|
hyper = { version = "0.12", optional = true }
|
||||||
hyper_serde = { version = "0.9", optional = true }
|
hyper_serde = { version = "0.9", optional = true }
|
||||||
keyboard-types = {version = "0.4.3", optional = true}
|
keyboard-types = {version = "0.4.3", optional = true}
|
||||||
mozjs = { version = "0.10.0", optional = true}
|
|
||||||
selectors = { path = "../selectors" }
|
selectors = { path = "../selectors" }
|
||||||
serde = { version = "1.0.27", optional = true }
|
serde = { version = "1.0.27", optional = true }
|
||||||
serde_bytes = { version = "0.10", optional = true }
|
serde_bytes = { version = "0.10", optional = true }
|
||||||
|
|
|
@ -58,8 +58,6 @@ extern crate hyper;
|
||||||
extern crate hyper_serde;
|
extern crate hyper_serde;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
extern crate keyboard_types;
|
extern crate keyboard_types;
|
||||||
#[cfg(feature = "servo")]
|
|
||||||
extern crate mozjs as js;
|
|
||||||
extern crate selectors;
|
extern crate selectors;
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
extern crate serde;
|
extern crate serde;
|
||||||
|
@ -798,15 +796,6 @@ impl<Static: string_cache::StaticAtomSet> MallocSizeOf for string_cache::Atom<St
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is measured properly by the heap measurement implemented in
|
|
||||||
// SpiderMonkey.
|
|
||||||
#[cfg(feature = "servo")]
|
|
||||||
impl<T: Copy + js::rust::GCMethods> MallocSizeOf for js::jsapi::Heap<T> {
|
|
||||||
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
|
||||||
0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// For use on types where size_of() returns 0.
|
/// For use on types where size_of() returns 0.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! malloc_size_of_is_0(
|
macro_rules! malloc_size_of_is_0(
|
||||||
|
|
|
@ -42,6 +42,7 @@ type JSAudioChannel = Heap<*mut JSObject>;
|
||||||
pub struct AudioBuffer {
|
pub struct AudioBuffer {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
/// Float32Arrays returned by calls to GetChannelData.
|
/// Float32Arrays returned by calls to GetChannelData.
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
js_channels: DomRefCell<Vec<JSAudioChannel>>,
|
js_channels: DomRefCell<Vec<JSAudioChannel>>,
|
||||||
/// Aggregates the data from js_channels.
|
/// Aggregates the data from js_channels.
|
||||||
/// This is Some<T> iff the buffers in js_channels are detached.
|
/// This is Some<T> iff the buffers in js_channels are detached.
|
||||||
|
|
|
@ -719,7 +719,7 @@ pub enum CustomElementReaction {
|
||||||
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
|
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
|
||||||
Callback(
|
Callback(
|
||||||
#[ignore_malloc_size_of = "Rc"] Rc<Function>,
|
#[ignore_malloc_size_of = "Rc"] Rc<Function>,
|
||||||
Box<[Heap<JSVal>]>,
|
#[ignore_malloc_size_of = "mozjs"] Box<[Heap<JSVal>]>,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ use servo_atoms::Atom;
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct ExtendableMessageEvent {
|
pub struct ExtendableMessageEvent {
|
||||||
event: ExtendableEvent,
|
event: ExtendableEvent,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
data: Heap<JSVal>,
|
data: Heap<JSVal>,
|
||||||
origin: DOMString,
|
origin: DOMString,
|
||||||
lastEventId: DOMString,
|
lastEventId: DOMString,
|
||||||
|
|
|
@ -83,7 +83,7 @@ pub enum FileReaderReadyState {
|
||||||
|
|
||||||
#[derive(JSTraceable, MallocSizeOf)]
|
#[derive(JSTraceable, MallocSizeOf)]
|
||||||
pub enum FileReaderResult {
|
pub enum FileReaderResult {
|
||||||
ArrayBuffer(Heap<JSVal>),
|
ArrayBuffer(#[ignore_malloc_size_of = "mozjs"] Heap<JSVal>),
|
||||||
String(DOMString),
|
String(DOMString),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ pub struct Gamepad {
|
||||||
connected: Cell<bool>,
|
connected: Cell<bool>,
|
||||||
timestamp: Cell<f64>,
|
timestamp: Cell<f64>,
|
||||||
mapping_type: String,
|
mapping_type: String,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
axes: Heap<*mut JSObject>,
|
axes: Heap<*mut JSObject>,
|
||||||
buttons: Dom<GamepadButtonList>,
|
buttons: Dom<GamepadButtonList>,
|
||||||
pose: Option<Dom<VRPose>>,
|
pose: Option<Dom<VRPose>>,
|
||||||
|
|
|
@ -145,6 +145,7 @@ pub struct GlobalScope {
|
||||||
/// they're consumed before it'd be reported.
|
/// they're consumed before it'd be reported.
|
||||||
///
|
///
|
||||||
/// <https://html.spec.whatwg.org/multipage/#about-to-be-notified-rejected-promises-list>
|
/// <https://html.spec.whatwg.org/multipage/#about-to-be-notified-rejected-promises-list>
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
uncaught_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
|
uncaught_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
|
||||||
|
|
||||||
/// Promises in this list have previously been reported as rejected
|
/// Promises in this list have previously been reported as rejected
|
||||||
|
@ -152,6 +153,7 @@ pub struct GlobalScope {
|
||||||
/// in the last turn of the event loop.
|
/// in the last turn of the event loop.
|
||||||
///
|
///
|
||||||
/// <https://html.spec.whatwg.org/multipage/#outstanding-rejected-promises-weak-set>
|
/// <https://html.spec.whatwg.org/multipage/#outstanding-rejected-promises-weak-set>
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
consumed_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
|
consumed_rejections: DomRefCell<Vec<Box<Heap<*mut JSObject>>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ enum PushOrReplace {
|
||||||
pub struct History {
|
pub struct History {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
window: Dom<Window>,
|
window: Dom<Window>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
state: Heap<JSVal>,
|
state: Heap<JSVal>,
|
||||||
state_id: Cell<Option<HistoryStateId>>,
|
state_id: Cell<Option<HistoryStateId>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ pub struct ImageData {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
width: u32,
|
width: u32,
|
||||||
height: u32,
|
height: u32,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
data: Heap<*mut JSObject>,
|
data: Heap<*mut JSObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ use std::ptr::NonNull;
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct MessageEvent {
|
pub struct MessageEvent {
|
||||||
event: Event,
|
event: Event,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
data: Heap<JSVal>,
|
data: Heap<JSVal>,
|
||||||
origin: DOMString,
|
origin: DOMString,
|
||||||
source: Option<Dom<WindowProxy>>,
|
source: Option<Dom<WindowProxy>>,
|
||||||
|
|
|
@ -76,6 +76,7 @@ pub struct PaintWorkletGlobalScope {
|
||||||
/// <https://drafts.css-houdini.org/css-paint-api/#paint-definitions>
|
/// <https://drafts.css-houdini.org/css-paint-api/#paint-definitions>
|
||||||
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
|
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
|
||||||
/// <https://drafts.css-houdini.org/css-paint-api/#paint-class-instances>
|
/// <https://drafts.css-houdini.org/css-paint-api/#paint-class-instances>
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>,
|
paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>,
|
||||||
/// The most recent name the worklet was called with
|
/// The most recent name the worklet was called with
|
||||||
cached_name: DomRefCell<Atom>,
|
cached_name: DomRefCell<Atom>,
|
||||||
|
@ -473,7 +474,9 @@ pub enum PaintWorkletTask {
|
||||||
#[derive(JSTraceable, MallocSizeOf)]
|
#[derive(JSTraceable, MallocSizeOf)]
|
||||||
#[must_root]
|
#[must_root]
|
||||||
struct PaintDefinition {
|
struct PaintDefinition {
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
class_constructor: Heap<JSVal>,
|
class_constructor: Heap<JSVal>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
paint_function: Heap<JSVal>,
|
paint_function: Heap<JSVal>,
|
||||||
constructor_valid_flag: Cell<bool>,
|
constructor_valid_flag: Cell<bool>,
|
||||||
context_alpha_flag: bool,
|
context_alpha_flag: bool,
|
||||||
|
|
|
@ -22,6 +22,7 @@ pub struct VREyeParameters {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
#[ignore_malloc_size_of = "Defined in rust-webvr"]
|
#[ignore_malloc_size_of = "Defined in rust-webvr"]
|
||||||
parameters: DomRefCell<WebVREyeParameters>,
|
parameters: DomRefCell<WebVREyeParameters>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
offset: Heap<*mut JSObject>,
|
offset: Heap<*mut JSObject>,
|
||||||
fov: Dom<VRFieldOfView>,
|
fov: Dom<VRFieldOfView>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,13 @@ use webvr_traits::WebVRFrameData;
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct VRFrameData {
|
pub struct VRFrameData {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
left_proj: Heap<*mut JSObject>,
|
left_proj: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
left_view: Heap<*mut JSObject>,
|
left_view: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
right_proj: Heap<*mut JSObject>,
|
right_proj: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
right_view: Heap<*mut JSObject>,
|
right_view: Heap<*mut JSObject>,
|
||||||
pose: Dom<VRPose>,
|
pose: Dom<VRPose>,
|
||||||
timestamp: Cell<f64>,
|
timestamp: Cell<f64>,
|
||||||
|
|
|
@ -17,11 +17,17 @@ use webvr_traits::webvr;
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct VRPose {
|
pub struct VRPose {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
position: Heap<*mut JSObject>,
|
position: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
orientation: Heap<*mut JSObject>,
|
orientation: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
linear_vel: Heap<*mut JSObject>,
|
linear_vel: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
angular_vel: Heap<*mut JSObject>,
|
angular_vel: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
linear_acc: Heap<*mut JSObject>,
|
linear_acc: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
angular_acc: Heap<*mut JSObject>,
|
angular_acc: Heap<*mut JSObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ pub struct VRStageParameters {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
#[ignore_malloc_size_of = "Defined in rust-webvr"]
|
#[ignore_malloc_size_of = "Defined in rust-webvr"]
|
||||||
parameters: DomRefCell<WebVRStageParameters>,
|
parameters: DomRefCell<WebVRStageParameters>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
transform: Heap<*mut JSObject>,
|
transform: Heap<*mut JSObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,7 @@ pub struct XMLHttpRequest {
|
||||||
response_type: Cell<XMLHttpRequestResponseType>,
|
response_type: Cell<XMLHttpRequestResponseType>,
|
||||||
response_xml: MutNullableDom<Document>,
|
response_xml: MutNullableDom<Document>,
|
||||||
response_blob: MutNullableDom<Blob>,
|
response_blob: MutNullableDom<Blob>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
response_arraybuffer: Heap<*mut JSObject>,
|
response_arraybuffer: Heap<*mut JSObject>,
|
||||||
#[ignore_malloc_size_of = "Defined in rust-mozjs"]
|
#[ignore_malloc_size_of = "Defined in rust-mozjs"]
|
||||||
response_json: Heap<JSVal>,
|
response_json: Heap<JSVal>,
|
||||||
|
|
|
@ -27,6 +27,7 @@ pub struct XRRigidTransform {
|
||||||
#[ignore_malloc_size_of = "defined in euclid"]
|
#[ignore_malloc_size_of = "defined in euclid"]
|
||||||
transform: RigidTransform3D<f64>,
|
transform: RigidTransform3D<f64>,
|
||||||
inverse: MutNullableDom<XRRigidTransform>,
|
inverse: MutNullableDom<XRRigidTransform>,
|
||||||
|
#[ignore_malloc_size_of = "defined in mozjs"]
|
||||||
matrix: Heap<*mut JSObject>,
|
matrix: Heap<*mut JSObject>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,9 @@ pub struct XRView {
|
||||||
reflector_: Reflector,
|
reflector_: Reflector,
|
||||||
session: Dom<XRSession>,
|
session: Dom<XRSession>,
|
||||||
eye: XREye,
|
eye: XREye,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
proj: Heap<*mut JSObject>,
|
proj: Heap<*mut JSObject>,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
view: Heap<*mut JSObject>,
|
view: Heap<*mut JSObject>,
|
||||||
transform: Dom<XRRigidTransform>,
|
transform: Dom<XRRigidTransform>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ use webvr_traits::WebVRFrameData;
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct XRViewerPose {
|
pub struct XRViewerPose {
|
||||||
pose: XRPose,
|
pose: XRPose,
|
||||||
|
#[ignore_malloc_size_of = "mozjs"]
|
||||||
views: Heap<JSVal>,
|
views: Heap<JSVal>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue