Changeset 99256 in webkit
- Timestamp:
- Nov 3, 2011, 6:32:18 PM (14 years ago)
- Location:
- trunk/Source
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSObjectRef.cpp
r99167 r99256 507 507 JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(globalData); 508 508 PropertyNameArray array(globalData); 509 jsObject-> getPropertyNames(exec, array);509 jsObject->methodTable()->getPropertyNames(jsObject, exec, array, ExcludeDontEnumProperties); 510 510 511 511 size_t size = array.size(); -
trunk/Source/JavaScriptCore/ChangeLog
r99239 r99256 1 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getPropertyNames 4 https://bugs.webkit.org/show_bug.cgi?id=71306 5 6 Reviewed by Darin Adler. 7 8 Added getPropertyNames to the MethodTable, changed all the virtual 9 implementations of getPropertyNames to static ones, and replaced 10 all call sites with corresponding lookups in the MethodTable. 11 12 * API/JSObjectRef.cpp: 13 (JSObjectCopyPropertyNames): 14 * JavaScriptCore.exp: 15 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 16 * debugger/DebuggerActivation.cpp: 17 (JSC::DebuggerActivation::getOwnPropertyNames): 18 * runtime/ClassInfo.h: 19 * runtime/JSCell.cpp: 20 (JSC::JSCell::getPropertyNames): 21 * runtime/JSCell.h: 22 * runtime/JSObject.cpp: 23 (JSC::JSObject::getPropertyNames): 24 (JSC::JSObject::getOwnPropertyNames): 25 * runtime/JSObject.h: 26 * runtime/JSPropertyNameIterator.cpp: 27 (JSC::JSPropertyNameIterator::create): 28 * runtime/ScopeChain.cpp: 29 (JSC::ScopeChainNode::print): 30 * runtime/Structure.cpp: 31 (JSC::Structure::getPropertyNamesFromStructure): 32 * runtime/Structure.h: 33 1 34 2011-11-03 Darin Adler <darin@apple.com> 2 35 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r99238 r99256 313 313 __ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE 314 314 __ZN3JSC8JSObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE 315 __ZN3JSC8JSObject16getPropertyNamesEP NS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE315 __ZN3JSC8JSObject16getPropertyNamesEPS0_PNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 316 316 __ZN3JSC8JSObject17defineOwnPropertyEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorEb 317 317 __ZN3JSC8JSObject17preventExtensionsERNS_12JSGlobalDataE -
trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r99238 r99256 204 204 ?getOwnPropertySlotByIndex@JSObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@IAAVPropertySlot@2@@Z 205 205 ?getPropertyDescriptor@JSObject@JSC@@QAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 206 ?getPropertyNames@JSObject@JSC@@ UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z206 ?getPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 207 207 ?getSlice@ArgList@JSC@@QBEXHAAV12@@Z 208 208 ?getString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z -
trunk/Source/JavaScriptCore/debugger/DebuggerActivation.cpp
r99223 r99256 88 88 { 89 89 DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object); 90 thisObject->m_activation-> getPropertyNames(exec, propertyNames, mode);90 thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode); 91 91 } 92 92 -
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r99238 r99256 76 76 GetOwnPropertyNamesFunctionPtr getOwnPropertyNames; 77 77 78 typedef void (*GetPropertyNamesFunctionPtr)(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 79 GetPropertyNamesFunctionPtr getPropertyNames; 80 78 81 typedef UString (*ClassNameFunctionPtr)(const JSObject*); 79 82 ClassNameFunctionPtr className; … … 117 120 &ClassName::defaultValue, \ 118 121 &ClassName::getOwnPropertyNames, \ 122 &ClassName::getPropertyNames, \ 119 123 &ClassName::className, \ 120 124 &ClassName::hasInstance, \ -
trunk/Source/JavaScriptCore/runtime/JSCell.cpp
r99238 r99256 192 192 } 193 193 194 void JSCell::getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode) 195 { 196 ASSERT_NOT_REACHED(); 197 } 198 194 199 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/JSCell.h
r99238 r99256 145 145 static JSValue defaultValue(const JSObject*, ExecState*, PreferredPrimitiveType); 146 146 static NO_RETURN_DUE_TO_ASSERT void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 147 static NO_RETURN_DUE_TO_ASSERT void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 147 148 static UString className(const JSObject*); 148 149 static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r99238 r99256 496 496 } 497 497 498 void JSObject::getPropertyNames( ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)499 { 500 methodTable()->getOwnPropertyNames(this, exec, propertyNames, mode);501 502 if ( prototype().isNull())503 return; 504 505 JSObject* prototype = asObject( this->prototype());498 void JSObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 499 { 500 object->methodTable()->getOwnPropertyNames(object, exec, propertyNames, mode); 501 502 if (object->prototype().isNull()) 503 return; 504 505 JSObject* prototype = asObject(object->prototype()); 506 506 while(1) { 507 507 if (prototype->structure()->typeInfo().overridesGetPropertyNames()) { 508 prototype-> getPropertyNames(exec, propertyNames, mode);508 prototype->methodTable()->getPropertyNames(prototype, exec, propertyNames, mode); 509 509 break; 510 510 } … … 519 519 void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 520 520 { 521 object->structure()->getPropertyNames (exec->globalData(), propertyNames, mode);521 object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode); 522 522 if (!object->staticFunctionsReified()) 523 523 getClassPropertyNames(exec, object->classInfo(), propertyNames, mode); -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r99238 r99256 127 127 static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty); 128 128 129 virtual void getPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);130 129 static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 130 static void getPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode); 131 131 132 132 JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const; -
trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
r96346 r99256 53 53 54 54 PropertyNameArray propertyNames(exec); 55 o-> getPropertyNames(exec, propertyNames);55 o->methodTable()->getPropertyNames(o, exec, propertyNames, ExcludeDontEnumProperties); 56 56 size_t numCacheableSlots = 0; 57 57 if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasGetterSetterProperties() -
trunk/Source/JavaScriptCore/runtime/ScopeChain.cpp
r96346 r99256 42 42 JSObject* o = scopeIter->get(); 43 43 PropertyNameArray propertyNames(globalObject->globalExec()); 44 o-> getPropertyNames(globalObject->globalExec(), propertyNames);44 o->methodTable()->getPropertyNames(o, globalObject->globalExec(), propertyNames, ExcludeDontEnumProperties); 45 45 PropertyNameArray::const_iterator propEnd = propertyNames.end(); 46 46 -
trunk/Source/JavaScriptCore/runtime/Structure.cpp
r98647 r99256 721 721 } 722 722 723 void Structure::getPropertyNames (JSGlobalData& globalData, PropertyNameArray& propertyNames, EnumerationMode mode)723 void Structure::getPropertyNamesFromStructure(JSGlobalData& globalData, PropertyNameArray& propertyNames, EnumerationMode mode) 724 724 { 725 725 materializePropertyMapIfNecessary(globalData); -
trunk/Source/JavaScriptCore/runtime/Structure.h
r99126 r99256 157 157 void setEnumerationCache(JSGlobalData&, JSPropertyNameIterator* enumerationCache); // Defined in JSPropertyNameIterator.h. 158 158 JSPropertyNameIterator* enumerationCache(); // Defined in JSPropertyNameIterator.h. 159 void getPropertyNames (JSGlobalData&, PropertyNameArray&, EnumerationMode mode);159 void getPropertyNamesFromStructure(JSGlobalData&, PropertyNameArray&, EnumerationMode); 160 160 161 161 bool staticFunctionsReified() -
trunk/Source/JavaScriptGlue/ChangeLog
r99223 r99256 1 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getPropertyNames 4 https://bugs.webkit.org/show_bug.cgi?id=71306 5 6 Reviewed by Darin Adler. 7 8 Added getPropertyNames to the MethodTable, changed all the virtual 9 implementations of getPropertyNames to static ones, and replaced 10 all call sites with corresponding lookups in the MethodTable. 11 12 * JSUtils.cpp: 13 (KJSValueToCFTypeInternal): 14 * JSValueWrapper.cpp: 15 (JSValueWrapper::JSObjectCopyPropertyNames): 16 1 17 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 18 -
trunk/Source/JavaScriptGlue/JSUtils.cpp
r99223 r99256 278 278 if (globalObject && (globalObject->Flags() & kJSFlagConvertAssociativeArray)) { 279 279 PropertyNameArray propNames(exec); 280 object-> getPropertyNames(exec, propNames);280 object->methodTable()->getPropertyNames(object, exec, propNames, ExcludeDontEnumProperties); 281 281 PropertyNameArray::const_iterator iter = propNames.begin(); 282 282 PropertyNameArray::const_iterator end = propNames.end(); … … 317 317 // Not an array, just treat it like a dictionary which contains (property name, property value) pairs 318 318 PropertyNameArray propNames(exec); 319 object-> getPropertyNames(exec, propNames);319 object->methodTable()->getPropertyNames(object, exec, propNames, ExcludeDontEnumProperties); 320 320 { 321 321 result = CFDictionaryCreateMutable(0, -
trunk/Source/JavaScriptGlue/JSValueWrapper.cpp
r98415 r99256 78 78 JSObject* object = ptr->GetValue().toObject(exec); 79 79 PropertyNameArray propNames(exec); 80 object-> getPropertyNames(exec, propNames);80 object->methodTable()->getPropertyNames(object, exec, propNames, ExcludeDontEnumProperties); 81 81 PropertyNameArray::const_iterator iterator = propNames.begin(); 82 82 -
trunk/Source/WebCore/ChangeLog
r99255 r99256 1 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getPropertyNames 4 https://bugs.webkit.org/show_bug.cgi?id=71306 5 6 Reviewed by Darin Adler. 7 8 No new tests. 9 10 Added getPropertyNames to the MethodTable, changed all the virtual 11 implementations of getPropertyNames to static ones, and replaced 12 all call sites with corresponding lookups in the MethodTable. 13 14 * bindings/js/JSDOMWindowCustom.cpp: 15 (WebCore::JSDOMWindow::getPropertyNames): 16 * bindings/js/JSDOMWindowShell.cpp: 17 (WebCore::JSDOMWindowShell::getPropertyNames): 18 * bindings/js/JSDOMWindowShell.h: 19 * bindings/scripts/CodeGeneratorJS.pm: 20 (GenerateHeader): 21 * bridge/NP_jsobject.cpp: 22 (_NPN_Enumerate): 23 * bridge/qt/qt_runtime.cpp: 24 (JSC::Bindings::convertValueToQVariantMap): 25 1 26 2011-11-02 Xiaomei Ji <xji@chromium.org> 2 27 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r99126 r99256 369 369 } 370 370 371 void JSDOMWindow::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 372 { 371 void JSDOMWindow::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 372 { 373 JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object); 373 374 // Only allow the window to enumerated by frames in the same origin. 374 if (! allowsAccessFrom(exec))375 if (!thisObject->allowsAccessFrom(exec)) 375 376 return; 376 Base::getPropertyNames( exec, propertyNames, mode);377 Base::getPropertyNames(thisObject, exec, propertyNames, mode); 377 378 } 378 379 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.cpp
r99223 r99256 124 124 } 125 125 126 void JSDOMWindowShell::getPropertyNames( ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)126 void JSDOMWindowShell::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 127 127 { 128 window()->getPropertyNames(exec, propertyNames, mode); 128 JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object); 129 thisObject->window()->methodTable()->getPropertyNames(thisObject->window(), exec, propertyNames, mode); 129 130 } 130 131 -
trunk/Source/WebCore/bindings/js/JSDOMWindowShell.h
r99223 r99256 85 85 virtual void putWithAttributes(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes); 86 86 static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName); 87 virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);88 87 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode); 88 static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode); 89 89 static void defineGetter(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes); 90 90 static void defineSetter(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* setterFunction, unsigned attributes); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r99244 r99256 829 829 # Custom getPropertyNames function exists on DOMWindow 830 830 if ($interfaceName eq "DOMWindow") { 831 push(@headerContent, " virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n");831 push(@headerContent, " static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n"); 832 832 $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; 833 833 } -
trunk/Source/WebCore/bridge/NP_jsobject.cpp
r99239 r99256 461 461 PropertyNameArray propertyNames(exec); 462 462 463 obj->imp-> getPropertyNames(exec, propertyNames);463 obj->imp->methodTable()->getPropertyNames(obj->imp, exec, propertyNames, ExcludeDontEnumProperties); 464 464 unsigned size = static_cast<unsigned>(propertyNames.size()); 465 465 // FIXME: This should really call NPN_MemAlloc but that's in WebKit -
trunk/Source/WebCore/bridge/qt/qt_runtime.cpp
r99126 r99256 190 190 191 191 PropertyNameArray properties(exec); 192 object-> getPropertyNames(exec, properties);192 object->methodTable()->getPropertyNames(object, exec, properties, ExcludeDontEnumProperties); 193 193 PropertyNameArray::const_iterator it = properties.begin(); 194 194 QVariantMap result; -
trunk/Source/WebKit/mac/ChangeLog
r99239 r99256 1 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getPropertyNames 4 https://bugs.webkit.org/show_bug.cgi?id=71306 5 6 Reviewed by Darin Adler. 7 8 Added getPropertyNames to the MethodTable, changed all the virtual 9 implementations of getPropertyNames to static ones, and replaced 10 all call sites with corresponding lookups in the MethodTable. 11 12 * Plugins/Hosted/NetscapePluginInstanceProxy.mm: 13 (WebKit::NetscapePluginInstanceProxy::enumerate): 14 1 15 2011-11-02 Darin Adler <darin@apple.com> 2 16 -
trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
r98593 r99256 1231 1231 1232 1232 PropertyNameArray propertyNames(exec); 1233 object-> getPropertyNames(exec, propertyNames);1233 object->methodTable()->getPropertyNames(object, exec, propertyNames, ExcludeDontEnumProperties); 1234 1234 1235 1235 RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]); -
trunk/Source/WebKit2/ChangeLog
r99250 r99256 1 2011-11-03 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 De-virtualize JSObject::getPropertyNames 4 https://bugs.webkit.org/show_bug.cgi?id=71306 5 6 Reviewed by Darin Adler. 7 8 Added getPropertyNames to the MethodTable, changed all the virtual 9 implementations of getPropertyNames to static ones, and replaced 10 all call sites with corresponding lookups in the MethodTable. 11 12 * WebProcess/Plugins/Netscape/NPJSObject.cpp: 13 (WebKit::NPJSObject::enumerate): 14 1 15 2011-11-03 Anders Carlsson <andersca@apple.com> 2 16 -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp
r98593 r99256 237 237 238 238 PropertyNameArray propertyNames(exec); 239 m_jsObject-> getPropertyNames(exec, propertyNames);239 m_jsObject->methodTable()->getPropertyNames(m_jsObject.get(), exec, propertyNames, ExcludeDontEnumProperties); 240 240 241 241 NPIdentifier* nameIdentifiers = npnMemNewArray<NPIdentifier>(propertyNames.size());
Note:
See TracChangeset
for help on using the changeset viewer.