Remove deletePropertyVirtual
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2011 01:49:00 +0000 (01:49 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Oct 2011 01:49:00 +0000 (01:49 +0000)
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: https://svn.webkit.org/repository/webkit/trunk@98422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

59 files changed:
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
Source/JavaScriptCore/API/JSObjectRef.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/debugger/DebuggerActivation.h
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/Arguments.h
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/JSActivation.cpp
Source/JavaScriptCore/runtime/JSActivation.h
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSCell.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSNotAnObject.cpp
Source/JavaScriptCore/runtime/JSNotAnObject.h
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSVariableObject.cpp
Source/JavaScriptCore/runtime/JSVariableObject.h
Source/JavaScriptCore/runtime/RegExpMatchesArray.h
Source/JavaScriptCore/runtime/StrictEvalActivation.cpp
Source/JavaScriptCore/runtime/StrictEvalActivation.h
Source/JavaScriptCore/runtime/StringObject.cpp
Source/JavaScriptCore/runtime/StringObject.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h
Source/WebCore/bindings/js/JSHistoryCustom.cpp
Source/WebCore/bindings/js/JSLocationCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/ScriptObject.cpp
Source/WebCore/bindings/objc/WebScriptObject.mm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bridge/NP_jsobject.cpp
Source/WebCore/bridge/jni/jni_jsobject.mm
Source/WebCore/bridge/objc/objc_runtime.h
Source/WebCore/bridge/objc/objc_runtime.mm
Source/WebCore/bridge/runtime_array.cpp
Source/WebCore/bridge/runtime_array.h
Source/WebCore/bridge/runtime_object.cpp
Source/WebCore/bridge/runtime_object.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp

index 8b7b67f..151cb38 100644 (file)
@@ -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);
index 350b2db..5230a70 100644 (file)
@@ -267,12 +267,6 @@ void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifi
 }
 
 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)
 {
     JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
@@ -317,15 +311,10 @@ bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, con
 }
 
 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>
index 9d66d58..740b1a3 100644 (file)
@@ -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());
index f11ae35..ca7b9e0 100644 (file)
@@ -1,5 +1,66 @@
 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
         https://bugs.webkit.org/show_bug.cgi?id=70740
 
index fad4654..a1c0ee3 100644 (file)
@@ -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
index ca210d2..9a34c96 100644 (file)
@@ -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
index 88b9b48..fa0569d 100644 (file)
@@ -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)
index edaeba0..9bad305 100644 (file)
@@ -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&);
index aff5090..0c51270 100644 (file)
@@ -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.");
index 63cf9a1..933516e 100644 (file)
@@ -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())
index c395fb4..a01d77a 100644 (file)
@@ -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);
index 3e71a37..69e0dd3 100644 (file)
@@ -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*);
index e0a57be..15495cf 100644 (file)
@@ -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);
             }
         }
     }
index 06f0b4c..b43218a 100644 (file)
@@ -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)
index a4e26da..e742216 100644 (file)
@@ -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;
index 89e0aac..d5a643f 100644 (file)
@@ -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;
 }
index 5b86ad2..b0c85d3 100644 (file)
@@ -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);
 
index 30e2735..3c4a77b 100644 (file)
@@ -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
index 69ce5e5..d087e9f 100644 (file)
@@ -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;
index c99da4e..f0ec117 100644 (file)
@@ -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);
index bd7c3b1..6b43e40 100644 (file)
@@ -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&);
index ac8f979..90221e7 100644 (file)
@@ -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());
index df32959..6cddded 100644 (file)
@@ -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);
index 75deb2d..7e2de42 100644 (file)
@@ -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())
index 7a0340a..fac1a3a 100644 (file)
@@ -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;
index 04b3a9a..3f740d7 100644 (file)
@@ -121,9 +121,7 @@ namespace JSC {
         bool hasProperty(ExecState*, unsigned propertyName) const;
         bool hasOwnProperty(ExecState*, const Identifier& propertyName) const;
 
-        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 JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
index 1845909..09c87a1 100644 (file)
 
 namespace JSC {
 
-bool JSVariableObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-{
-    return deleteProperty(this, exec, propertyName);
-}
-
 bool JSVariableObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
     JSVariableObject* thisObject = static_cast<JSVariableObject*>(cell);
index 9de7093..0f86e35 100644 (file)
@@ -50,7 +50,6 @@ namespace JSC {
 
         virtual void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes) = 0;
 
-        virtual bool deletePropertyVirtual(ExecState*, const Identifier&);
         static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
         
index 76a22c4..141d188 100644 (file)
@@ -92,11 +92,6 @@ namespace JSC {
             JSArray::putByIndex(thisObject, exec, propertyName, v);
         }
 
-        virtual bool deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-        {
-            return deleteProperty(this, exec, propertyName);
-        }
-
         static bool deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
         {
             RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
@@ -105,11 +100,6 @@ namespace JSC {
             return JSArray::deleteProperty(thisObject, exec, propertyName);
         }
 
-        virtual bool deletePropertyVirtual(ExecState* exec, unsigned propertyName)
-        {
-            return deletePropertyByIndex(this, exec, propertyName);
-        }
-
         static bool deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
         {
             RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
index 28fc365..ce9de5a 100644 (file)
@@ -35,11 +35,6 @@ StrictEvalActivation::StrictEvalActivation(ExecState* exec)
 {
 }
 
-bool StrictEvalActivation::deletePropertyVirtual(ExecState* exec, const Identifier& identifier)
-{
-    return deleteProperty(this, exec, identifier);
-}
-
 bool StrictEvalActivation::deleteProperty(JSCell*, ExecState*, const Identifier&)
 {
     return false;
index c9a349c..0974468 100644 (file)
@@ -41,7 +41,6 @@ public:
         return activation;
     }
 
-    virtual bool deletePropertyVirtual(ExecState*, const Identifier&);
     static bool deleteProperty(JSCell*, ExecState*, const Identifier&);
     virtual JSObject* toThisObject(ExecState*) const;
 
index 059012f..6d39bc1 100644 (file)
@@ -81,11 +81,6 @@ void StringObject::put(JSCell* cell, ExecState* exec, const Identifier& property
     JSObject::put(cell, exec, propertyName, value, slot);
 }
 
-bool StringObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-{
-    return deleteProperty(this, exec, propertyName);
-}
-
 bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
     StringObject* thisObject = static_cast<StringObject*>(cell);
index d134c3e..4daaf0b 100644 (file)
@@ -53,7 +53,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);
         virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties);
 
index 85974ee..b26bb11 100644 (file)
@@ -1,3 +1,47 @@
+2011-10-25  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Remove deletePropertyVirtual
+        https://bugs.webkit.org/show_bug.cgi?id=70738
+
+        Reviewed by Geoffrey Garen.
+
+        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:
+
 2011-10-25  Chris Fleizach  <cfleizach@apple.com>
 
         AX: WebKit does not expose HTML label for slider elements
index 075dc96..267ffc7 100644 (file)
@@ -1700,7 +1700,6 @@ __ZN3JSC8Bindings13RuntimeObject14finishCreationEPNS_14JSGlobalObjectE
 __ZN3JSC8Bindings13RuntimeObject16getConstructDataEPNS_6JSCellERNS_13ConstructDataE
 __ZN3JSC8Bindings13RuntimeObject18getOwnPropertySlotEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC8Bindings13RuntimeObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
-__ZN3JSC8Bindings13RuntimeObject21deletePropertyVirtualEPNS_9ExecStateERKNS_10IdentifierE
 __ZN3JSC8Bindings13RuntimeObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8Bindings13RuntimeObject25getOwnPropertySlotVirtualEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC8Bindings13RuntimeObject3putEPNS_6JSCellEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
index dc25169..aa29c39 100644 (file)
@@ -57,13 +57,14 @@ void JSDOMStringMap::getOwnPropertyNames(ExecState* exec, PropertyNameArray& pro
     Base::getOwnPropertyNames(exec, propertyNames, mode);
 }
 
-bool JSDOMStringMap::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
+    JSDOMStringMap* thisObject = static_cast<JSDOMStringMap*>(cell);
     AtomicString stringName = identifierToAtomicString(propertyName);
-    if (!m_impl->contains(stringName))
+    if (!thisObject->m_impl->contains(stringName))
         return false;
     ExceptionCode ec = 0;
-    m_impl->deleteItem(stringName, ec);
+    thisObject->m_impl->deleteItem(stringName, ec);
     setDOMException(exec, ec);
     return !ec;
 }
index d77935f..f1e8231 100644 (file)
@@ -364,12 +364,13 @@ void JSDOMWindow::put(JSCell* cell, ExecState* exec, const Identifier& propertyN
         Base::put(thisObject, exec, propertyName, value, slot);
 }
 
-bool JSDOMWindow::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSDOMWindow::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
+    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
     // Only allow deleting properties by frames in the same origin.
-    if (!allowsAccessFrom(exec))
+    if (!thisObject->allowsAccessFrom(exec))
         return false;
-    return Base::deleteProperty(this, exec, propertyName);
+    return Base::deleteProperty(thisObject, exec, propertyName);
 }
 
 void JSDOMWindow::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
index 69d346e..2656188 100644 (file)
@@ -131,9 +131,10 @@ bool JSDOMWindowShell::defineOwnProperty(JSC::ExecState* exec, const JSC::Identi
     return m_window->defineOwnProperty(exec, propertyName, descriptor, shouldThrow);
 }
 
-bool JSDOMWindowShell::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSDOMWindowShell::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    return m_window->deletePropertyVirtual(exec, propertyName);
+    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(cell);
+    return thisObject->m_window->methodTable()->deleteProperty(thisObject->m_window.get(), exec, propertyName);
 }
 
 void JSDOMWindowShell::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
index 59ff793..7a39245 100644 (file)
@@ -85,7 +85,7 @@ namespace WebCore {
         virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
         static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
         virtual void putWithAttributes(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes);
-        virtual bool deletePropertyVirtual(JSC::ExecState*, const JSC::Identifier& propertyName);
+        static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName);
         virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
         virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
         virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes);
index be26b7b..d7fdc00 100644 (file)
@@ -146,12 +146,13 @@ bool JSHistory::putDelegate(ExecState* exec, const Identifier&, JSValue, PutProp
     return false;
 }
 
-bool JSHistory::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSHistory::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
+    JSHistory* thisObject = static_cast<JSHistory*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!allowsAccessFromFrame(exec, impl()->frame()))
+    if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return false;
-    return Base::deleteProperty(this, exec, propertyName);
+    return Base::deleteProperty(thisObject, exec, propertyName);
 }
 
 void JSHistory::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
index 88e5ae9..7750953 100644 (file)
@@ -152,12 +152,13 @@ bool JSLocation::putDelegate(ExecState* exec, const Identifier& propertyName, JS
     return false;
 }
 
-bool JSLocation::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSLocation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
+    JSLocation* thisObject = static_cast<JSLocation*>(cell);
     // Only allow deleting by frames in the same origin.
-    if (!allowsAccessFromFrame(exec, impl()->frame()))
+    if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return false;
-    return Base::deleteProperty(this, exec, propertyName);
+    return Base::deleteProperty(thisObject, exec, propertyName);
 }
 
 void JSLocation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
index ee266f9..a26f4f2 100644 (file)
@@ -45,20 +45,21 @@ JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifie
     return jsStringOrNull(exec, thisObj->impl()->getItem(identifierToString(propertyName)));
 }
 
-bool JSStorage::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
+bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
+    JSStorage* thisObject = static_cast<JSStorage*>(cell);
     // Only perform the custom delete if the object doesn't have a native property by this name.
     // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
     // the native property slots manually.
     PropertySlot slot;
-    if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), this, propertyName, slot))
+    if (getStaticValueSlot<JSStorage, Base>(exec, s_info.propHashTable(exec), thisObject, propertyName, slot))
         return false;
         
-    JSValue prototype = this->prototype();
+    JSValue prototype = thisObject->prototype();
     if (prototype.isObject() && asObject(prototype)->hasProperty(exec, propertyName))
         return false;
 
-    m_impl->removeItem(identifierToString(propertyName));
+    thisObject->m_impl->removeItem(identifierToString(propertyName));
     return true;
 }
 
index 6257f65..6760e47 100644 (file)
@@ -101,7 +101,7 @@ bool ScriptGlobalObject::get(ScriptState* scriptState, const char* name, ScriptO
 bool ScriptGlobalObject::remove(ScriptState* scriptState, const char* name)
 {
     JSLock lock(SilenceAssertionsOnly);
-    scriptState->lexicalGlobalObject()->deletePropertyVirtual(scriptState, Identifier(scriptState, name));
+    scriptState->lexicalGlobalObject()->methodTable()->deleteProperty(scriptState->lexicalGlobalObject(), scriptState, Identifier(scriptState, name));
     return handleException(scriptState);
 }
 
index a4d7c4a..9d80f19 100644 (file)
@@ -403,7 +403,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
     ASSERT(!exec->hadException());
 
     JSLock lock(SilenceAssertionsOnly);
-    [self _imp]->deletePropertyVirtual(exec, Identifier(exec, stringToUString(String(key))));
+    [self _imp]->methodTable()->deleteProperty([self _imp], exec, Identifier(exec, stringToUString(String(key))));
 
     if (exec->hadException()) {
         addExceptionToConsole(exec);
index afed6f3..345b0a7 100644 (file)
@@ -820,7 +820,7 @@ sub GenerateHeader
     push(@headerContent, "    static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n") if $dataNode->extendedAttributes->{"CustomCall"};
 
     # Custom deleteProperty function
-    push(@headerContent, "    virtual bool deletePropertyVirtual(JSC::ExecState*, const JSC::Identifier&);\n") if $dataNode->extendedAttributes->{"CustomDeleteProperty"};
+    push(@headerContent, "    static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&);\n") if $dataNode->extendedAttributes->{"CustomDeleteProperty"};
 
     # Custom getPropertyNames function exists on DOMWindow
     if ($interfaceName eq "DOMWindow") {
index 99dad51..5922133 100644 (file)
@@ -375,9 +375,9 @@ bool _NPN_RemoveProperty(NPP, NPObject* o, NPIdentifier propertyName)
 
         JSLock lock(SilenceAssertionsOnly);
         if (i->isString())
-            obj->imp->deletePropertyVirtual(exec, identifierFromNPIdentifier(exec, i->string()));
+            obj->imp->methodTable()->deleteProperty(obj->imp, exec, identifierFromNPIdentifier(exec, i->string()));
         else
-            obj->imp->deletePropertyVirtual(exec, i->number());
+            obj->imp->methodTable()->deletePropertyByIndex(obj->imp, exec, i->number());
 
         exec->clearException();
         return true;
index e87c84e..fdce0cb 100644 (file)
@@ -362,7 +362,7 @@ void JavaJSObject::removeMember(jstring memberName) const
 
     ExecState* exec = rootObject->globalObject()->globalExec();
     JSLock lock(SilenceAssertionsOnly);
-    _imp->deletePropertyVirtual(exec, Identifier(exec, JavaString(memberName).impl()));
+    _imp->methodTable()->deleteProperty(_imp, exec, Identifier(exec, JavaString(memberName).impl()));
 }
 
 
index fabcb0b..f95518f 100644 (file)
@@ -128,7 +128,6 @@ private:
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
     static void put(JSCell*, ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
     static CallType getCallData(JSCell*, CallData&);
-    virtual bool deletePropertyVirtual(ExecState*, const Identifier& propertyName);
     static bool deleteProperty(JSCell*, ExecState*, const Identifier& propertyName);
     virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
 
index e590822..6dfb5f0 100644 (file)
@@ -270,11 +270,6 @@ CallType ObjcFallbackObjectImp::getCallData(JSCell* cell, CallData& callData)
     return CallTypeHost;
 }
 
-bool ObjcFallbackObjectImp::deletePropertyVirtual(ExecState* exec, const Identifier& identifier)
-{
-    return deleteProperty(this, exec, identifier);
-}
-
 bool ObjcFallbackObjectImp::deleteProperty(JSCell*, ExecState*, const Identifier&)
 {
     return false;
index 0926e9f..0237781 100644 (file)
@@ -171,21 +171,11 @@ void RuntimeArray::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSV
     thisObject->getConcreteArray()->setValueAt(exec, index, value);
 }
 
-bool RuntimeArray::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-{
-    return deleteProperty(this, exec, propertyName);
-}
-
 bool RuntimeArray::deleteProperty(JSCell*, ExecState*, const Identifier&)
 {
     return false;
 }
 
-bool RuntimeArray::deletePropertyVirtual(ExecState* exec, unsigned propertyName)
-{
-    return deletePropertyByIndex(this, exec, propertyName);
-}
-
 bool RuntimeArray::deletePropertyByIndex(JSCell*, ExecState*, unsigned)
 {
     return false;
index 7dfd84f..946adb2 100644 (file)
@@ -58,9 +58,7 @@ public:
     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);
     
     unsigned getLength() const { return getConcreteArray()->getLength(); }
index b345004..e0ee8ab 100644 (file)
@@ -237,11 +237,6 @@ void RuntimeObject::put(JSCell* cell, ExecState* exec, const Identifier& propert
     instance->end();
 }
 
-bool RuntimeObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-{
-    return deleteProperty(this, exec, propertyName);
-}
-
 bool RuntimeObject::deleteProperty(JSCell*, ExecState*, const Identifier&)
 {
     // Can never remove a property of a RuntimeObject.
index 9a09b77..be292d7 100644 (file)
@@ -49,7 +49,6 @@ public:
     static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
     virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier& propertyName, PropertyDescriptor&);
     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 JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
     static CallType getCallData(JSCell*, CallData&);
index 2d3c92b..5263fd0 100644 (file)
@@ -1,5 +1,19 @@
 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.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::removeProperty):
+
+2011-10-25  Mark Hahnenberg  <mhahnenberg@apple.com>
+
         Remove putVirtual
         https://bugs.webkit.org/show_bug.cgi?id=70740
 
index a8997ab..e81078e 100644 (file)
@@ -1113,7 +1113,7 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, const Identi
     }
     
     JSLock lock(SilenceAssertionsOnly);
-    object->deletePropertyVirtual(exec, propertyName);
+    object->methodTable()->deleteProperty(object, exec, propertyName);
     exec->clearException();    
     return true;
 }
@@ -1140,7 +1140,7 @@ bool NetscapePluginInstanceProxy::removeProperty(uint32_t objectID, unsigned pro
     }
     
     JSLock lock(SilenceAssertionsOnly);
-    object->deletePropertyVirtual(exec, propertyName);
+    object->methodTable()->deletePropertyByIndex(object, exec, propertyName);
     exec->clearException();    
     return true;
 }
index 737c698..89b61d8 100644 (file)
@@ -1,3 +1,19 @@
+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.
+
+        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
+        * WebProcess/Plugins/Netscape/JSNPObject.h:
+        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
+        (WebKit::NPJSObject::removeProperty):
+
 2011-10-25  Brent Fulgham  <bfulgham@webkit.org>
 
         [WinCairo] Unreviewed build fix after r97587.
index 81803c5..bc1a783 100644 (file)
@@ -346,21 +346,11 @@ void JSNPObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
     releaseNPVariantValue(&variant);
 }
 
-bool JSNPObject::deletePropertyVirtual(ExecState* exec, const Identifier& propertyName)
-{
-    return deleteProperty(this, exec, propertyName);
-}
-
 bool JSNPObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
     return static_cast<JSNPObject*>(cell)->deleteProperty(exec, npIdentifierFromIdentifier(propertyName));
 }
 
-bool JSNPObject::deletePropertyVirtual(ExecState* exec, unsigned propertyName)
-{
-    return deletePropertyByIndex(this, exec, propertyName);
-}
-
 bool JSNPObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
 {
     return static_cast<JSNPObject*>(cell)->deleteProperty(exec, static_cast<NPIdentifier>(IdentifierRep::get(propertyName)));
index 4659b63..444e2fc 100644 (file)
@@ -87,9 +87,7 @@ private:
     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
     static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
 
-    virtual bool deletePropertyVirtual(JSC::ExecState*, const JSC::Identifier& propertyName);
     static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName);
-    virtual bool deletePropertyVirtual(JSC::ExecState*, unsigned propertyName);
     static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName);
 
     bool deleteProperty(JSC::ExecState*, NPIdentifier propertyName);
index 5fd6320..c6936dc 100644 (file)
@@ -213,14 +213,14 @@ bool NPJSObject::removeProperty(NPIdentifier propertyName)
             return false;
         }
         
-        m_jsObject->deletePropertyVirtual(exec, identifier);
+        m_jsObject->methodTable()->deleteProperty(m_jsObject.get(), exec, identifier);
     } else {
         if (!m_jsObject->hasProperty(exec, identifierRep->number())) {
             exec->clearException();
             return false;
         }
 
-        m_jsObject->deletePropertyVirtual(exec, identifierRep->number());
+        m_jsObject->methodTable()->deletePropertyByIndex(m_jsObject.get(), exec, identifierRep->number());
     }
 
     exec->clearException();