Changeset 239557 in webkit
- Timestamp:
- Dec 28, 2018 8:24:29 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r239191 r239557 188 188 private: 189 189 static String className(const JSObject*, VM&); 190 static String toStringName(const JSObject*, ExecState*); 190 191 191 192 static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r237009 r239557 141 141 142 142 template <class Parent> 143 String JSCallbackObject<Parent>::toStringName(const JSObject* object, ExecState* exec) 144 { 145 VM& vm = exec->vm(); 146 const ClassInfo* info = object->classInfo(vm); 147 ASSERT(info); 148 return info->methodTable.className(object, vm); 149 } 150 151 template <class Parent> 143 152 bool JSCallbackObject<Parent>::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 144 153 { -
trunk/Source/JavaScriptCore/ChangeLog
r239556 r239557 1 2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 3 [JSC] Remove one indirection in JSObject::toStringName 4 https://bugs.webkit.org/show_bug.cgi?id=193037 5 6 Reviewed by Keith Miller. 7 8 We should not have additional one-level indirection in JSObject::toStringName. 9 JSObject::toStringName is dispatched through methodTable. Even after that, we 10 need to call JSObject::className function through methodTable again. But className 11 function is rarely defined. So instead of introducing this indirection here, 12 classes having className functions should have toStringName function too. This can 13 remove one-level indirection in toStringName in major cases. 14 15 * API/JSCallbackObject.h: 16 * API/JSCallbackObjectFunctions.h: 17 (JSC::JSCallbackObject<Parent>::toStringName): 18 * debugger/DebuggerScope.cpp: 19 (JSC::DebuggerScope::toStringName): 20 * debugger/DebuggerScope.h: 21 * runtime/JSObject.cpp: 22 (JSC::JSObject::toStringName): 23 1 24 2018-12-27 Alex Christensen <achristensen@webkit.org> 2 25 -
trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp
r233765 r239557 78 78 } 79 79 80 String DebuggerScope::toStringName(const JSObject* object, ExecState* exec) 81 { 82 const DebuggerScope* scope = jsCast<const DebuggerScope*>(object); 83 // We cannot assert that scope->isValid() because the TypeProfiler may encounter an invalidated 84 // DebuggerScope in its log entries. We just need to handle it appropriately as below. 85 if (!scope->isValid()) 86 return String(); 87 JSObject* thisObject = JSScope::objectAtScope(scope->jsScope()); 88 return thisObject->methodTable(exec->vm())->toStringName(thisObject, exec); 89 } 90 80 91 bool DebuggerScope::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) 81 92 { -
trunk/Source/JavaScriptCore/debugger/DebuggerScope.h
r233765 r239557 43 43 static void visitChildren(JSCell*, SlotVisitor&); 44 44 static String className(const JSObject*, VM&); 45 static String toStringName(const JSObject*, ExecState*); 45 46 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 46 47 static bool put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r239427 r239557 520 520 const ClassInfo* info = object->classInfo(vm); 521 521 ASSERT(info); 522 return info-> methodTable.className(object, vm);522 return info->className; 523 523 } 524 524 -
trunk/Source/WebCore/ChangeLog
r239556 r239557 1 2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 3 [JSC] Remove one indirection in JSObject::toStringName 4 https://bugs.webkit.org/show_bug.cgi?id=193037 5 6 Reviewed by Keith Miller. 7 8 Use old JSObject::toStringName function here. 9 10 * bindings/js/JSDOMConstructorBase.cpp: 11 (WebCore::JSDOMConstructorBase::className): 12 (WebCore::JSDOMConstructorBase::toStringName): 13 * bindings/js/JSDOMConstructorBase.h: 14 (WebCore::JSDOMConstructorBase::className): Deleted. 15 1 16 2018-12-27 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.cpp
r233122 r239557 44 44 } 45 45 46 String JSDOMConstructorBase::className(const JSObject*, JSC::VM&) 47 { 48 return "Function"_s; 49 } 50 51 String JSDOMConstructorBase::toStringName(const JSObject* object, JSC::ExecState* exec) 52 { 53 VM& vm = exec->vm(); 54 const ClassInfo* info = object->classInfo(vm); 55 ASSERT(info); 56 return info->methodTable.className(object, vm); 57 } 58 46 59 } // namespace WebCore -
trunk/Source/WebCore/bindings/js/JSDOMConstructorBase.h
r233765 r239557 39 39 40 40 static String className(const JSObject*, JSC::VM&); 41 static String toStringName(const JSObject*, JSC::ExecState*); 41 42 static JSC::CallType getCallData(JSCell*, JSC::CallData&); 42 43 }; … … 47 48 } 48 49 49 inline String JSDOMConstructorBase::className(const JSObject*, JSC::VM&)50 {51 return "Function"_s;52 }53 54 50 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.