Commit c0f87c17 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Remove deletePropertyVirtual

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

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Removed all declarations and definitions of deletePropertyVirtual.
Also replaced all call sites to deletePropertyVirtual with a 
corresponding lookup in the MethodTable.

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::deletePropertyByIndex):
* API/JSObjectRef.cpp:
(JSObjectDeleteProperty):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::deleteProperty):
* debugger/DebuggerActivation.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
(JSC::JSArray::deleteProperty):
(JSC::JSArray::deletePropertyByIndex):
* runtime/JSArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::deleteProperty):
(JSC::JSCell::deletePropertyByIndex):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::Walker::walk):
* runtime/JSObject.cpp:
(JSC::JSObject::deletePropertyByIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
* runtime/JSVariableObject.cpp:
* runtime/JSVariableObject.h:
* runtime/RegExpMatchesArray.h:
* runtime/StrictEvalActivation.cpp:
* runtime/StrictEvalActivation.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:

Source/WebCore: 

No new tests.

Removed all declarations and definitions of deletePropertyVirtual.
Also replaced all call sites to deletePropertyVirtual with a 
corresponding lookup in the MethodTable.

* WebCore.exp.in:
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::deleteProperty):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::deleteProperty):
* bindings/js/JSDOMWindowShell.h:
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::deleteProperty):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::deleteProperty):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::deleteProperty):
* bindings/js/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::remove):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject removeWebScriptKey:]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bridge/NP_jsobject.cpp:
(_NPN_RemoveProperty):
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::removeMember):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
* bridge/runtime_array.cpp:
* bridge/runtime_array.h:
* bridge/runtime_object.cpp:
* bridge/runtime_object.h:

Source/WebKit/mac: 

Removed all declarations and definitions of deletePropertyVirtual.
Also replaced all call sites to deletePropertyVirtual with a 
corresponding lookup in the MethodTable.

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::removeProperty):

Source/WebKit2: 

Removed all declarations and definitions of deletePropertyVirtual.
Also replaced all call sites to deletePropertyVirtual with a 
corresponding lookup in the MethodTable.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5552cc43
......@@ -184,9 +184,7 @@ private:
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual bool deletePropertyVirtual(ExecState*, const Identifier&);
static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
virtual bool deletePropertyVirtual(ExecState*, unsigned);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned);
virtual bool hasInstance(ExecState* exec, JSValue value, JSValue proto);
......
......@@ -266,12 +266,6 @@ void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifi
return Parent::put(thisObject, exec, propertyName, value, slot);
}
template <class Parent>
bool JSCallbackObject<Parent>::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
template <class Parent>
bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
......@@ -316,16 +310,11 @@ bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, con
return Parent::deleteProperty(thisObject, exec, propertyName);
}
template <class Parent>
bool JSCallbackObject<Parent>::deletePropertyVirtual(ExecState* exec, unsigned propertyName)
{
return deletePropertyByIndex(this, exec, propertyName);
}
template <class Parent>
bool JSCallbackObject<Parent>::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
{
return static_cast<JSCallbackObject*>(cell)->deletePropertyVirtual(exec, Identifier::from(exec, propertyName));
JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
}
template <class Parent>
......
......@@ -327,7 +327,7 @@ bool JSObjectDeleteProperty(JSContextRef ctx, JSObjectRef object, JSStringRef pr
JSObject* jsObject = toJS(object);
bool result = jsObject->deletePropertyVirtual(exec, propertyName->identifier(&exec->globalData()));
bool result = jsObject->methodTable()->deleteProperty(jsObject, exec, propertyName->identifier(&exec->globalData()));
if (exec->hadException()) {
if (exception)
*exception = toRef(exec, exec->exception());
......
2011-10-25 Mark Hahnenberg <mhahnenberg@apple.com>
Remove deletePropertyVirtual
https://bugs.webkit.org/show_bug.cgi?id=70738
Reviewed by Geoffrey Garen.
Removed all declarations and definitions of deletePropertyVirtual.
Also replaced all call sites to deletePropertyVirtual with a
corresponding lookup in the MethodTable.
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::::deletePropertyByIndex):
* API/JSObjectRef.cpp:
(JSObjectDeleteProperty):
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::deleteProperty):
* debugger/DebuggerActivation.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/Arguments.cpp:
* runtime/Arguments.h:
* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
* runtime/JSActivation.cpp:
* runtime/JSActivation.h:
* runtime/JSArray.cpp:
(JSC::JSArray::deleteProperty):
(JSC::JSArray::deletePropertyByIndex):
* runtime/JSArray.h:
* runtime/JSCell.cpp:
(JSC::JSCell::deleteProperty):
(JSC::JSCell::deletePropertyByIndex):
* runtime/JSCell.h:
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
* runtime/JSNotAnObject.cpp:
* runtime/JSNotAnObject.h:
* runtime/JSONObject.cpp:
(JSC::Walker::walk):
* runtime/JSObject.cpp:
(JSC::JSObject::deletePropertyByIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
* runtime/JSVariableObject.cpp:
* runtime/JSVariableObject.h:
* runtime/RegExpMatchesArray.h:
* runtime/StrictEvalActivation.cpp:
* runtime/StrictEvalActivation.h:
* runtime/StringObject.cpp:
* runtime/StringObject.h:
2011-10-25 Mark Hahnenberg <mhahnenberg@apple.com>
Remove putVirtual
......@@ -196,7 +196,6 @@ __ZN3JSC16InternalFunctionC2EPNS_14JSGlobalObjectEPNS_9StructureE
__ZN3JSC16JSVariableObject14deletePropertyEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
__ZN3JSC16JSVariableObject21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC16createRangeErrorEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC16slowValidateCellEPNS_14JSGlobalObjectE
__ZN3JSC16slowValidateCellEPNS_6JSCellE
......@@ -261,8 +260,6 @@ __ZN3JSC4Yarr9interpretEPNS0_15BytecodePatternERKNS_7UStringEjjPi
__ZN3JSC4callEPNS_9ExecStateENS_7JSValueENS_8CallTypeERKNS_8CallDataES2_RKNS_7ArgListE
__ZN3JSC6JSCell11getCallDataEPS0_RNS_8CallDataE
__ZN3JSC6JSCell16getConstructDataEPS0_RNS_13ConstructDataE
__ZN3JSC6JSCell21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC6JSCell21deletePropertyVirtualEPNS_9ExecStateEj
__ZN3JSC6JSCell25getOwnPropertySlotVirtualEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC6JSCell25getOwnPropertySlotVirtualEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC6JSCell9getObjectEv
......@@ -325,8 +322,6 @@ __ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_7JSValu
__ZN3JSC8JSObject17putWithAttributesEPNS_9ExecStateEjNS_7JSValueEj
__ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
__ZN3JSC8JSObject21deletePropertyByIndexEPNS_6JSCellEPNS_9ExecStateEj
__ZN3JSC8JSObject21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC8JSObject21deletePropertyVirtualEPNS_9ExecStateEj
__ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
__ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
......
......@@ -146,11 +146,6 @@ EXPORTS
?deleteProperty@JSObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@@Z
?deleteProperty@JSVariableObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@ABVIdentifier@2@@Z
?deletePropertyByIndex@JSObject@JSC@@SA_NPAVJSCell@2@PAVExecState@2@I@Z
?deletePropertyVirtual@JSCell@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@@Z
?deletePropertyVirtual@JSCell@JSC@@UAE_NPAVExecState@2@I@Z
?deletePropertyVirtual@JSObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@@Z
?deletePropertyVirtual@JSObject@JSC@@UAE_NPAVExecState@2@I@Z
?deletePropertyVirtual@JSVariableObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@@Z
?deleteTable@HashTable@JSC@@QBEXXZ
?despecifyDictionaryFunction@Structure@JSC@@QAEXAAVJSGlobalData@2@ABVIdentifier@2@@Z
?despecifyFunctionTransition@Structure@JSC@@SAPAV12@AAVJSGlobalData@2@PAV12@ABVIdentifier@2@@Z
......
......@@ -81,14 +81,10 @@ void DebuggerActivation::putWithAttributes(ExecState* exec, const Identifier& pr
m_activation->putWithAttributes(exec, propertyName, value, attributes);
}
bool DebuggerActivation::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool DebuggerActivation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
return static_cast<DebuggerActivation*>(cell)->m_activation->deletePropertyVirtual(exec, propertyName);
DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
return thisObject->m_activation->methodTable()->deleteProperty(thisObject->m_activation.get(), exec, propertyName);
}
void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
......
......@@ -47,7 +47,6 @@ namespace JSC {
static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
......
......@@ -3358,7 +3358,7 @@ skip_id_custom_self:
JSObject* baseObj = callFrame->r(base).jsValue().toObject(callFrame);
Identifier& ident = codeBlock->identifier(property);
bool result = baseObj->deletePropertyVirtual(callFrame, ident);
bool result = baseObj->methodTable()->deleteProperty(baseObj, callFrame, ident);
if (!result && codeBlock->isStrictMode()) {
exceptionValue = createTypeError(callFrame, "Unable to delete property.");
goto vm_throw;
......@@ -3545,12 +3545,12 @@ skip_id_custom_self:
bool result;
uint32_t i;
if (subscript.getUInt32(i))
result = baseObj->deletePropertyVirtual(callFrame, i);
result = baseObj->methodTable()->deletePropertyByIndex(baseObj, callFrame, i);
else {
CHECK_FOR_EXCEPTION();
Identifier property(callFrame, subscript.toString(callFrame));
CHECK_FOR_EXCEPTION();
result = baseObj->deletePropertyVirtual(callFrame, property);
result = baseObj->methodTable()->deleteProperty(baseObj, callFrame, property);
}
if (!result && codeBlock->isStrictMode()) {
exceptionValue = createTypeError(callFrame, "Unable to delete property.");
......
......@@ -2108,7 +2108,7 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_del_by_id)
JSObject* baseObj = stackFrame.args[0].jsValue().toObject(callFrame);
bool couldDelete = baseObj->deletePropertyVirtual(callFrame, stackFrame.args[1].identifier());
bool couldDelete = baseObj->methodTable()->deleteProperty(baseObj, callFrame, stackFrame.args[1].identifier());
JSValue result = jsBoolean(couldDelete);
if (!couldDelete && callFrame->codeBlock()->isStrictMode())
stackFrame.globalData->exception = createTypeError(stackFrame.callFrame, "Unable to delete property.");
......@@ -3723,12 +3723,12 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_del_by_val)
bool result;
uint32_t i;
if (subscript.getUInt32(i))
result = baseObj->deletePropertyVirtual(callFrame, i);
result = baseObj->methodTable()->deletePropertyByIndex(baseObj, callFrame, i);
else {
CHECK_FOR_EXCEPTION();
Identifier property(callFrame, subscript.toString(callFrame));
CHECK_FOR_EXCEPTION();
result = baseObj->deletePropertyVirtual(callFrame, property);
result = baseObj->methodTable()->deleteProperty(baseObj, callFrame, property);
}
if (!result && callFrame->codeBlock()->isStrictMode())
......
......@@ -318,11 +318,6 @@ void Arguments::put(JSCell* cell, ExecState* exec, const Identifier& propertyNam
JSObject::put(thisObject, exec, propertyName, value, slot);
}
bool Arguments::deletePropertyVirtual(ExecState* exec, unsigned i)
{
return deletePropertyByIndex(this, exec, i);
}
bool Arguments::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
......@@ -340,11 +335,6 @@ bool Arguments::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
return JSObject::deleteProperty(thisObject, exec, Identifier(exec, UString::number(i)));
}
bool Arguments::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
Arguments* thisObject = static_cast<Arguments*>(cell);
......
......@@ -143,9 +143,7 @@ namespace JSC {
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual bool deletePropertyVirtual(ExecState*, unsigned propertyName);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
void createStrictModeCallerIfNecessary(ExecState*);
void createStrictModeCalleeIfNecessary(ExecState*);
......
......@@ -388,7 +388,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPop(ExecState* exec)
result = jsUndefined();
} else {
result = thisObj->get(exec, length - 1);
thisObj->deletePropertyVirtual(exec, length - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, length - 1);
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
return JSValue::encode(result);
......@@ -444,12 +444,12 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec)
if (obj2)
thisObj->methodTable()->putByIndex(thisObj, exec, k, obj2);
else
thisObj->deletePropertyVirtual(exec, k);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k);
if (obj)
thisObj->methodTable()->putByIndex(thisObj, exec, lk1, obj);
else
thisObj->deletePropertyVirtual(exec, lk1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, lk1);
}
return JSValue::encode(thisObj);
}
......@@ -477,9 +477,9 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
if (obj)
thisObj->methodTable()->putByIndex(thisObj, exec, k - 1, obj);
else
thisObj->deletePropertyVirtual(exec, k - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k - 1);
}
thisObj->deletePropertyVirtual(exec, length - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, length - 1);
}
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length - 1));
}
......@@ -623,10 +623,10 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
if (v)
thisObj->methodTable()->putByIndex(thisObj, exec, k + additionalArgs, v);
else
thisObj->deletePropertyVirtual(exec, k + additionalArgs);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k + additionalArgs);
}
for (unsigned k = length; k > length - deleteCount + additionalArgs; --k)
thisObj->deletePropertyVirtual(exec, k - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k - 1);
}
} else {
if ((!begin) && (isJSArray(&exec->globalData(), thisObj)))
......@@ -639,7 +639,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSplice(ExecState* exec)
if (obj)
thisObj->methodTable()->putByIndex(thisObj, exec, k + additionalArgs - 1, obj);
else
thisObj->deletePropertyVirtual(exec, k + additionalArgs - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k + additionalArgs - 1);
}
}
}
......@@ -672,7 +672,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncUnShift(ExecState* exec)
if (v)
thisObj->methodTable()->putByIndex(thisObj, exec, k + nrArgs - 1, v);
else
thisObj->deletePropertyVirtual(exec, k + nrArgs - 1);
thisObj->methodTable()->deletePropertyByIndex(thisObj, exec, k + nrArgs - 1);
}
}
}
......
......@@ -200,11 +200,6 @@ void JSActivation::putWithAttributes(ExecState* exec, const Identifier& property
JSObject::putWithAttributes(exec, propertyName, value, attributes, true, slot);
}
bool JSActivation::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool JSActivation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
if (propertyName == exec->propertyNames().arguments)
......
......@@ -68,7 +68,6 @@ namespace JSC {
static void put(JSCell*, ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual JSObject* toThisObject(ExecState*) const;
......
......@@ -497,18 +497,13 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
Heap::heap(this)->reportExtraMemoryCost(storageSize(newVectorLength) - storageSize(vectorLength));
}
bool JSArray::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
JSArray* thisObject = static_cast<JSArray*>(cell);
bool isArrayIndex;
unsigned i = propertyName.toArrayIndex(isArrayIndex);
if (isArrayIndex)
return thisObject->deletePropertyVirtual(exec, i);
return thisObject->methodTable()->deletePropertyByIndex(thisObject, exec, i);
if (propertyName == exec->propertyNames().length)
return false;
......@@ -516,11 +511,6 @@ bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& pr
return JSObject::deleteProperty(thisObject, exec, propertyName);
}
bool JSArray::deletePropertyVirtual(ExecState* exec, unsigned i)
{
return deletePropertyByIndex(this, exec, i);
}
bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
{
JSArray* thisObject = static_cast<JSArray*>(cell);
......@@ -554,7 +544,7 @@ bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
thisObject->checkConsistency();
if (i > MAX_ARRAY_INDEX)
return thisObject->deletePropertyVirtual(exec, Identifier::from(exec, i));
return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, i));
return false;
}
......
......@@ -172,9 +172,7 @@ namespace JSC {
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSObject::StructureFlags;
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual bool deletePropertyVirtual(ExecState*, unsigned propertyName);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
......
......@@ -110,24 +110,16 @@ void JSCell::putByIndex(JSCell* cell, ExecState* exec, unsigned identifier, JSVa
thisObject->methodTable()->putByIndex(thisObject, exec, identifier, value);
}
bool JSCell::deletePropertyVirtual(ExecState* exec, const Identifier& identifier)
{
return deleteProperty(this, exec, identifier);
}
bool JSCell::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& identifier)
{
return cell->toObject(exec, exec->lexicalGlobalObject())->deletePropertyVirtual(exec, identifier);
}
bool JSCell::deletePropertyVirtual(ExecState* exec, unsigned identifier)
{
return deletePropertyByIndex(this, exec, identifier);
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
return thisObject->methodTable()->deleteProperty(thisObject, exec, identifier);
}
bool JSCell::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned identifier)
{
return cell->toObject(exec, exec->lexicalGlobalObject())->deletePropertyVirtual(exec, identifier);
JSObject* thisObject = cell->toObject(exec, exec->lexicalGlobalObject());
return thisObject->methodTable()->deletePropertyByIndex(thisObject, exec, identifier);
}
JSObject* JSCell::toThisObject(ExecState* exec) const
......
......@@ -92,9 +92,7 @@ namespace JSC {
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual bool deletePropertyVirtual(ExecState*, unsigned propertyName);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
virtual JSObject* toThisObject(ExecState*) const;
......
......@@ -342,11 +342,6 @@ void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
Base::put(thisObject, exec, propertyName, value, slot);
}
bool JSFunction::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
JSFunction* thisObject = static_cast<JSFunction*>(cell);
......
......@@ -136,7 +136,6 @@ namespace JSC {
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
static void visitChildren(JSCell*, SlotVisitor&);
......
......@@ -84,22 +84,12 @@ void JSNotAnObject::putByIndex(JSCell*, ExecState* exec, unsigned, JSValue)
ASSERT_UNUSED(exec, exec->hadException());
}
bool JSNotAnObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
bool JSNotAnObject::deleteProperty(JSCell*, ExecState* exec, const Identifier&)
{
ASSERT_UNUSED(exec, exec->hadException());
return false;
}
bool JSNotAnObject::deletePropertyVirtual(ExecState* exec, unsigned propertyName)
{
return deletePropertyByIndex(this, exec, propertyName);
}
bool JSNotAnObject::deletePropertyByIndex(JSCell*, ExecState* exec, unsigned)
{
ASSERT_UNUSED(exec, exec->hadException());
......
......@@ -77,9 +77,7 @@ namespace JSC {
static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
virtual bool deletePropertyVirtual(ExecState*, unsigned propertyName);
static bool deletePropertyByIndex(JSCell*, ExecState*, unsigned propertyName);
virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
......
......@@ -710,7 +710,7 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered)
JSArray* array = arrayStack.peek();
JSValue filteredValue = callReviver(array, jsString(m_exec, UString::number(indexStack.last())), outValue);
if (filteredValue.isUndefined())
array->deletePropertyVirtual(m_exec, indexStack.last());
array->methodTable()->deletePropertyByIndex(array, m_exec, indexStack.last());
else {
if (isJSArray(&m_exec->globalData(), array) && array->canSetIndex(indexStack.last()))
array->setIndex(m_exec->globalData(), indexStack.last(), filteredValue);
......@@ -777,7 +777,7 @@ NEVER_INLINE JSValue Walker::walk(JSValue unfiltered)
PutPropertySlot slot;
JSValue filteredValue = callReviver(object, jsString(m_exec, prop.ustring()), outValue);
if (filteredValue.isUndefined())
object->deletePropertyVirtual(m_exec, prop);
object->methodTable()->deleteProperty(object, m_exec, prop);
else
object->methodTable()->put(object, m_exec, prop, filteredValue, slot);
if (m_exec->hadException())
......
......@@ -249,11 +249,6 @@ bool JSObject::hasProperty(ExecState* exec, unsigned propertyName) const
return const_cast<JSObject*>(this)->getPropertySlot(exec, propertyName, slot);
}
bool JSObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
{
return deleteProperty(this, exec, propertyName);
}
// ECMA 8.6.2.5
bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
{
......@@ -286,14 +281,10 @@ bool JSObject::hasOwnProperty(ExecState* exec, const Identifier& propertyName) c
return const_cast<JSObject*>(this)->getOwnPropertySlotVirtual(exec, propertyName, slot);
}
bool JSObject::deletePropertyVirtual(ExecState* exec, unsigned propertyName)
{
return deletePropertyByIndex(this, exec, propertyName);
}
bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
{
return static_cast<JSObject*>(cell)->deletePropertyVirtual(exec, Identifier::from(exec, propertyName));
JSObject* thisObject = static_cast<JSObject*>(cell);
return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
}
static ALWAYS_INLINE JSValue callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)
......@@ -789,7 +780,7 @@ bool JSObject::defineOwnProperty(ExecState* exec, const Identifier& propertyName
// A generic descriptor is simply changing the attributes of an existing property
if (descriptor.isGenericDescriptor()) {
if (!current.attributesEqual(descriptor)) {
deletePropertyVirtual(exec, propertyName);
methodTable()->deleteProperty(this, exec, propertyName);
putDescriptor(exec, this, propertyName, descriptor, current.attributesWithOverride(descriptor), current);
}
return true;
......@@ -802,7 +793,7 @@ bool JSObject::defineOwnProperty(ExecState* exec, const Identifier& propertyName
throwError(exec, createTypeError(exec, "Attempting to change access mechanism for an unconfigurable property."));
return false;
}
deletePropertyVirtual(exec, propertyName);
methodTable()->deleteProperty(this, exec, propertyName);
return putDescriptor(exec, this, propertyName, descriptor, current.attributesWithOverride(descriptor), current);
}
......@@ -830,7 +821,7 @@ bool JSObject::defineOwnProperty(ExecState* exec, const Identifier& propertyName
return false;
return true;
}
deletePropertyVirtual(exec, propertyName);
methodTable()->deleteProperty(this, exec, propertyName);
return putDescriptor(exec, this, propertyName, descriptor, current.attributesWithOverride(descriptor), current);
}
......@@ -859,7 +850,7 @@ bool JSObject::defineOwnProperty(ExecState* exec, const Identifier& propertyName
getterSetter->setGetter(exec->globalData(), asObject(descriptor.getter()));
return true;
}
deletePropertyVirtual(exec, propertyName);
methodTable()->deleteProperty(this, exec, propertyName);
unsigned attrs = current.attributesWithOverride(descriptor);
if (descriptor.setter())
attrs |= Setter;
......
......@@ -121,9 +121,7 @@ namespace JSC {
bool hasProperty(ExecState*, unsigned propertyName) const;