diff --git a/boa/src/builtins/value/mod.rs b/boa/src/builtins/value/mod.rs index 77b5de02efd..807b4fe9b27 100644 --- a/boa/src/builtins/value/mod.rs +++ b/boa/src/builtins/value/mod.rs @@ -398,6 +398,7 @@ impl ValueData { /// /// A copy of the Property is returned. pub fn get_property(&self, field: &str) -> Option { + let _timer = BoaProfiler::global().start_event("Value::get_property", "value"); // Spidermonkey has its own GetLengthProperty: https://searchfox.org/mozilla-central/source/js/src/vm/Interpreter-inl.h#154 // This is only for primitive strings, String() objects have their lengths calculated in string.rs if self.is_string() && field == "length" { @@ -444,6 +445,7 @@ impl ValueData { writable: Option, configurable: Option, ) { + let _timer = BoaProfiler::global().start_event("Value::update_property", "value"); let obj: Option = match self { Self::Object(ref obj) => Some(obj.borrow_mut().deref_mut().clone()), _ => None, @@ -464,6 +466,7 @@ impl ValueData { /// /// Returns a copy of the Property. pub fn get_internal_slot(&self, field: &str) -> Value { + let _timer = BoaProfiler::global().start_event("Value::get_internal_slot", "value"); let obj: Object = match *self { Self::Object(ref obj) => { let hash = obj.clone(); @@ -489,7 +492,7 @@ impl ValueData { where F: Into, { - let _timer = BoaProfiler::global().start_event("get_field", "value"); + let _timer = BoaProfiler::global().start_event("Value::get_field", "value"); match *field.into() { // Our field will either be a String or a Symbol Self::String(ref s) => { @@ -588,7 +591,7 @@ impl ValueData { /// Check to see if the Value has the field, mainly used by environment records pub fn has_field(&self, field: &str) -> bool { - let _timer = BoaProfiler::global().start_event("has_field", "value"); + let _timer = BoaProfiler::global().start_event("Value::has_field", "value"); self.get_property(field).is_some() } @@ -599,7 +602,7 @@ impl ValueData { F: Into, V: Into, { - let _timer = BoaProfiler::global().start_event("set_field", "value"); + let _timer = BoaProfiler::global().start_event("Value::set_field", "value"); let field = field.into(); let val = val.into(); @@ -629,7 +632,7 @@ impl ValueData { /// Set the private field in the value pub fn set_internal_slot(&self, field: &str, val: Value) -> Value { - let _timer = BoaProfiler::global().start_event("set_internal_slot", "exec"); + let _timer = BoaProfiler::global().start_event("Value::set_internal_slot", "exec"); if let Self::Object(ref obj) = *self { obj.borrow_mut() .internal_slots @@ -769,6 +772,7 @@ impl ValueData { /// /// https://tc39.es/ecma262/#sec-typeof-operator pub fn get_type(&self) -> &'static str { + let _timer = BoaProfiler::global().start_event("Value::get_type", "value"); match *self { Self::Rational(_) | Self::Integer(_) => "number", Self::String(_) => "string",