Commit 7f2f7e53 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

De-virtualize JSObject::getOwnPropertyDescriptor

https://bugs.webkit.org/show_bug.cgi?id=71523

Reviewed by Sam Weinig.

Source/JavaScriptCore: 

Added getOwnPropertyDescriptor to the MethodTable, changed all of the 
virtual versions of getOwnPropertyDescriptor to static ones, and 
changed all of the call sites to the corresponding lookup in the MethodTable.

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::getOwnPropertyDescriptor):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::getOwnPropertyDescriptor):
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
(JSC::Arguments::getOwnPropertyDescriptor):
* runtime/Arguments.h:
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getOwnPropertyDescriptor):
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::getOwnPropertyDescriptor):
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::getOwnPropertyDescriptor):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::getOwnPropertyDescriptor):
* runtime/DateConstructor.h:
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::getOwnPropertyDescriptor):
* runtime/DatePrototype.h:
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::getOwnPropertyDescriptor):
* runtime/ErrorPrototype.h:
* runtime/JSArray.cpp:
(JSC::JSArray::getOwnPropertyDescriptor):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::getOwnPropertyDescriptor):
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::getOwnPropertyDescriptor):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertyDescriptor):
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::getOwnPropertyDescriptor):
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
(JSC::JSNotAnObject::getOwnPropertyDescriptor):
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::JSONObject::getOwnPropertyDescriptor):
* runtime/JSONObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::vtableAnchor):
(JSC::JSObject::propertyIsEnumerable):
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::JSObject::getPropertyDescriptor):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
* runtime/JSString.cpp: Removed getOwnPropertyDescriptor, since this seems to be a relic from a 
bygone era when getOwnPropertyDescriptor was rooted in JSCell rather than JSObject.  There were 
no call sites for this version of getOwnPropertyDescriptor in the entire project.
* runtime/JSString.h:
* runtime/Lookup.h:
(JSC::getStaticPropertyDescriptor):
(JSC::getStaticFunctionDescriptor):
(JSC::getStaticValueDescriptor):
* runtime/MathObject.cpp:
(JSC::MathObject::getOwnPropertyDescriptor):
* runtime/MathObject.h:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertyDescriptor):
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::getOwnPropertyDescriptor):
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::getOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptor):
* runtime/ObjectConstructor.h:
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::getOwnPropertyDescriptor):
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::getOwnPropertyDescriptor):
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::getOwnPropertyDescriptor):
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::getOwnPropertyDescriptor):
* runtime/RegExpPrototype.h:
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::getOwnPropertyDescriptor):
* runtime/StringConstructor.h:
* runtime/StringObject.cpp:
(JSC::StringObject::vtableAnchor): Added to prevent a weak vtable.
(JSC::StringObject::getOwnPropertyDescriptor):
* runtime/StringObject.h:
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::getOwnPropertyDescriptor):
* runtime/StringPrototype.h:

Source/WebCore: 

No new tests.

Added getOwnPropertyDescriptor to the MethodTable, changed all of the 
virtual versions of getOwnPropertyDescriptor to static ones, and 
changed all of the call sites to the corresponding lookup in the MethodTable.

* WebCore.exp.in:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSWorkerContextCustom.cpp:
(WebCore::JSWorkerContext::getOwnPropertyDescriptorDelegate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorDeclaration):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestInterface::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestObj::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor):
(WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::getOwnPropertyDescriptor):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):
* bridge/qt/qt_runtime.h:
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertyDescriptor):
* bridge/runtime_array.h:
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::vtableAnchor): Added to prevent a weak vtable.
(JSC::RuntimeMethod::getOwnPropertyDescriptor):
* bridge/runtime_method.h: Changed getOwnPropertyDescriptor from private to protected to allow 
subclasses to use it in their MethodTables.
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
* bridge/runtime_object.h:

Source/WebKit2: 

Added getOwnPropertyDescriptor to the MethodTable, changed all of the 
virtual versions of getOwnPropertyDescriptor to static ones, and 
changed all of the call sites to the corresponding lookup in the MethodTable.

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::getOwnPropertyDescriptor):
* WebProcess/Plugins/Netscape/JSNPObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2172b954
......@@ -178,7 +178,7 @@ private:
static UString className(const JSObject*);
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
......
......@@ -184,10 +184,11 @@ bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec,
}
template <class Parent>
bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object);
PropertySlot slot;
if (methodTable()->getOwnPropertySlot(this, exec, propertyName, slot)) {
if (thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
// Ideally we should return an access descriptor, but returning a value descriptor is better than nothing.
JSValue value = slot.getValue(exec, propertyName);
if (!exec->hadException())
......@@ -199,7 +200,7 @@ bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(ExecState* exec, const I
return true;
}
return Parent::getOwnPropertyDescriptor(exec, propertyName, descriptor);
return Parent::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
template <class Parent>
......
2011-11-09 Mark Hahnenberg <mhahnenberg@apple.com>
De-virtualize JSObject::getOwnPropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=71523
Reviewed by Sam Weinig.
Added getOwnPropertyDescriptor to the MethodTable, changed all of the
virtual versions of getOwnPropertyDescriptor to static ones, and
changed all of the call sites to the corresponding lookup in the MethodTable.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::getOwnPropertyDescriptor):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::getOwnPropertyDescriptor):
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
(JSC::Arguments::getOwnPropertyDescriptor):
* runtime/Arguments.h:
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getOwnPropertyDescriptor):
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::getOwnPropertyDescriptor):
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::getOwnPropertyDescriptor):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::getOwnPropertyDescriptor):
* runtime/DateConstructor.h:
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::getOwnPropertyDescriptor):
* runtime/DatePrototype.h:
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::getOwnPropertyDescriptor):
* runtime/ErrorPrototype.h:
* runtime/JSArray.cpp:
(JSC::JSArray::getOwnPropertyDescriptor):
* runtime/JSArray.h:
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::getOwnPropertyDescriptor):
* runtime/JSByteArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::getOwnPropertyDescriptor):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertyDescriptor):
* runtime/JSFunction.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::getOwnPropertyDescriptor):
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
(JSC::JSNotAnObject::getOwnPropertyDescriptor):
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::JSONObject::getOwnPropertyDescriptor):
* runtime/JSONObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::vtableAnchor):
(JSC::JSObject::propertyIsEnumerable):
(JSC::JSObject::getOwnPropertyDescriptor):
(JSC::JSObject::getPropertyDescriptor):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
* runtime/JSString.cpp: Removed getOwnPropertyDescriptor, since this seems to be a relic from a
bygone era when getOwnPropertyDescriptor was rooted in JSCell rather than JSObject. There were
no call sites for this version of getOwnPropertyDescriptor in the entire project.
* runtime/JSString.h:
* runtime/Lookup.h:
(JSC::getStaticPropertyDescriptor):
(JSC::getStaticFunctionDescriptor):
(JSC::getStaticValueDescriptor):
* runtime/MathObject.cpp:
(JSC::MathObject::getOwnPropertyDescriptor):
* runtime/MathObject.h:
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertyDescriptor):
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::getOwnPropertyDescriptor):
* runtime/NumberPrototype.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::getOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptor):
* runtime/ObjectConstructor.h:
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::getOwnPropertyDescriptor):
* runtime/ObjectPrototype.h:
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::getOwnPropertyDescriptor):
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::getOwnPropertyDescriptor):
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::getOwnPropertyDescriptor):
* runtime/RegExpPrototype.h:
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::getOwnPropertyDescriptor):
* runtime/StringConstructor.h:
* runtime/StringObject.cpp:
(JSC::StringObject::vtableAnchor): Added to prevent a weak vtable.
(JSC::StringObject::getOwnPropertyDescriptor):
* runtime/StringObject.h:
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::getOwnPropertyDescriptor):
* runtime/StringPrototype.h:
2011-11-09 Gavin Barraclough <barraclough@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=71873
......@@ -121,6 +121,7 @@ __ZN3JSC11JSByteArray10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
__ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataEPNS_14JSGlobalObjectENS_7JSValueEPKNS_9ClassInfoE
__ZN3JSC11JSByteArray18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC11JSByteArray19getOwnPropertyNamesEPNS_8JSObjectEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
__ZN3JSC11JSByteArray24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC11JSByteArray25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC11JSByteArray3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC11JSByteArray6s_infoE
......@@ -156,7 +157,6 @@ __ZN3JSC12SamplingTool5setupEv
__ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE
__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
__ZN3JSC12StringObject14finishCreationERNS_12JSGlobalDataEPNS_8JSStringE
__ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC12StringObject6s_infoE
__ZN3JSC12StringObjectC2ERNS_12JSGlobalDataEPNS_9StructureE
__ZN3JSC13JSFinalObject6s_infoE
......@@ -172,7 +172,7 @@ __ZN3JSC14JSGlobalObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC14JSGlobalObject16addStaticGlobalsEPNS0_18GlobalPropertyInfoEi
__ZN3JSC14JSGlobalObject17putWithAttributesEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueEj
__ZN3JSC14JSGlobalObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC14JSGlobalObject24getOwnPropertyDescriptorEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC14JSGlobalObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
__ZN3JSC14JSGlobalObject6s_infoE
......@@ -311,6 +311,7 @@ __ZN3JSC8JSObject12defineSetterEPS0_PNS_9ExecStateERKNS_10IdentifierES1_j
__ZN3JSC8JSObject12lookupGetterEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC8JSObject12lookupSetterEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC8JSObject12toThisObjectEPNS_6JSCellEPNS_9ExecStateE
__ZN3JSC8JSObject12vtableAnchorEv
__ZN3JSC8JSObject13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC8JSObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC8JSObject16getPropertyNamesEPS0_PNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
......@@ -323,7 +324,7 @@ __ZN3JSC8JSObject21deletePropertyByIndexEPNS_6JSCellEPNS_9ExecStateEj
__ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
__ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
__ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8JSObject24getOwnPropertyDescriptorEPS0_PNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8JSObject25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC8JSObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC8JSObject6s_infoE
......
......@@ -190,10 +190,9 @@ EXPORTS
?getCallData@JSCell@JSC@@SA?AW4CallType@2@PAV12@AATCallData@2@@Z
?getConstructData@JSCell@JSC@@SA?AW4ConstructType@2@PAV12@AATConstructData@2@@Z
?getObject@JSCell@JSC@@QAEPAVJSObject@2@XZ
?getOwnPropertyDescriptor@JSGlobalObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSByteArray@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSGlobalObject@JSC@@SA_NPAVJSObject@2@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyDescriptor@JSObject@JSC@@SA_NPAV12@PAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z
?getOwnPropertyNames@JSByteArray@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getOwnPropertyNames@JSObject@JSC@@SAXPAV12@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
?getOwnPropertyNames@JSVariableObject@JSC@@SAXPAVJSObject@2@PAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z
......@@ -352,6 +351,7 @@ EXPORTS
?visitChildren@JSGlobalThis@JSC@@KAXPAVJSCell@2@AAVSlotVisitor@2@@Z
?visitChildren@JSObject@JSC@@SAXPAVJSCell@2@AAVSlotVisitor@2@@Z
?vtableAnchor@InternalFunction@JSC@@EAEXXZ
?vtableAnchor@JSObject@JSC@@UAEXXZ
?wait@ThreadCondition@WTF@@QAEXAAVMutex@2@@Z
?waitForThreadCompletion@WTF@@YAHIPAPAX@Z
?writable@PropertyDescriptor@JSC@@QBE_NXZ
......
......@@ -91,9 +91,10 @@ void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec,
thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode);
}
bool DebuggerActivation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return m_activation->getOwnPropertyDescriptor(exec, propertyName, descriptor);
DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
return thisObject->m_activation->methodTable()->getOwnPropertyDescriptor(thisObject->m_activation.get(), exec, propertyName, descriptor);
}
void DebuggerActivation::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)
......
......@@ -48,7 +48,7 @@ namespace JSC {
static void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void defineGetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes);
static void defineSetter(JSObject*, ExecState*, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes);
......
......@@ -215,35 +215,36 @@ bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifi
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
bool Arguments::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
Arguments* thisObject = static_cast<Arguments*>(object);
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex && i < d->numArguments && (!d->deletedArguments || !d->deletedArguments[i])) {
if (i < d->numParameters) {
descriptor.setDescriptor(d->registers[d->firstParameterIndex + i].get(), None);
if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
if (i < thisObject->d->numParameters) {
descriptor.setDescriptor(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get(), None);
} else
descriptor.setDescriptor(d->extraArguments[i - d->numParameters].get(), None);
descriptor.setDescriptor(thisObject->d->extraArguments[i - thisObject->d->numParameters].get(), None);
return true;
}
if (propertyName == exec->propertyNames().length && LIKELY(!d->overrodeLength)) {
descriptor.setDescriptor(jsNumber(d->numArguments), DontEnum);
if (propertyName == exec->propertyNames().length && LIKELY(!thisObject->d->overrodeLength)) {
descriptor.setDescriptor(jsNumber(thisObject->d->numArguments), DontEnum);
return true;
}
if (propertyName == exec->propertyNames().callee && LIKELY(!d->overrodeCallee)) {
if (!d->isStrictMode) {
descriptor.setDescriptor(d->callee.get(), DontEnum);
if (propertyName == exec->propertyNames().callee && LIKELY(!thisObject->d->overrodeCallee)) {
if (!thisObject->d->isStrictMode) {
descriptor.setDescriptor(thisObject->d->callee.get(), DontEnum);
return true;
}
createStrictModeCalleeIfNecessary(exec);
thisObject->createStrictModeCalleeIfNecessary(exec);
}
if (propertyName == exec->propertyNames().caller && d->isStrictMode)
createStrictModeCallerIfNecessary(exec);
if (propertyName == exec->propertyNames().caller && thisObject->d->isStrictMode)
thisObject->createStrictModeCallerIfNecessary(exec);
return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
void Arguments::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
......
......@@ -137,7 +137,7 @@ namespace JSC {
void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
......
......@@ -68,9 +68,9 @@ bool ArrayConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const I
return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(cell), propertyName, slot);
}
bool ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(object), propertyName, descriptor);
}
// ------------------------------ Functions ---------------------------
......
......@@ -53,7 +53,7 @@ namespace JSC {
ArrayConstructor(JSGlobalObject*, Structure*);
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
......
......@@ -130,9 +130,9 @@ bool ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ide
return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(cell), propertyName, slot);
}
bool ArrayPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool ArrayPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(object), propertyName, descriptor);
}
// ------------------------------ Array Functions ----------------------------
......
......@@ -41,7 +41,7 @@ namespace JSC {
}
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static const ClassInfo s_info;
......
......@@ -67,9 +67,9 @@ bool BooleanPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const I
return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(cell), propertyName, slot);
}
bool BooleanPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool BooleanPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(object), propertyName, descriptor);
}
// ------------------------------ Functions ---------------------------
......
......@@ -51,7 +51,7 @@ namespace JSC {
BooleanPrototype(ExecState*, Structure*);
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
};
} // namespace JSC
......
......@@ -89,6 +89,9 @@ namespace JSC {
typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&, bool);
DefineOwnPropertyFunctionPtr defineOwnProperty;
typedef bool (*GetOwnPropertyDescriptorFunctionPtr)(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
GetOwnPropertyDescriptorFunctionPtr getOwnPropertyDescriptor;
};
#define CREATE_MEMBER_CHECKER(member) \
......@@ -130,6 +133,7 @@ struct MemberCheck##member { \
&ClassName::hasInstance, \
&ClassName::putWithAttributes, \
&ClassName::defineOwnProperty, \
&ClassName::getOwnPropertyDescriptor, \
}, \
sizeof(ClassName)
......
......@@ -90,9 +90,9 @@ bool DateConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Id
return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(cell), propertyName, slot);
}
bool DateConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool DateConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(object), propertyName, descriptor);
}
// ECMA 15.9.3
......
......@@ -56,7 +56,7 @@ namespace JSC {
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
};
JSObject* constructDate(ExecState*, JSGlobalObject*, const ArgList&);
......
......@@ -448,9 +448,9 @@ bool DatePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Iden
return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(cell), propertyName, slot);
}
bool DatePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool DatePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(object), propertyName, descriptor);
}
// Functions
......
......@@ -42,7 +42,7 @@ namespace JSC {
}
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static const ClassInfo s_info;
......
......@@ -67,9 +67,9 @@ bool ErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ide
return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(cell), propertyName, slot);
}
bool ErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool ErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), this, propertyName, descriptor);
return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(object), propertyName, descriptor);
}
// ------------------------------ Functions ---------------------------
......
......@@ -53,7 +53,7 @@ namespace JSC {
private:
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
};
} // namespace JSC
......
......@@ -291,21 +291,22 @@ bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
JSArray* thisObject = static_cast<JSArray*>(object);
if (propertyName == exec->propertyNames().length) {
descriptor.setDescriptor(jsNumber(length()), DontDelete | DontEnum);
descriptor.setDescriptor(jsNumber(thisObject->length()), DontDelete | DontEnum);
return true;
}
ArrayStorage* storage = m_storage;
ArrayStorage* storage = thisObject->m_storage;
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex) {
if (i >= storage->m_length)
return false;
if (i < m_vectorLength) {
if (i < thisObject->m_vectorLength) {
WriteBarrier<Unknown>& value = storage->m_vector[i];
if (value) {
descriptor.setDescriptor(value.get(), 0);
......@@ -321,7 +322,7 @@ bool JSArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& proper
}
}
}
return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
// ECMA 15.4.5.1
......
......@@ -96,7 +96,7 @@ namespace JSC {
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
static JS_EXPORTDATA const ClassInfo s_info;
......
......@@ -66,15 +66,16 @@ bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identi
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
bool JSByteArray::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool JSByteArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
JSByteArray* thisObject = static_cast<JSByteArray*>(object);
bool ok;
unsigned index = propertyName.toUInt32(ok);
if (ok && canAccessIndex(index)) {
descriptor.setDescriptor(getIndex(exec, index), DontDelete);
if (ok && thisObject->canAccessIndex(index)) {
descriptor.setDescriptor(thisObject->getIndex(exec, index), DontDelete);
return true;
}
return JSObject::getOwnPropertyDescriptor(exec, propertyName, descriptor);
return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
}
bool JSByteArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
......
......@@ -90,7 +90,7 @@ namespace JSC {
static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue);
......
......@@ -207,4 +207,10 @@ bool JSCell::defineOwnProperty(JSObject*, ExecState*, const Identifier&, Propert
return false;
}
bool JSCell::getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&)
{
ASSERT_NOT_REACHED();
return false;
}
} // namespace JSC
......@@ -150,6 +150,7 @@ namespace JSC {
static bool hasInstance(JSObject*, ExecState*, JSValue, JSValue prototypeProperty);
static NO_RETURN_DUE_TO_ASSERT void putWithAttributes(JSObject*, ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
static bool defineOwnProperty(JSObject*, ExecState*, const Identifier& propertyName, PropertyDescriptor&, bool shouldThrow);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
private:
WriteBarrier<Structure> m_structure;
......
......@@ -251,51 +251,52 @@ bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identif
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
bool JSFunction::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
if (isHostFunction())
return Base::getOwnPropertyDescriptor(exec, propertyName, descriptor);
JSFunction* thisObject = static_cast<JSFunction*>(object);