Commit 174570f9 authored by barraclough@apple.com's avatar barraclough@apple.com

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

Remove getOwnPropertyDescriptor trap

Reviewed by Geoff Garen.

All implementations of this method are now called via the method table, and equivalent in behaviour.
Remove all duplicate implementations (and the method table trap), and add a single member function implementation on JSObject.

Source/JavaScriptCore: 

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* debugger/DebuggerActivation.cpp:
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayConstructor.cpp:
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.cpp:
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
* runtime/BooleanPrototype.h:
    - remove getOwnPropertyDescriptor
* runtime/ClassInfo.h:
    - remove getOwnPropertyDescriptor from MethodTable
* runtime/DateConstructor.cpp:
* runtime/DateConstructor.h:
* runtime/DatePrototype.cpp:
* runtime/DatePrototype.h:
* runtime/ErrorPrototype.cpp:
* runtime/ErrorPrototype.h:
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
* runtime/JSArray.h:
* runtime/JSArrayBuffer.cpp:
* runtime/JSArrayBuffer.h:
* runtime/JSArrayBufferView.cpp:
* runtime/JSArrayBufferView.h:
* runtime/JSCell.cpp:
* runtime/JSCell.h:
* runtime/JSDataView.cpp:
* runtime/JSDataView.h:
* runtime/JSDataViewPrototype.cpp:
* runtime/JSDataViewPrototype.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
* runtime/JSONObject.h:
    - remove getOwnPropertyDescriptor
* runtime/JSObject.cpp:
(JSC::JSObject::propertyIsEnumerable):
    - switch to call new getOwnPropertyDescriptor member function
(JSC::JSObject::getOwnPropertyDescriptor):
    - new, based on imlementation from GET_OWN_PROPERTY_DESCRIPTOR_IMPL
(JSC::JSObject::defineOwnNonIndexProperty):
    - switch to call new getOwnPropertyDescriptor member function
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
* runtime/JSProxy.h:
* runtime/NamePrototype.cpp:
* runtime/NamePrototype.h:
* runtime/NumberConstructor.cpp:
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.cpp:
* runtime/NumberPrototype.h:
    - remove getOwnPropertyDescriptor
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
    - switch to call new getOwnPropertyDescriptor member function
* runtime/ObjectConstructor.h:
    - remove getOwnPropertyDescriptor
* runtime/PropertyDescriptor.h:
    - remove GET_OWN_PROPERTY_DESCRIPTOR_IMPL
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.cpp:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.cpp:
* runtime/RegExpPrototype.h:
* runtime/StringConstructor.cpp:
* runtime/StringConstructor.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:
    - remove getOwnPropertyDescriptor

Source/WebCore: 

* WebCore.exp.in:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
(GenerateConstructorDeclaration):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bridge/jsc/BridgeJSC.h:
(JSC::Bindings::Instance::getOwnPropertySlot):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
* bridge/runtime_array.cpp:
* bridge/runtime_array.h:
* bridge/runtime_method.cpp:
* bridge/runtime_method.h:
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:
    - remove getOwnPropertyDescriptor

Source/WebKit2: 

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.h:
    - remove getOwnPropertyDescriptor



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6114a00c
......@@ -178,7 +178,6 @@ private:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned, JSValue, bool shouldThrow);
......
......@@ -212,9 +212,6 @@ JSValue JSCallbackObject<Parent>::defaultValue(const JSObject* object, ExecState
return Parent::defaultValue(object, exec, hint);
}
template <class Parent>
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSCallbackObject<Parent>)
template <class Parent>
void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
......
2013-08-20 Gavin Barraclough <barraclough@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=120093
Remove getOwnPropertyDescriptor trap
Reviewed by Geoff Garen.
All implementations of this method are now called via the method table, and equivalent in behaviour.
Remove all duplicate implementations (and the method table trap), and add a single member function implementation on JSObject.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
* debugger/DebuggerActivation.cpp:
* debugger/DebuggerActivation.h:
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayConstructor.cpp:
* runtime/ArrayConstructor.h:
* runtime/ArrayPrototype.cpp:
* runtime/ArrayPrototype.h:
* runtime/BooleanPrototype.cpp:
* runtime/BooleanPrototype.h:
- remove getOwnPropertyDescriptor
* runtime/ClassInfo.h:
- remove getOwnPropertyDescriptor from MethodTable
* runtime/DateConstructor.cpp:
* runtime/DateConstructor.h:
* runtime/DatePrototype.cpp:
* runtime/DatePrototype.h:
* runtime/ErrorPrototype.cpp:
* runtime/ErrorPrototype.h:
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
* runtime/JSArray.h:
* runtime/JSArrayBuffer.cpp:
* runtime/JSArrayBuffer.h:
* runtime/JSArrayBufferView.cpp:
* runtime/JSArrayBufferView.h:
* runtime/JSCell.cpp:
* runtime/JSCell.h:
* runtime/JSDataView.cpp:
* runtime/JSDataView.h:
* runtime/JSDataViewPrototype.cpp:
* runtime/JSDataViewPrototype.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
* runtime/JSONObject.h:
- remove getOwnPropertyDescriptor
* runtime/JSObject.cpp:
(JSC::JSObject::propertyIsEnumerable):
- switch to call new getOwnPropertyDescriptor member function
(JSC::JSObject::getOwnPropertyDescriptor):
- new, based on imlementation from GET_OWN_PROPERTY_DESCRIPTOR_IMPL
(JSC::JSObject::defineOwnNonIndexProperty):
- switch to call new getOwnPropertyDescriptor member function
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
* runtime/JSProxy.h:
* runtime/NamePrototype.cpp:
* runtime/NamePrototype.h:
* runtime/NumberConstructor.cpp:
* runtime/NumberConstructor.h:
* runtime/NumberPrototype.cpp:
* runtime/NumberPrototype.h:
- remove getOwnPropertyDescriptor
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
- switch to call new getOwnPropertyDescriptor member function
* runtime/ObjectConstructor.h:
- remove getOwnPropertyDescriptor
* runtime/PropertyDescriptor.h:
- remove GET_OWN_PROPERTY_DESCRIPTOR_IMPL
* runtime/RegExpConstructor.cpp:
* runtime/RegExpConstructor.h:
* runtime/RegExpMatchesArray.cpp:
* runtime/RegExpMatchesArray.h:
* runtime/RegExpObject.cpp:
* runtime/RegExpObject.h:
* runtime/RegExpPrototype.cpp:
* runtime/RegExpPrototype.h:
* runtime/StringConstructor.cpp:
* runtime/StringConstructor.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:
- remove getOwnPropertyDescriptor
2013-08-20 Mark Hahnenberg <mhahnenberg@apple.com>
<https://webkit.org/b/120079> Flattening a dictionary can cause CopiedSpace corruption
......
......@@ -95,8 +95,6 @@ void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec,
thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(DebuggerActivation)
bool DebuggerActivation::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, bool shouldThrow)
{
DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
......
......@@ -48,7 +48,6 @@ namespace JSC {
static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
DECLARE_EXPORT_INFO;
......
......@@ -152,8 +152,6 @@ bool Arguments::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyNa
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(Arguments)
void Arguments::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
Arguments* thisObject = jsCast<Arguments*>(object);
......
......@@ -99,7 +99,6 @@ private:
static void destroy(JSCell*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void getOwnPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
......
......@@ -71,8 +71,6 @@ bool ArrayConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, Pro
return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(ArrayConstructor)
// ------------------------------ Functions ---------------------------
JSObject* constructArrayWithSizeQuirk(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, JSValue length)
......
......@@ -55,8 +55,6 @@ private:
ArrayConstructor(JSGlobalObject*, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static ConstructType getConstructData(JSCell*, ConstructData&);
static CallType getCallData(JSCell*, CallData&);
};
......
......@@ -141,8 +141,6 @@ bool ArrayPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, Prope
return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(ArrayPrototype)
// ------------------------------ Array Functions ----------------------------
// Helper function
......
......@@ -36,7 +36,6 @@ public:
static ArrayPrototype* create(ExecState*, JSGlobalObject*, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
DECLARE_INFO;
......
......@@ -68,8 +68,6 @@ bool BooleanPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, Pro
return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(BooleanPrototype)
// ------------------------------ Functions ---------------------------
EncodedJSValue JSC_HOST_CALL booleanProtoFuncToString(ExecState* exec)
......
......@@ -50,8 +50,6 @@ protected:
private:
BooleanPrototype(ExecState*, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
};
} // namespace JSC
......
......@@ -95,9 +95,6 @@ struct MethodTable {
typedef bool (*DefineOwnPropertyFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool);
DefineOwnPropertyFunctionPtr defineOwnProperty;
typedef bool (*GetOwnPropertyDescriptorFunctionPtr)(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
GetOwnPropertyDescriptorFunctionPtr getOwnPropertyDescriptor;
typedef void (*SlowDownAndWasteMemory)(JSArrayBufferView*);
SlowDownAndWasteMemory slowDownAndWasteMemory;
......@@ -145,7 +142,6 @@ struct MethodTable {
&ClassName::customHasInstance, \
&ClassName::putDirectVirtual, \
&ClassName::defineOwnProperty, \
&ClassName::getOwnPropertyDescriptor, \
&ClassName::slowDownAndWasteMemory, \
&ClassName::getTypedArrayImpl \
}, \
......
......@@ -91,8 +91,6 @@ bool DateConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, Prop
return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(DateConstructor)
// ECMA 15.9.3
JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args)
{
......
......@@ -55,8 +55,6 @@ namespace JSC {
static CallType getCallData(JSCell*, CallData&);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
};
JSObject* constructDate(ExecState*, JSGlobalObject*, const ArgList&);
......
......@@ -519,8 +519,6 @@ bool DatePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, Proper
return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(DatePrototype)
// Functions
EncodedJSValue JSC_HOST_CALL dateProtoFuncToString(ExecState* exec)
......
......@@ -42,8 +42,6 @@ namespace JSC {
}
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
DECLARE_INFO;
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
......
......@@ -66,8 +66,6 @@ bool ErrorPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, Prope
return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(ErrorPrototype)
// ------------------------------ Functions ---------------------------
// ECMA-262 5.1, 15.11.4.4
......
......@@ -53,7 +53,6 @@ namespace JSC {
private:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
};
} // namespace JSC
......
......@@ -178,8 +178,6 @@ bool JSActivation::getOwnPropertySlot(JSObject* object, ExecState* exec, Propert
return false;
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSActivation)
void JSActivation::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSActivation* thisObject = jsCast<JSActivation*>(cell);
......
......@@ -64,7 +64,6 @@ namespace JSC {
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
......
......@@ -189,8 +189,6 @@ bool JSArray::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName
return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSArray)
// ECMA 15.4.5.1
void JSArray::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
......
......@@ -56,7 +56,6 @@ public:
JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool throwException);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
DECLARE_EXPORT_INFO;
......
......@@ -78,8 +78,6 @@ bool JSArrayBuffer::getOwnPropertySlot(
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSArrayBuffer)
void JSArrayBuffer::put(
JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value,
PutPropertySlot& slot)
......
......@@ -50,7 +50,6 @@ public:
protected:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
......
......@@ -139,8 +139,6 @@ bool JSArrayBufferView::getOwnPropertySlot(
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSArrayBufferView)
void JSArrayBufferView::put(
JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value,
PutPropertySlot& slot)
......
......@@ -124,7 +124,6 @@ protected:
JS_EXPORT_PRIVATE void finishCreation(VM&);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
......
......@@ -218,8 +218,6 @@ bool JSCell::defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDesc
return false;
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSCell)
void JSCell::slowDownAndWasteMemory(JSArrayBufferView*)
{
RELEASE_ASSERT_NOT_REACHED();
......
......@@ -165,7 +165,6 @@ protected:
JS_EXPORT_PRIVATE static bool customHasInstance(JSObject*, ExecState*, JSValue);
static NO_RETURN_DUE_TO_CRASH void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
JS_EXPORT_PRIVATE static NO_RETURN_DUE_TO_CRASH void slowDownAndWasteMemory(JSArrayBufferView*);
......
......@@ -95,8 +95,6 @@ bool JSDataView::getOwnPropertySlot(
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSDataView)
void JSDataView::slowDownAndWasteMemory(JSArrayBufferView*)
{
UNREACHABLE_FOR_PLATFORM();
......
......@@ -56,7 +56,6 @@ public:
protected:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void slowDownAndWasteMemory(JSArrayBufferView*);
static PassRefPtr<ArrayBufferView> getTypedArrayImpl(JSArrayBufferView*);
......
......@@ -90,8 +90,6 @@ bool JSDataViewPrototype::getOwnPropertySlot(
propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSDataViewPrototype)
template<typename Adaptor>
EncodedJSValue getData(ExecState* exec)
{
......
......@@ -46,8 +46,6 @@ public:
protected:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(
JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | Base::StructureFlags;
};
......
......@@ -302,8 +302,6 @@ bool JSFunction::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyN
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSFunction)
void JSFunction::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
{
JSFunction* thisObject = jsCast<JSFunction*>(object);
......
......@@ -171,7 +171,6 @@ namespace JSC {
ObjectAllocationProfile* createAllocationProfile(ExecState*, size_t inlineCapacity);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void getOwnNonIndexPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode = ExcludeDontEnumProperties);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
......
......@@ -228,7 +228,6 @@ protected:
static const unsigned StructureFlags = OverridesGetPropertyNames | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | Base::StructureFlags;
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, PropertyDescriptor&, bool shouldThrow);
static bool deleteProperty(JSCell*, ExecState*, PropertyName);
......
......@@ -233,9 +233,6 @@ bool JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot(
return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}
template<typename Adaptor>
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSGenericTypedArrayView<Adaptor>)
template<typename Adaptor>
void JSGenericTypedArrayView<Adaptor>::put(
JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value,
......
......@@ -641,8 +641,6 @@ bool JSGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* exec, Prope
return symbolTableGet(thisObject, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSGlobalObject)
void JSGlobalObject::clearRareData(JSCell* cell)
{
jsCast<JSGlobalObject*>(cell)->m_rareData.clear();
......
......@@ -248,7 +248,6 @@ public:
JS_EXPORT_PRIVATE static void visitChildren(JSCell*, SlotVisitor&);
JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
bool hasOwnPropertyForWrite(ExecState*, PropertyName);
JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
......
......@@ -58,8 +58,6 @@ bool JSNotAnObject::getOwnPropertySlotByIndex(JSObject*, ExecState* exec, unsign
return false;
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSNotAnObject)
void JSNotAnObject::put(JSCell*, ExecState* exec, PropertyName , JSValue, PutPropertySlot&)
{
ASSERT_UNUSED(exec, exec->hadException());
......
......@@ -70,7 +70,6 @@ namespace JSC {
// JSObject methods
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue, bool shouldThrow);
......
......@@ -596,8 +596,6 @@ bool JSONObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyN
return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSONObject)
class Walker {
public:
Walker(ExecState* exec, Handle<JSObject> function, CallType callType, CallData callData)
......
......@@ -57,7 +57,6 @@ namespace JSC {
private:
JSONObject(JSGlobalObject*, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
};
......
......@@ -1410,7 +1410,7 @@ bool JSObject::defaultHasInstance(ExecState* exec, JSValue value, JSValue proto)
bool JSObject::propertyIsEnumerable(ExecState* exec, const Identifier& propertyName) const
{
PropertyDescriptor descriptor;
if (!const_cast<JSObject*>(this)->methodTable()->getOwnPropertyDescriptor(const_cast<JSObject*>(this), exec, propertyName, descriptor))
if (!const_cast<JSObject*>(this)->getOwnPropertyDescriptor(exec, propertyName, descriptor))
return false;
return descriptor.enumerable();
}
......@@ -2381,7 +2381,20 @@ Butterfly* JSObject::growOutOfLineStorage(VM& vm, size_t oldSize, size_t newSize
return m_butterfly->growPropertyStorage(vm, this, structure(), oldSize, newSize);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSObject)
bool JSObject::getOwnPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
{
JSC::PropertySlot slot(this);
if (!methodTable()->getOwnPropertySlot(this, exec, propertyName, slot))
return false;
/* Workaround, JSDOMWindow::getOwnPropertySlot searches the prototype chain. :-( */
if (slot.slotBase() != this && slot.slotBase() && slot.slotBase()->methodTable()->toThis(slot.slotBase(), exec, NotStrictMode) != this)
return false;
if (slot.isAccessor())
descriptor.setAccessorDescriptor(slot.getterSetter(), slot.attributes());
else
descriptor.setDescriptor(slot.getValue(exec, propertyName), slot.attributes());
return true;
}
static bool putDescriptor(ExecState* exec, JSObject* target, PropertyName propertyName, PropertyDescriptor& descriptor, unsigned attributes, const PropertyDescriptor& oldDescriptor)
{
......@@ -2457,7 +2470,7 @@ bool JSObject::defineOwnNonIndexProperty(ExecState* exec, PropertyName propertyN
// If we have a new property we can just put it on normally
PropertyDescriptor current;
if (!methodTable()->getOwnPropertyDescriptor(this, exec, propertyName, current)) {
if (!getOwnPropertyDescriptor(exec, propertyName, current)) {
// unless extensions are prevented!
if (!isExtensible()) {
if (throwException)
......
......@@ -126,7 +126,7 @@ public:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned propertyName, PropertySlot&);
JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
bool getOwnPropertyDescriptor(ExecState*, PropertyName, PropertyDescriptor&);
bool allowsAccessFrom(ExecState*);
......
......@@ -82,8 +82,6 @@ bool JSProxy::getOwnPropertySlotByIndex(JSObject* object, ExecState* exec, unsig
return thisObject->target()->methodTable()->getOwnPropertySlotByIndex(thisObject->target(), exec, propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSProxy)
void JSProxy::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSProxy* thisObject = jsCast<JSProxy*>(cell);
......
......@@ -76,7 +76,6 @@ protected:
JS_EXPORT_PRIVATE static String className(const JSObject*);
JS_EXPORT_PRIVATE static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
JS_EXPORT_PRIVATE static bool getOwnPropertySlotByIndex(JSObject*, ExecState*, unsigned, PropertySlot&);
JS_EXPORT_PRIVATE static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
JS_EXPORT_PRIVATE static void put(JSCell*, ExecState*, PropertyName, JSValue, PutPropertySlot&);
JS_EXPORT_PRIVATE static void putByIndex(JSCell*, ExecState*, unsigned, JSValue, bool shouldThrow);
JS_EXPORT_PRIVATE static void putDirectVirtual(JSObject*, ExecState*, PropertyName, JSValue, unsigned attributes);
......
......@@ -63,8 +63,6 @@ bool NamePrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, Proper
return getStaticFunctionSlot<Base>(exec, ExecState::privateNamePrototypeTable(exec), jsCast<NamePrototype*>(object), propertyName, slot);
}
GET_OWN_PROPERTY_DESCRIPTOR_IMPL(NamePrototype)
// ------------------------------ Functions ---------------------------
EncodedJSValue JSC_HOST_CALL privateNameProtoFuncToString(ExecState* exec)
......
......@@ -56,7 +56,6 @@ protected:
private:
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, PropertyName, PropertyDescriptor&);
};
} // namespace JSC
......