Changeset 96164 in webkit
- Timestamp:
- Sep 27, 2011 3:46:51 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 74 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp
r95936 r96164 78 78 } 79 79 80 CallType JSCallbackFunction::getCallData(CallData& callData) 80 CallType JSCallbackFunction::getCallDataVirtual(CallData& callData) 81 { 82 return getCallData(this, callData); 83 } 84 85 CallType JSCallbackFunction::getCallData(JSCell*, CallData& callData) 81 86 { 82 87 callData.native.function = call; -
trunk/Source/JavaScriptCore/API/JSCallbackFunction.h
r95108 r96164 57 57 58 58 private: 59 virtual CallType getCallData(CallData&); 59 virtual CallType getCallDataVirtual(CallData&); 60 static CallType getCallData(JSCell*, CallData&); 60 61 61 62 static EncodedJSValue JSC_HOST_CALL call(ExecState*); -
trunk/Source/JavaScriptCore/API/JSCallbackObject.h
r95849 r96164 195 195 196 196 virtual ConstructType getConstructData(ConstructData&); 197 virtual CallType getCallData(CallData&); 197 virtual CallType getCallDataVirtual(CallData&); 198 static CallType getCallData(JSCell*, CallData&); 198 199 199 200 virtual void visitChildrenVirtual(SlotVisitor& visitor) -
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r95250 r96164 373 373 374 374 template <class Parent> 375 CallType JSCallbackObject<Parent>::getCallData(CallData& callData) 376 { 377 for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) { 375 CallType JSCallbackObject<Parent>::getCallDataVirtual(CallData& callData) 376 { 377 return getCallData(this, callData); 378 } 379 380 template <class Parent> 381 CallType JSCallbackObject<Parent>::getCallData(JSCell* cell, CallData& callData) 382 { 383 JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell); 384 for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) { 378 385 if (jsClass->callAsFunction) { 379 386 callData.native.function = call; -
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r94701 r96164 417 417 { 418 418 CallData callData; 419 return toJS(object)->getCallData (callData) != CallTypeNone;419 return toJS(object)->getCallDataVirtual(callData) != CallTypeNone; 420 420 } 421 421 … … 436 436 437 437 CallData callData; 438 CallType callType = jsObject->getCallData (callData);438 CallType callType = jsObject->getCallDataVirtual(callData); 439 439 if (callType == CallTypeNone) 440 440 return 0; -
trunk/Source/JavaScriptCore/ChangeLog
r96151 r96164 1 2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=68741 5 6 Reviewed by Darin Adler. 7 8 In this patch we just extract the bodies of the virtual getCallData methods 9 throughout the JSCell inheritance hierarchy out into static methods, which are 10 now called from the virtual methods. This is an intermediate step in trying to 11 move the virtual-ness of getCallData into our own method table stored in 12 ClassInfo. We need to convert the methods to static methods because static methods 13 can be represented as function pointers rather than pointers to member functions, and 14 function pointers are smaller and faster to call than pointers to member functions. 15 16 * API/JSCallbackFunction.cpp: 17 (JSC::JSCallbackFunction::getCallDataVirtual): 18 (JSC::JSCallbackFunction::getCallData): 19 * API/JSCallbackFunction.h: 20 * API/JSCallbackObject.h: 21 * API/JSCallbackObjectFunctions.h: 22 (JSC::::getCallDataVirtual): 23 (JSC::::getCallData): 24 * API/JSObjectRef.cpp: 25 (JSObjectIsFunction): 26 (JSObjectCallAsFunction): 27 * JavaScriptCore.exp: 28 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 29 * interpreter/Interpreter.cpp: 30 (JSC::Interpreter::privateExecute): 31 * jit/JITStubs.cpp: 32 (JSC::DEFINE_STUB_FUNCTION): 33 * runtime/ArrayConstructor.cpp: 34 (JSC::ArrayConstructor::getCallDataVirtual): 35 (JSC::ArrayConstructor::getCallData): 36 * runtime/ArrayConstructor.h: 37 * runtime/BooleanConstructor.cpp: 38 (JSC::BooleanConstructor::getCallDataVirtual): 39 (JSC::BooleanConstructor::getCallData): 40 * runtime/BooleanConstructor.h: 41 * runtime/DateConstructor.cpp: 42 (JSC::DateConstructor::getCallDataVirtual): 43 (JSC::DateConstructor::getCallData): 44 * runtime/DateConstructor.h: 45 * runtime/Error.cpp: 46 (JSC::StrictModeTypeErrorFunction::getCallDataVirtual): 47 (JSC::StrictModeTypeErrorFunction::getCallData): 48 * runtime/ErrorConstructor.cpp: 49 (JSC::ErrorConstructor::getCallDataVirtual): 50 (JSC::ErrorConstructor::getCallData): 51 * runtime/ErrorConstructor.h: 52 * runtime/FunctionConstructor.cpp: 53 (JSC::FunctionConstructor::getCallDataVirtual): 54 (JSC::FunctionConstructor::getCallData): 55 * runtime/FunctionConstructor.h: 56 * runtime/FunctionPrototype.cpp: 57 (JSC::FunctionPrototype::getCallDataVirtual): 58 (JSC::FunctionPrototype::getCallData): 59 * runtime/FunctionPrototype.h: 60 * runtime/InternalFunction.h: 61 * runtime/JSCell.cpp: 62 (JSC::JSCell::getCallDataVirtual): 63 (JSC::JSCell::getCallData): 64 * runtime/JSCell.h: 65 (JSC::getCallData): 66 * runtime/JSFunction.cpp: 67 (JSC::JSFunction::getCallDataVirtual): 68 (JSC::JSFunction::getCallData): 69 * runtime/JSFunction.h: 70 * runtime/JSONObject.cpp: 71 (JSC::Stringifier::Stringifier): 72 (JSC::Stringifier::toJSON): 73 (JSC::Stringifier::appendStringifiedValue): 74 * runtime/JSObject.cpp: 75 (JSC::JSObject::put): 76 * runtime/NativeErrorConstructor.cpp: 77 (JSC::NativeErrorConstructor::getCallDataVirtual): 78 (JSC::NativeErrorConstructor::getCallData): 79 * runtime/NativeErrorConstructor.h: 80 * runtime/NumberConstructor.cpp: 81 (JSC::NumberConstructor::getCallDataVirtual): 82 (JSC::NumberConstructor::getCallData): 83 * runtime/NumberConstructor.h: 84 * runtime/ObjectConstructor.cpp: 85 (JSC::ObjectConstructor::getCallDataVirtual): 86 (JSC::ObjectConstructor::getCallData): 87 * runtime/ObjectConstructor.h: 88 * runtime/Operations.cpp: 89 (JSC::jsTypeStringForValue): 90 (JSC::jsIsObjectType): 91 (JSC::jsIsFunctionType): 92 * runtime/PropertySlot.cpp: 93 (JSC::PropertySlot::functionGetter): 94 * runtime/RegExpConstructor.cpp: 95 (JSC::RegExpConstructor::getCallDataVirtual): 96 (JSC::RegExpConstructor::getCallData): 97 * runtime/RegExpConstructor.h: 98 * runtime/StringConstructor.cpp: 99 (JSC::StringConstructor::getCallDataVirtual): 100 (JSC::StringConstructor::getCallData): 101 * runtime/StringConstructor.h: 102 1 103 2011-09-27 Tim Horton <timothy_horton@apple.com> 2 104 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r96146 r96164 253 253 __ZN3JSC4Yarr9interpretEPNS0_15BytecodePatternERKNS_7UStringEjjPi 254 254 __ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE 255 __ZN3JSC6JSCell11getCallDataERNS_8CallDataE256 255 __ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 257 256 __ZN3JSC6JSCell14deletePropertyEPNS_9ExecStateEj 258 257 __ZN3JSC6JSCell16getConstructDataERNS_13ConstructDataE 258 __ZN3JSC6JSCell18getCallDataVirtualERNS_8CallDataE 259 259 __ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 260 260 __ZN3JSC6JSCell18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r96146 r96164 187 187 ?get@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@AAIAAPAVJSCell@2@@Z 188 188 ?get@Structure@JSC@@QAEIAAVJSGlobalData@2@PAVStringImpl@WTF@@AAIAAPAVJSCell@2@@Z 189 ?getCallData @JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z189 ?getCallDataVirtual@JSCell@JSC@@UAE?AW4CallType@2@AATCallData@2@@Z 190 190 ?getConstructData@JSCell@JSC@@UAE?AW4ConstructType@2@AATConstructData@2@@Z 191 191 ?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r96146 r96164 2830 2830 JSObject* getter = getterSetter->getter(); 2831 2831 CallData callData; 2832 CallType callType = getter->getCallData (callData);2832 CallType callType = getter->getCallDataVirtual(callData); 2833 2833 JSValue result = call(callFrame, getter, callType, callData, asObject(baseCell), ArgList()); 2834 2834 CHECK_FOR_EXCEPTION(); … … 2965 2965 JSObject* getter = getterSetter->getter(); 2966 2966 CallData callData; 2967 CallType callType = getter->getCallData (callData);2967 CallType callType = getter->getCallDataVirtual(callData); 2968 2968 JSValue result = call(callFrame, getter, callType, callData, baseObject, ArgList()); 2969 2969 CHECK_FOR_EXCEPTION(); … … 3073 3073 JSObject* getter = getterSetter->getter(); 3074 3074 CallData callData; 3075 CallType callType = getter->getCallData (callData);3075 CallType callType = getter->getCallDataVirtual(callData); 3076 3076 JSValue result = call(callFrame, getter, callType, callData, baseValue, ArgList()); 3077 3077 CHECK_FOR_EXCEPTION(); -
trunk/Source/JavaScriptCore/jit/JITStubs.cpp
r95901 r96164 1756 1756 JSObject* getter = asObject(getterSetter->getter()); 1757 1757 CallData callData; 1758 CallType callType = getter->getCallData (callData);1758 CallType callType = getter->getCallDataVirtual(callData); 1759 1759 JSValue result = call(callFrame, getter, callType, callData, stackFrame.args[1].jsObject(), ArgList()); 1760 1760 if (callFrame->hadException()) … … 2159 2159 #if !ASSERT_DISABLED 2160 2160 CallData callData; 2161 ASSERT(stackFrame.callFrame->callee()->getCallData (callData) == CallTypeJS);2161 ASSERT(stackFrame.callFrame->callee()->getCallDataVirtual(callData) == CallTypeJS); 2162 2162 #endif 2163 2163 -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp
r95936 r96164 110 110 } 111 111 112 CallType ArrayConstructor::getCallData(CallData& callData) 112 CallType ArrayConstructor::getCallDataVirtual(CallData& callData) 113 { 114 return getCallData(this, callData); 115 } 116 117 CallType ArrayConstructor::getCallData(JSCell*, CallData& callData) 113 118 { 114 119 // equivalent to 'new Array(....)' -
trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h
r95108 r96164 56 56 57 57 virtual ConstructType getConstructData(ConstructData&); 58 virtual CallType getCallData(CallData&); 58 virtual CallType getCallDataVirtual(CallData&); 59 static CallType getCallData(JSCell*, CallData&); 59 60 }; 60 61 -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp
r95108 r96164 69 69 } 70 70 71 CallType BooleanConstructor::getCallData(CallData& callData) 71 CallType BooleanConstructor::getCallDataVirtual(CallData& callData) 72 { 73 return getCallData(this, callData); 74 } 75 76 CallType BooleanConstructor::getCallData(JSCell*, CallData& callData) 72 77 { 73 78 callData.native.function = callBooleanConstructor; -
trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h
r95108 r96164 45 45 BooleanConstructor(JSGlobalObject*, Structure*); 46 46 virtual ConstructType getConstructData(ConstructData&); 47 virtual CallType getCallData(CallData&); 47 virtual CallType getCallDataVirtual(CallData&); 48 static CallType getCallData(JSCell*, CallData&); 48 49 }; 49 50 -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r95936 r96164 177 177 } 178 178 179 CallType DateConstructor::getCallData(CallData& callData) 179 CallType DateConstructor::getCallDataVirtual(CallData& callData) 180 { 181 return getCallData(this, callData); 182 } 183 184 CallType DateConstructor::getCallData(JSCell*, CallData& callData) 180 185 { 181 186 callData.native.function = callDate; -
trunk/Source/JavaScriptCore/runtime/DateConstructor.h
r95108 r96164 53 53 DateConstructor(JSGlobalObject*, Structure*); 54 54 virtual ConstructType getConstructData(ConstructData&); 55 virtual CallType getCallData(CallData&); 55 virtual CallType getCallDataVirtual(CallData&); 56 static CallType getCallData(JSCell*, CallData&); 56 57 57 58 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/Source/JavaScriptCore/runtime/Error.cpp
r96146 r96164 202 202 } 203 203 204 CallType getCallData(CallData& callData) 204 CallType getCallDataVirtual(CallData& callData) 205 { 206 return getCallData(this, callData); 207 } 208 209 CallType getCallData(JSCell*, CallData& callData) 205 210 { 206 211 callData.native.function = callThrowTypeError; -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp
r95108 r96164 65 65 } 66 66 67 CallType ErrorConstructor::getCallData(CallData& callData) 67 CallType ErrorConstructor::getCallDataVirtual(CallData& callData) 68 { 69 return getCallData(this, callData); 70 } 71 72 CallType ErrorConstructor::getCallData(JSCell*, CallData& callData) 68 73 { 69 74 callData.native.function = callErrorConstructor; -
trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h
r95108 r96164 46 46 ErrorConstructor(JSGlobalObject*, Structure*); 47 47 virtual ConstructType getConstructData(ConstructData&); 48 virtual CallType getCallData(CallData&); 48 virtual CallType getCallDataVirtual(CallData&); 49 static CallType getCallData(JSCell*, CallData&); 49 50 }; 50 51 -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp
r95108 r96164 70 70 } 71 71 72 CallType FunctionConstructor::getCallDataVirtual(CallData& callData) 73 { 74 return getCallData(this, callData); 75 } 76 72 77 // ECMA 15.3.1 The Function Constructor Called as a Function 73 CallType FunctionConstructor::getCallData( CallData& callData)78 CallType FunctionConstructor::getCallData(JSCell*, CallData& callData) 74 79 { 75 80 callData.native.function = callFunctionConstructor; -
trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h
r95108 r96164 43 43 void finishCreation(ExecState*, FunctionPrototype*); 44 44 virtual ConstructType getConstructData(ConstructData&); 45 virtual CallType getCallData(CallData&); 45 virtual CallType getCallDataVirtual(CallData&); 46 static CallType getCallData(JSCell*, CallData&); 46 47 }; 47 48 -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp
r95764 r96164 71 71 } 72 72 73 CallType FunctionPrototype::getCallDataVirtual(CallData& callData) 74 { 75 return getCallData(this, callData); 76 } 77 73 78 // ECMA 15.3.4 74 CallType FunctionPrototype::getCallData( CallData& callData)79 CallType FunctionPrototype::getCallData(JSCell*, CallData& callData) 75 80 { 76 81 callData.native.function = callFunctionPrototype; -
trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h
r95751 r96164 49 49 private: 50 50 FunctionPrototype(JSGlobalObject*, Structure*); 51 virtual CallType getCallData(CallData&); 51 virtual CallType getCallDataVirtual(CallData&); 52 static CallType getCallData(JSCell*, CallData&); 52 53 }; 53 54 -
trunk/Source/JavaScriptCore/runtime/InternalFunction.h
r94929 r96164 58 58 59 59 private: 60 virtual CallType getCallData (CallData&) = 0;60 virtual CallType getCallDataVirtual(CallData&) = 0; 61 61 62 62 virtual void vtableAnchor(); -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r96143 r96164 55 55 } 56 56 57 CallType JSCell::getCallData(CallData&) 57 CallType JSCell::getCallDataVirtual(CallData& callData) 58 { 59 return getCallData(this, callData); 60 } 61 62 CallType JSCell::getCallData(JSCell*, CallData&) 58 63 { 59 64 return CallTypeNone; -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r96143 r96164 74 74 const JSObject* getObject() const; // NULL if not an object 75 75 76 virtual CallType getCallData(CallData&); 76 virtual CallType getCallDataVirtual(CallData&); 77 static CallType getCallData(JSCell*, CallData&); 77 78 virtual ConstructType getConstructData(ConstructData&); 78 79 … … 236 237 inline CallType getCallData(JSValue value, CallData& callData) 237 238 { 238 CallType result = value.isCell() ? value.asCell()->getCallData (callData) : CallTypeNone;239 CallType result = value.isCell() ? value.asCell()->getCallDataVirtual(callData) : CallTypeNone; 239 240 ASSERT(result == CallTypeNone || value.isValidCallee()); 240 241 return result; -
trunk/Source/JavaScriptCore/runtime/JSFunction.cpp
r95936 r96164 170 170 } 171 171 172 CallType JSFunction::getCallData(CallData& callData) 173 { 174 if (isHostFunction()) { 175 callData.native.function = nativeFunction(); 172 CallType JSFunction::getCallDataVirtual(CallData& callData) 173 { 174 return getCallData(this, callData); 175 } 176 177 CallType JSFunction::getCallData(JSCell* cell, CallData& callData) 178 { 179 JSFunction* thisObject = static_cast<JSFunction*>(cell); 180 if (thisObject->isHostFunction()) { 181 callData.native.function = thisObject->nativeFunction(); 176 182 return CallTypeHost; 177 183 } 178 callData.js.functionExecutable = jsExecutable();179 callData.js.scopeChain = scope();184 callData.js.functionExecutable = thisObject->jsExecutable(); 185 callData.js.scopeChain = thisObject->scope(); 180 186 return CallTypeJS; 181 187 } -
trunk/Source/JavaScriptCore/runtime/JSFunction.h
r95849 r96164 110 110 111 111 virtual ConstructType getConstructData(ConstructData&); 112 virtual CallType getCallData(CallData&); 112 virtual CallType getCallDataVirtual(CallData&); 113 static CallType getCallData(JSCell*, CallData&); 113 114 114 115 static inline size_t offsetOfScopeChain() -
trunk/Source/JavaScriptCore/runtime/JSONObject.cpp
r95936 r96164 247 247 } 248 248 249 m_replacerCallType = m_replacer.asObject()->getCallData (m_replacerCallData);249 m_replacerCallType = m_replacer.asObject()->getCallDataVirtual(m_replacerCallData); 250 250 } 251 251 … … 338 338 JSObject* object = asObject(toJSONFunction); 339 339 CallData callData; 340 CallType callType = object->getCallData (callData);340 CallType callType = object->getCallDataVirtual(callData); 341 341 if (callType == CallTypeNone) 342 342 return value; … … 402 402 403 403 CallData callData; 404 if (object->getCallData (callData) != CallTypeNone) {404 if (object->getCallDataVirtual(callData) != CallTypeNone) { 405 405 if (holder->inherits(&JSArray::s_info)) { 406 406 builder.append("null"); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r96143 r96164 159 159 160 160 CallData callData; 161 CallType callType = setterFunc->getCallData (callData);161 CallType callType = setterFunc->getCallDataVirtual(callData); 162 162 MarkedArgumentBuffer args; 163 163 args.append(value); -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
r95936 r96164 75 75 } 76 76 77 CallType NativeErrorConstructor::getCallData(CallData& callData) 77 CallType NativeErrorConstructor::getCallDataVirtual(CallData& callData) 78 { 79 return getCallData(this, callData); 80 } 81 82 CallType NativeErrorConstructor::getCallData(JSCell*, CallData& callData) 78 83 { 79 84 callData.native.function = callNativeErrorConstructor; -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
r95849 r96164 70 70 static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags; 71 71 virtual ConstructType getConstructData(ConstructData&); 72 virtual CallType getCallData(CallData&); 72 virtual CallType getCallDataVirtual(CallData&); 73 static CallType getCallData(JSCell*, CallData&); 73 74 virtual void visitChildrenVirtual(SlotVisitor&); 74 75 static void visitChildren(JSCell*, SlotVisitor&); -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp
r95936 r96164 128 128 } 129 129 130 CallType NumberConstructor::getCallData(CallData& callData) 130 CallType NumberConstructor::getCallDataVirtual(CallData& callData) 131 { 132 return getCallData(this, callData); 133 } 134 135 CallType NumberConstructor::getCallData(JSCell*, CallData& callData) 131 136 { 132 137 callData.native.function = callNumberConstructor; -
trunk/Source/JavaScriptCore/runtime/NumberConstructor.h
r95108 r96164 59 59 NumberConstructor(JSGlobalObject*, Structure*); 60 60 virtual ConstructType getConstructData(ConstructData&); 61 virtual CallType getCallData(CallData&); 61 virtual CallType getCallDataVirtual(CallData&); 62 static CallType getCallData(JSCell*, CallData&); 62 63 }; 63 64 -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp
r95936 r96164 127 127 } 128 128 129 CallType ObjectConstructor::getCallData(CallData& callData) 129 CallType ObjectConstructor::getCallDataVirtual(CallData& callData) 130 { 131 return getCallData(this, callData); 132 } 133 134 CallType ObjectConstructor::getCallData(JSCell*, CallData& callData) 130 135 { 131 136 callData.native.function = callObjectConstructor; -
trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h
r95108 r96164 56 56 ObjectConstructor(JSGlobalObject*, Structure*); 57 57 virtual ConstructType getConstructData(ConstructData&); 58 virtual CallType getCallData(CallData&); 58 virtual CallType getCallDataVirtual(CallData&); 59 static CallType getCallData(JSCell*, CallData&); 59 60 }; 60 61 -
trunk/Source/JavaScriptCore/runtime/Operations.cpp
r95326 r96164 75 75 return jsNontrivialString(callFrame, "undefined"); 76 76 CallData callData; 77 if (asObject(v)->getCallData (callData) != CallTypeNone)77 if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone) 78 78 return jsNontrivialString(callFrame, "function"); 79 79 } … … 93 93 return false; 94 94 CallData callData; 95 if (asObject(v)->getCallData (callData) != CallTypeNone)95 if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone) 96 96 return false; 97 97 } … … 103 103 if (v.isObject()) { 104 104 CallData callData; 105 if (asObject(v)->getCallData (callData) != CallTypeNone)105 if (asObject(v)->getCallDataVirtual(callData) != CallTypeNone) 106 106 return true; 107 107 } -
trunk/Source/JavaScriptCore/runtime/PropertySlot.cpp
r91095 r96164 34 34 35 35 CallData callData; 36 CallType callType = m_data.getterFunc->getCallData (callData);36 CallType callType = m_data.getterFunc->getCallDataVirtual(callData); 37 37 38 38 // Only objects can have accessor properties. -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp
r95936 r96164 358 358 } 359 359 360 CallType RegExpConstructor::getCallData(CallData& callData) 360 CallType RegExpConstructor::getCallDataVirtual(CallData& callData) 361 { 362 return getCallData(this, callData); 363 } 364 365 CallType RegExpConstructor::getCallData(JSCell*, CallData& callData) 361 366 { 362 367 callData.native.function = callRegExpConstructor; -
trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h
r95108 r96164 99 99 RegExpConstructor(JSGlobalObject*, Structure*); 100 100 virtual ConstructType getConstructData(ConstructData&); 101 virtual CallType getCallData(CallData&); 101 virtual CallType getCallDataVirtual(CallData&); 102 static CallType getCallData(JSCell*, CallData&); 102 103 103 104 OwnPtr<RegExpConstructorPrivate> d; -
trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp
r95936 r96164 110 110 } 111 111 112 CallType StringConstructor::getCallData(CallData& callData) 112 CallType StringConstructor::getCallDataVirtual(CallData& callData) 113 { 114 return getCallData(this, callData); 115 } 116 117 CallType StringConstructor::getCallData(JSCell*, CallData& callData) 113 118 { 114 119 callData.native.function = callStringConstructor; -
trunk/Source/JavaScriptCore/runtime/StringConstructor.h
r95108 r96164 53 53 void finishCreation(ExecState*, StringPrototype*); 54 54 virtual ConstructType getConstructData(ConstructData&); 55 virtual CallType getCallData(CallData&); 55 virtual CallType getCallDataVirtual(CallData&); 56 static CallType getCallData(JSCell*, CallData&); 56 57 57 58 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/Source/JavaScriptGlue/ChangeLog
r95936 r96164 1 2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=68741 5 6 Reviewed by Darin Adler. 7 8 In this patch we just extract the bodies of the virtual getCallData methods 9 throughout the JSCell inheritance hierarchy out into static methods, which are 10 now called from the virtual methods. This is an intermediate step in trying to 11 move the virtual-ness of getCallData into our own method table stored in 12 ClassInfo. We need to convert the methods to static methods because static methods 13 can be represented as function pointers rather than pointers to member functions, and 14 function pointers are smaller and faster to call than pointers to member functions. 15 16 * JSValueWrapper.cpp: 17 (JSValueWrapper::JSObjectCallFunction): 18 * UserObjectImp.cpp: 19 (UserObjectImp::getCallDataVirtual): 20 (UserObjectImp::getCallData): 21 * UserObjectImp.h: 22 1 23 2011-09-25 Mark Hahnenberg <mhahnenberg@apple.com> 2 24 -
trunk/Source/JavaScriptGlue/JSValueWrapper.cpp
r78634 r96164 164 164 165 165 CallData callData; 166 CallType callType = objValue->getCallData (callData);166 CallType callType = objValue->getCallDataVirtual(callData); 167 167 if (callType == CallTypeNone) 168 168 return 0; -
trunk/Source/JavaScriptGlue/UserObjectImp.cpp
r95936 r96164 47 47 } 48 48 49 CallType UserObjectImp::getCallData(CallData& callData) 50 { 51 return fJSUserObject ? fJSUserObject->getCallData(callData) : CallTypeNone; 49 CallType UserObjectImp::getCallDataVirtual(CallData& callData) 50 { 51 return getCallData(this, callData); 52 } 53 54 CallType UserObjectImp::getCallData(JSCell* cell, CallData& callData) 55 { 56 UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell); 57 return thisObject->fJSUserObject ? thisObject->fJSUserObject->getCallData(callData) : CallTypeNone; 52 58 } 53 59 -
trunk/Source/JavaScriptGlue/UserObjectImp.h
r95849 r96164 50 50 static const ClassInfo s_info; 51 51 52 virtual CallType getCallData(CallData&); 52 virtual CallType getCallDataVirtual(CallData&); 53 static CallType getCallData(JSCell*, CallData&); 53 54 54 55 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); -
trunk/Source/WebCore/ChangeLog
r96163 r96164 1 2011-09-23 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::visitChildren 4 https://bugs.webkit.org/show_bug.cgi?id=68404 5 6 Reviewed by Darin Adler. 7 8 No new tests. 9 10 In this patch we just extract the bodies of the virtual visitChildren methods 11 throughout the JSCell inheritance hierarchy out into static methods, which are 12 now called from the virtual methods. This is an intermediate step in trying to 13 move the virtual-ness of visitChildren into our own custom vtable stored in 14 ClassInfo. We need to convert the methods to static methods in order to be 15 able to more easily store and refer to them in our custom vtable since normal 16 member methods store some implicit information in their types, making it 17 impossible to store them generically in ClassInfo. 18 19 * WebCore.exp.in: 20 * bindings/js/JSAttrCustom.cpp: 21 (WebCore::JSAttr::visitChildrenVirtual): 22 (WebCore::JSAttr::visitChildren): 23 * bindings/js/JSAudioContextCustom.cpp: 24 (WebCore::JSAudioContext::visitChildrenVirtual): 25 (WebCore::JSAudioContext::visitChildren): 26 * bindings/js/JSCSSRuleCustom.cpp: 27 (WebCore::JSCSSRule::visitChildrenVirtual): 28 (WebCore::JSCSSRule::visitChildren): 29 * bindings/js/JSCSSStyleDeclarationCustom.cpp: 30 (WebCore::JSCSSStyleDeclaration::visitChildrenVirtual): 31 (WebCore::JSCSSStyleDeclaration::visitChildren): 32 * bindings/js/JSCanvasRenderingContextCustom.cpp: 33 (WebCore::JSCanvasRenderingContext::visitChildrenVirtual): 34 (WebCore::JSCanvasRenderingContext::visitChildren): 35 * bindings/js/JSDOMGlobalObject.cpp: 36 (WebCore::JSDOMGlobalObject::visitChildrenVirtual): 37 (WebCore::JSDOMGlobalObject::visitChildren): 38 * bindings/js/JSDOMGlobalObject.h: 39 * bindings/js/JSDOMWindowCustom.cpp: 40 (WebCore::JSDOMWindow::visitChildrenVirtual): 41 (WebCore::JSDOMWindow::visitChildren): 42 * bindings/js/JSDOMWindowShell.cpp: 43 (WebCore::JSDOMWindowShell::visitChildrenVirtual): 44 (WebCore::JSDOMWindowShell::visitChildren): 45 * bindings/js/JSDOMWindowShell.h: 46 * bindings/js/JSJavaScriptAudioNodeCustom.cpp: 47 (WebCore::JSJavaScriptAudioNode::visitChildrenVirtual): 48 (WebCore::JSJavaScriptAudioNode::visitChildren): 49 * bindings/js/JSMessageChannelCustom.cpp: 50 (WebCore::JSMessageChannel::visitChildrenVirtual): 51 (WebCore::JSMessageChannel::visitChildren): 52 * bindings/js/JSMessagePortCustom.cpp: 53 (WebCore::JSMessagePort::visitChildrenVirtual): 54 (WebCore::JSMessagePort::visitChildren): 55 * bindings/js/JSNamedNodeMapCustom.cpp: 56 (WebCore::JSNamedNodeMap::visitChildrenVirtual): 57 (WebCore::JSNamedNodeMap::visitChildren): 58 * bindings/js/JSNodeCustom.cpp: 59 (WebCore::JSNode::visitChildrenVirtual): 60 (WebCore::JSNode::visitChildren): 61 * bindings/js/JSNodeFilterCustom.cpp: 62 (WebCore::JSNodeFilter::visitChildrenVirtual): 63 (WebCore::JSNodeFilter::visitChildren): 64 * bindings/js/JSNodeIteratorCustom.cpp: 65 (WebCore::JSNodeIterator::visitChildrenVirtual): 66 (WebCore::JSNodeIterator::visitChildren): 67 * bindings/js/JSSVGElementInstanceCustom.cpp: 68 (WebCore::JSSVGElementInstance::visitChildrenVirtual): 69 (WebCore::JSSVGElementInstance::visitChildren): 70 * bindings/js/JSSharedWorkerCustom.cpp: 71 (WebCore::JSSharedWorker::visitChildrenVirtual): 72 (WebCore::JSSharedWorker::visitChildren): 73 * bindings/js/JSStyleSheetCustom.cpp: 74 (WebCore::JSStyleSheet::visitChildrenVirtual): 75 (WebCore::JSStyleSheet::visitChildren): 76 * bindings/js/JSTreeWalkerCustom.cpp: 77 (WebCore::JSTreeWalker::visitChildrenVirtual): 78 (WebCore::JSTreeWalker::visitChildren): 79 * bindings/js/JSWebGLRenderingContextCustom.cpp: 80 (WebCore::JSWebGLRenderingContext::visitChildrenVirtual): 81 (WebCore::JSWebGLRenderingContext::visitChildren): 82 * bindings/js/JSWorkerContextCustom.cpp: 83 (WebCore::JSWorkerContext::visitChildrenVirtual): 84 (WebCore::JSWorkerContext::visitChildren): 85 * bindings/js/JSXMLHttpRequestCustom.cpp: 86 (WebCore::JSXMLHttpRequest::visitChildrenVirtual): 87 (WebCore::JSXMLHttpRequest::visitChildren): 88 * bindings/js/JSXPathResultCustom.cpp: 89 (WebCore::JSXPathResult::visitChildrenVirtual): 90 (WebCore::JSXPathResult::visitChildren): 91 * bindings/scripts/CodeGeneratorJS.pm: 92 (GenerateHeader): 93 (GenerateImplementation): 94 * bindings/scripts/test/JS/JSTestObj.cpp: 95 (WebCore::JSTestObj::visitChildrenVirtual): 96 (WebCore::JSTestObj::visitChildren): 97 * bindings/scripts/test/JS/JSTestObj.h: 98 * bridge/qt/qt_instance.cpp: 99 (JSC::Bindings::QtRuntimeObject::visitChildrenVirtual): 100 (JSC::Bindings::QtRuntimeObject::visitChildren): 101 * bridge/qt/qt_runtime.cpp: 102 (JSC::Bindings::QtRuntimeMetaMethod::visitChildrenVirtual): 103 (JSC::Bindings::QtRuntimeMetaMethod::visitChildren): 104 * bridge/qt/qt_runtime.h: 105 * workers/WorkerContext.h: 106 107 <<<<<<< .mine 108 2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com> 109 110 Add static version of JSCell::getCallData 111 https://bugs.webkit.org/show_bug.cgi?id=68741 112 113 Reviewed by Darin Adler. 114 115 No new tests. 116 117 In this patch we just extract the bodies of the virtual getCallData methods 118 throughout the JSCell inheritance hierarchy out into static methods, which are 119 now called from the virtual methods. This is an intermediate step in trying to 120 move the virtual-ness of getCallData into our own method table stored in 121 ClassInfo. We need to convert the methods to static methods because static methods 122 can be represented as function pointers rather than pointers to member functions, and 123 function pointers are smaller and faster to call than pointers to member functions. 124 125 * WebCore.exp.in: 126 * bindings/js/JSCallbackData.cpp: 127 (WebCore::JSCallbackData::invokeCallback): 128 * bindings/js/JSCustomXPathNSResolver.cpp: 129 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI): 130 * bindings/js/JSErrorHandler.cpp: 131 (WebCore::JSErrorHandler::handleEvent): 132 * bindings/js/JSEventListener.cpp: 133 (WebCore::JSEventListener::handleEvent): 134 * bindings/js/JSHTMLAllCollectionCustom.cpp: 135 (WebCore::JSHTMLAllCollection::getCallDataVirtual): 136 (WebCore::JSHTMLAllCollection::getCallData): 137 * bindings/js/JSHTMLAppletElementCustom.cpp: 138 (WebCore::JSHTMLAppletElement::getCallDataVirtual): 139 (WebCore::JSHTMLAppletElement::getCallData): 140 * bindings/js/JSHTMLEmbedElementCustom.cpp: 141 (WebCore::JSHTMLEmbedElement::getCallDataVirtual): 142 (WebCore::JSHTMLEmbedElement::getCallData): 143 * bindings/js/JSHTMLObjectElementCustom.cpp: 144 (WebCore::JSHTMLObjectElement::getCallDataVirtual): 145 (WebCore::JSHTMLObjectElement::getCallData): 146 * bindings/js/JSInjectedScriptHostCustom.cpp: 147 (WebCore::JSInjectedScriptHost::evaluate): 148 * bindings/js/JSPluginElementFunctions.cpp: 149 (WebCore::runtimeObjectGetCallData): 150 * bindings/scripts/CodeGeneratorJS.pm: 151 (GenerateHeader): 152 * bridge/objc/objc_runtime.h: 153 * bridge/objc/objc_runtime.mm: 154 (JSC::Bindings::ObjcFallbackObjectImp::getCallDataVirtual): 155 (JSC::Bindings::ObjcFallbackObjectImp::getCallData): 156 * bridge/qt/qt_runtime.cpp: 157 (JSC::Bindings::QtRuntimeMetaMethod::getCallDataVirtual): 158 (JSC::Bindings::QtRuntimeMetaMethod::getCallData): 159 (JSC::Bindings::QtRuntimeConnectionMethod::call): 160 (JSC::Bindings::QtRuntimeConnectionMethod::getCallDataVirtual): 161 (JSC::Bindings::QtRuntimeConnectionMethod::getCallData): 162 (JSC::Bindings::isJavaScriptFunction): 163 * bridge/qt/qt_runtime.h: 164 * bridge/runtime_method.cpp: 165 (JSC::RuntimeMethod::getCallDataVirtual): 166 (JSC::RuntimeMethod::getCallData): 167 * bridge/runtime_method.h: 168 * bridge/runtime_object.cpp: 169 (JSC::Bindings::RuntimeObject::getCallDataVirtual): 170 (JSC::Bindings::RuntimeObject::getCallData): 171 * bridge/runtime_object.h: 172 173 ======= 1 174 2011-09-27 Dean Jackson <dino@apple.com> 2 175 … … 6 179 * WebCore.xcodeproj/project.pbxproj: 7 180 181 >>>>>>> .r96163 8 182 2011-09-27 David Hyatt <hyatt@apple.com> 9 183 -
trunk/Source/WebCore/WebCore.exp.in
r95967 r96164 1648 1648 1649 1649 #if USE(PLUGIN_HOST_PROCESS) 1650 __ZN3JSC13RuntimeMethod11getCallDataERNS_8CallDataE1651 1650 __ZN3JSC13RuntimeMethod14finishCreationERNS_12JSGlobalDataERKNS_10IdentifierE 1651 __ZN3JSC13RuntimeMethod18getCallDataVirtualERNS_8CallDataE 1652 1652 __ZN3JSC13RuntimeMethod18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 1653 1653 __ZN3JSC13RuntimeMethod24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE … … 1655 1655 __ZN3JSC13RuntimeMethodC2EPNS_14JSGlobalObjectEPNS_9StructureERN3WTF6VectorIPNS_8Bindings6MethodELm0EEE 1656 1656 __ZN3JSC8Bindings10RootObjectD1Ev 1657 __ZN3JSC8Bindings13RuntimeObject11getCallDataERNS_8CallDataE1658 1657 __ZN3JSC8Bindings13RuntimeObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 1659 1658 __ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE 1660 1659 __ZN3JSC8Bindings13RuntimeObject16getConstructDataERNS_13ConstructDataE 1660 __ZN3JSC8Bindings13RuntimeObject18getCallDataVirtualERNS_8CallDataE 1661 1661 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 1662 1662 __ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE -
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
r71455 r96164 54 54 CallType callType = getCallData(function, callData); 55 55 if (callType == CallTypeNone) { 56 callType = callback()->getCallData (callData);56 callType = callback()->getCallDataVirtual(callData); 57 57 if (callType == CallTypeNone) 58 58 return JSValue(); -
trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp
r90124 r96164 78 78 CallType callType = getCallData(function, callData); 79 79 if (callType == CallTypeNone) { 80 callType = m_customResolver->getCallData (callData);80 callType = m_customResolver->getCallDataVirtual(callData); 81 81 if (callType == CallTypeNone) { 82 82 // FIXME: Pass actual line number and source URL. -
trunk/Source/WebCore/bindings/js/JSErrorHandler.cpp
r95901 r96164 75 75 76 76 CallData callData; 77 CallType callType = jsFunction->getCallData (callData);77 CallType callType = jsFunction->getCallDataVirtual(callData); 78 78 79 79 if (callType != CallTypeNone) { -
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
r94918 r96164 102 102 if (callType == CallTypeNone) { 103 103 handleEventFunction = JSValue(); 104 callType = jsFunction->getCallData (callData);104 callType = jsFunction->getCallDataVirtual(callData); 105 105 } 106 106 -
trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
r95901 r96164 100 100 } 101 101 102 CallType JSHTMLAllCollection::getCallData(CallData& callData) 102 CallType JSHTMLAllCollection::getCallDataVirtual(CallData& callData) 103 { 104 return getCallData(this, callData); 105 } 106 107 CallType JSHTMLAllCollection::getCallData(JSCell*, CallData& callData) 103 108 { 104 109 callData.native.function = callHTMLAllCollection; -
trunk/Source/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
r64093 r96164 49 49 } 50 50 51 CallType JSHTMLAppletElement::getCallData (CallData& callData)51 CallType JSHTMLAppletElement::getCallDataVirtual(CallData& callData) 52 52 { 53 return runtimeObjectGetCallData(this, callData); 53 return getCallData(this, callData); 54 } 55 56 CallType JSHTMLAppletElement::getCallData(JSCell* cell, CallData& callData) 57 { 58 return runtimeObjectGetCallData(static_cast<JSHTMLAppletElement*>(cell), callData); 54 59 } 55 60 -
trunk/Source/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
r64093 r96164 49 49 } 50 50 51 CallType JSHTMLEmbedElement::getCallData (CallData& callData)51 CallType JSHTMLEmbedElement::getCallDataVirtual(CallData& callData) 52 52 { 53 return runtimeObjectGetCallData(this, callData); 53 return getCallData(this, callData); 54 } 55 56 CallType JSHTMLEmbedElement::getCallData(JSCell* cell, CallData& callData) 57 { 58 return runtimeObjectGetCallData(static_cast<JSHTMLEmbedElement*>(cell), callData); 54 59 } 55 60 -
trunk/Source/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
r64093 r96164 49 49 } 50 50 51 CallType JSHTMLObjectElement::getCallData (CallData& callData)51 CallType JSHTMLObjectElement::getCallDataVirtual(CallData& callData) 52 52 { 53 return runtimeObjectGetCallData(this, callData); 53 return getCallData(this, callData); 54 } 55 56 CallType JSHTMLObjectElement::getCallData(JSCell* cell, CallData& callData) 57 { 58 return runtimeObjectGetCallData(static_cast<JSHTMLObjectElement*>(cell), callData); 54 59 } 55 60 -
trunk/Source/WebCore/bindings/js/JSInjectedScriptHostCustom.cpp
r95901 r96164 86 86 JSFunction* evalFunction = globalObject->evalFunction(); 87 87 CallData callData; 88 CallType callType = evalFunction->getCallData (callData);88 CallType callType = evalFunction->getCallDataVirtual(callData); 89 89 if (callType == CallTypeNone) 90 90 return jsUndefined(); -
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
r79988 r96164 178 178 CallData scriptObjectCallData; 179 179 180 if (scriptObject->getCallData (scriptObjectCallData) == CallTypeNone)180 if (scriptObject->getCallDataVirtual(scriptObjectCallData) == CallTypeNone) 181 181 return CallTypeNone; 182 182 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r95936 r96164 817 817 818 818 # Custom call functions 819 push(@headerContent, " virtual JSC::CallType getCallData(JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"}; 819 push(@headerContent, " virtual JSC::CallType getCallDataVirtual(JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"}; 820 push(@headerContent, " static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"}; 820 821 821 822 # Custom deleteProperty function -
trunk/Source/WebCore/bridge/objc/objc_runtime.h
r94929 r96164 127 127 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 128 128 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 129 virtual CallType getCallData(CallData&); 129 virtual CallType getCallDataVirtual(CallData&); 130 static CallType getCallData(JSCell*, CallData&); 130 131 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 131 132 virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const; -
trunk/Source/WebCore/bridge/objc/objc_runtime.mm
r95936 r96164 256 256 } 257 257 258 CallType ObjcFallbackObjectImp::getCallData(CallData& callData) 259 { 260 id targetObject = _instance->getObject(); 258 CallType ObjcFallbackObjectImp::getCallDataVirtual(CallData& callData) 259 { 260 return getCallData(this, callData); 261 } 262 263 CallType ObjcFallbackObjectImp::getCallData(JSCell* cell, CallData& callData) 264 { 265 ObjcFallbackObjectImp* thisObject = static_cast<ObjcFallbackObjectImp*>(cell); 266 id targetObject = thisObject->_instance->getObject(); 261 267 if (![targetObject respondsToSelector:@selector(invokeUndefinedMethodFromWebScript:withArguments:)]) 262 268 return CallTypeNone; -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r95936 r96164 1492 1492 } 1493 1493 1494 CallType QtRuntimeMetaMethod::getCallData(CallData& callData) 1494 CallType QtRuntimeMetaMethod::getCallDataVirtual(CallData& callData) 1495 { 1496 return getCallData(this, callData); 1497 } 1498 1499 CallType QtRuntimeMetaMethod::getCallData(JSCell*, CallData& callData) 1495 1500 { 1496 1501 callData.native.function = call; … … 1621 1626 funcObject = exec->argument(0).toObject(exec); 1622 1627 CallData callData; 1623 if (funcObject->getCallData (callData) == CallTypeNone) {1628 if (funcObject->getCallDataVirtual(callData) == CallTypeNone) { 1624 1629 if (d->m_isConnect) 1625 1630 return throwVMError(exec, createTypeError(exec, "QtMetaMethod.connect: target is not a function")); … … 1634 1639 JSObject *asObj = exec->argument(1).toObject(exec); 1635 1640 CallData callData; 1636 if (asObj->getCallData (callData) != CallTypeNone) {1641 if (asObj->getCallDataVirtual(callData) != CallTypeNone) { 1637 1642 // Function version 1638 1643 funcObject = asObj; … … 1647 1652 JSObject* asFuncObj = val.toObject(exec); 1648 1653 1649 if (asFuncObj->getCallData (callData) != CallTypeNone) {1654 if (asFuncObj->getCallDataVirtual(callData) != CallTypeNone) { 1650 1655 funcObject = asFuncObj; 1651 1656 } else { … … 1731 1736 } 1732 1737 1733 CallType QtRuntimeConnectionMethod::getCallData(CallData& callData) 1738 CallType QtRuntimeConnectionMethod::getCallDataVirtual(CallData& callData) 1739 { 1740 return getCallData(this, callData); 1741 } 1742 1743 CallType QtRuntimeConnectionMethod::getCallData(JSCell*, CallData& callData) 1734 1744 { 1735 1745 callData.native.function = call; … … 1854 1864 { 1855 1865 CallData callData; 1856 return toJS(object)->getCallData (callData) == CallTypeJS;1866 return toJS(object)->getCallDataVirtual(callData) == CallTypeJS; 1857 1867 } 1858 1868 -
trunk/Source/WebCore/bridge/qt/qt_runtime.h
r95849 r96164 179 179 void finishCreation(ExecState*, const Identifier&, PassRefPtr<QtInstance>, int index, const QByteArray& signature, bool allowPrivate); 180 180 181 virtual CallType getCallData(CallData&); 181 virtual CallType getCallDataVirtual(CallData&); 182 static CallType getCallData(JSCell*, CallData&); 182 183 static EncodedJSValue JSC_HOST_CALL call(ExecState* exec); 183 184 static JSValue lengthGetter(ExecState*, JSValue, const Identifier&); … … 210 211 void finishCreation(ExecState*, const Identifier&, bool isConnect, PassRefPtr<QtInstance>, int index, const QByteArray& signature); 211 212 212 virtual CallType getCallData(CallData&); 213 virtual CallType getCallDataVirtual(CallData&); 214 static CallType getCallData(JSCell*, CallData&); 213 215 static EncodedJSValue JSC_HOST_CALL call(ExecState* exec); 214 216 static JSValue lengthGetter(ExecState*, JSValue, const Identifier&); -
trunk/Source/WebCore/bridge/runtime_method.cpp
r95936 r96164 124 124 } 125 125 126 CallType RuntimeMethod::getCallData(CallData& callData) 126 CallType RuntimeMethod::getCallDataVirtual(CallData& callData) 127 { 128 return getCallData(this, callData); 129 } 130 131 CallType RuntimeMethod::getCallData(JSCell*, CallData& callData) 127 132 { 128 133 callData.native.function = callRuntimeMethod; -
trunk/Source/WebCore/bridge/runtime_method.h
r95108 r96164 68 68 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 69 69 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 70 virtual CallType getCallData(CallData&); 70 virtual CallType getCallDataVirtual(CallData&); 71 static CallType getCallData(JSCell*, CallData&); 71 72 72 73 OwnPtr<Bindings::MethodList> _methodList; -
trunk/Source/WebCore/bridge/runtime_object.cpp
r95936 r96164 260 260 } 261 261 262 CallType RuntimeObject::getCallData(CallData& callData) 263 { 264 if (!m_instance) 262 CallType RuntimeObject::getCallDataVirtual(CallData& callData) 263 { 264 return getCallData(this, callData); 265 } 266 267 CallType RuntimeObject::getCallData(JSCell* cell, CallData& callData) 268 { 269 RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell); 270 if (!thisObject->m_instance) 265 271 return CallTypeNone; 266 272 267 RefPtr<Instance> instance = m_instance;273 RefPtr<Instance> instance = thisObject->m_instance; 268 274 if (!instance->supportsInvokeDefaultMethod()) 269 275 return CallTypeNone; -
trunk/Source/WebCore/bridge/runtime_object.h
r94929 r96164 51 51 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 52 52 virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const; 53 virtual CallType getCallData(CallData&); 53 virtual CallType getCallDataVirtual(CallData&); 54 static CallType getCallData(JSCell*, CallData&); 54 55 virtual ConstructType getConstructData(ConstructData&); 55 56 -
trunk/Source/WebKit/mac/ChangeLog
r95967 r96164 1 2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=68741 5 6 Reviewed by Darin Adler. 7 8 In this patch we just extract the bodies of the virtual getCallData methods 9 throughout the JSCell inheritance hierarchy out into static methods, which are 10 now called from the virtual methods. This is an intermediate step in trying to 11 move the virtual-ness of getCallData into our own method table stored in 12 ClassInfo. We need to convert the methods to static methods because static methods 13 can be represented as function pointers rather than pointers to member functions, and 14 function pointers are smaller and faster to call than pointers to member functions. 15 16 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 17 (WebKit::NetscapePluginInstanceProxy::invokeDefault): 18 1 19 2011-09-23 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
r95901 r96164 944 944 JSLock lock(SilenceAssertionsOnly); 945 945 CallData callData; 946 CallType callType = object->getCallData (callData);946 CallType callType = object->getCallDataVirtual(callData); 947 947 if (callType == CallTypeNone) 948 948 return false; -
trunk/Source/WebKit2/ChangeLog
r96145 r96164 1 2011-09-27 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Add static version of JSCell::getCallData 4 https://bugs.webkit.org/show_bug.cgi?id=68741 5 6 Reviewed by Darin Adler. 7 8 In this patch we just extract the bodies of the virtual getCallData methods 9 throughout the JSCell inheritance hierarchy out into static methods, which are 10 now called from the virtual methods. This is an intermediate step in trying to 11 move the virtual-ness of getCallData into our own method table stored in 12 ClassInfo. We need to convert the methods to static methods because static methods 13 can be represented as function pointers rather than pointers to member functions, and 14 function pointers are smaller and faster to call than pointers to member functions. 15 16 * WebProcess/Plugins/Netscape/JSNPMethod.cpp: 17 (WebKit::JSNPMethod::getCallDataVirtual): 18 (WebKit::JSNPMethod::getCallData): 19 * WebProcess/Plugins/Netscape/JSNPMethod.h: 20 * WebProcess/Plugins/Netscape/JSNPObject.cpp: 21 (WebKit::JSNPObject::getCallDataVirtual): 22 (WebKit::JSNPObject::getCallData): 23 * WebProcess/Plugins/Netscape/JSNPObject.h: 24 1 25 2011-09-27 Gopal Raghavan <gopal.1.raghavan@nokia.com> 2 26 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
r95936 r96164 78 78 } 79 79 80 CallType JSNPMethod::getCallData(CallData& callData) 80 CallType JSNPMethod::getCallDataVirtual(CallData& callData) 81 { 82 return getCallData(this, callData); 83 } 84 85 CallType JSNPMethod::getCallData(JSCell*, CallData& callData) 81 86 { 82 87 callData.native.function = callMethod; -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
r95901 r96164 63 63 } 64 64 65 virtual JSC::CallType getCallData(JSC::CallData&); 65 virtual JSC::CallType getCallDataVirtual(JSC::CallData&); 66 static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&); 66 67 67 68 NPIdentifier m_npIdentifier; -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
r95936 r96164 218 218 } 219 219 220 JSC::CallType JSNPObject::getCallData(JSC::CallData& callData) 221 { 222 ASSERT_GC_OBJECT_INHERITS(this, &s_info); 223 if (!m_npObject || !m_npObject->_class->invokeDefault) 220 CallType JSNPObject::getCallDataVirtual(CallData& callData) 221 { 222 return getCallData(this, callData); 223 } 224 225 JSC::CallType JSNPObject::getCallData(JSC::JSCell* cell, JSC::CallData& callData) 226 { 227 JSNPObject* thisObject = static_cast<JSNPObject*>(cell); 228 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); 229 if (!thisObject->m_npObject || !thisObject->m_npObject->_class->invokeDefault) 224 230 return CallTypeNone; 225 231 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
r95901 r96164 80 80 } 81 81 82 virtual JSC::CallType getCallData(JSC::CallData&); 82 virtual JSC::CallType getCallDataVirtual(JSC::CallData&); 83 static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&); 83 84 virtual JSC::ConstructType getConstructData(JSC::ConstructData&); 84 85
Note: See TracChangeset
for help on using the changeset viewer.