Changeset 207065 in webkit
- Timestamp:
- Oct 11, 2016 1:29:09 AM (8 years ago)
- Location:
- releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/ChangeLog
r207061 r207065 1 2016-09-09 Saam Barati <sbarati@apple.com> 2 3 Make hasOwnProperty ALWAYS_INLINE 4 https://bugs.webkit.org/show_bug.cgi?id=161775 5 6 Reviewed by Ryosuke Niwa. 7 8 Speedometer spends around 2.5% of its time in hasOwnProperty. 9 Let's reduce the overhead of calling that function by marking 10 it as inline. Also, it's likely that the function will call into 11 JSObject::getOwnPropertySlot. I added a check to see if that's 12 the function we're calling, if it is, we do a direct call instead 13 of an indirect call. 14 15 * runtime/JSObject.cpp: 16 (JSC::JSObject::hasOwnProperty): Deleted. 17 * runtime/JSObjectInlines.h: 18 (JSC::JSObject::hasOwnProperty): 19 1 20 2016-09-08 Filip Pizlo <fpizlo@apple.com> 2 21 -
releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSObject.cpp
r205717 r207065 1472 1472 1473 1473 return true; 1474 }1475 1476 // HasOwnProperty(O, P) from section 7.3.11 in the spec.1477 // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-hasownproperty1478 bool JSObject::hasOwnProperty(ExecState* exec, PropertyName propertyName) const1479 {1480 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty);1481 return const_cast<JSObject*>(this)->methodTable(exec->vm())->getOwnPropertySlot(const_cast<JSObject*>(this), exec, propertyName, slot);1482 }1483 1484 bool JSObject::hasOwnProperty(ExecState* exec, unsigned propertyName) const1485 {1486 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty);1487 return const_cast<JSObject*>(this)->methodTable(exec->vm())->getOwnPropertySlotByIndex(const_cast<JSObject*>(this), exec, propertyName, slot);1488 1474 } 1489 1475 -
releases/WebKitGTK/webkit-2.14/Source/JavaScriptCore/runtime/JSObjectInlines.h
r205717 r207065 194 194 } 195 195 196 // HasOwnProperty(O, P) from section 7.3.11 in the spec. 197 // http://www.ecma-international.org/ecma-262/6.0/index.html#sec-hasownproperty 198 ALWAYS_INLINE bool JSObject::hasOwnProperty(ExecState* exec, PropertyName propertyName) const 199 { 200 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty); 201 if (LIKELY(const_cast<JSObject*>(this)->methodTable(exec->vm())->getOwnPropertySlot == JSObject::getOwnPropertySlot)) 202 return JSObject::getOwnPropertySlot(const_cast<JSObject*>(this), exec, propertyName, slot); 203 return const_cast<JSObject*>(this)->methodTable(exec->vm())->getOwnPropertySlot(const_cast<JSObject*>(this), exec, propertyName, slot); 204 } 205 206 ALWAYS_INLINE bool JSObject::hasOwnProperty(ExecState* exec, unsigned propertyName) const 207 { 208 PropertySlot slot(this, PropertySlot::InternalMethodType::GetOwnProperty); 209 return const_cast<JSObject*>(this)->methodTable(exec->vm())->getOwnPropertySlotByIndex(const_cast<JSObject*>(this), exec, propertyName, slot); 210 } 211 196 212 } // namespace JSC 197 213
Note: See TracChangeset
for help on using the changeset viewer.