Title: [154336] trunk/Source
Revision
154336
Author
[email protected]
Date
2013-08-20 10:09:03 -0700 (Tue, 20 Aug 2013)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=120054
Remove some dead code following getOwnPropertyDescriptor cleanup

Reviewed by Oliver Hunt.

../_javascript_Core: 

* runtime/Lookup.h:
(JSC::getStaticFunctionSlot):
    - remove getStaticPropertyDescriptor, getStaticFunctionDescriptor, getStaticValueDescriptor.

../WebCore: 

* bindings/js/JSPluginElementFunctions.cpp:
* bindings/js/JSPluginElementFunctions.h:
    - remove runtimeObjectCustomGetOwnPropertyDescriptor, pluginElementCustomGetOwnPropertyDescriptor

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (154335 => 154336)


--- trunk/Source/_javascript_Core/ChangeLog	2013-08-20 17:08:07 UTC (rev 154335)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-08-20 17:09:03 UTC (rev 154336)
@@ -1,5 +1,16 @@
 2013-08-20  Gavin Barraclough  <[email protected]>
 
+        https://bugs.webkit.org/show_bug.cgi?id=120054
+        Remove some dead code following getOwnPropertyDescriptor cleanup
+
+        Reviewed by Oliver Hunt.
+
+        * runtime/Lookup.h:
+        (JSC::getStaticFunctionSlot):
+            - remove getStaticPropertyDescriptor, getStaticFunctionDescriptor, getStaticValueDescriptor.
+
+2013-08-20  Gavin Barraclough  <[email protected]>
+
         https://bugs.webkit.org/show_bug.cgi?id=120052
         Remove custom getOwnPropertyDescriptor for JSProxy
 

Modified: trunk/Source/_javascript_Core/runtime/Lookup.h (154335 => 154336)


--- trunk/Source/_javascript_Core/runtime/Lookup.h	2013-08-20 17:08:07 UTC (rev 154335)
+++ trunk/Source/_javascript_Core/runtime/Lookup.h	2013-08-20 17:09:03 UTC (rev 154336)
@@ -255,27 +255,6 @@
         return true;
     }
 
-    template <class ThisImp, class ParentImp>
-    inline bool getStaticPropertyDescriptor(ExecState* exec, const HashTable* table, ThisImp* thisObj, PropertyName propertyName, PropertyDescriptor& descriptor)
-    {
-        const HashEntry* entry = table->entry(exec, propertyName);
-        
-        if (!entry) // not found, forward to parent
-            return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor);
- 
-        PropertySlot slot(thisObj);
-        if (entry->attributes() & Function) {
-            bool present = setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
-            if (present)
-                descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
-            return present;
-        }
-
-        slot.setCustom(thisObj, entry->attributes(), entry->propertyGetter());
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
-        return true;
-    }
-
     /**
      * Simplified version of getStaticPropertySlot in case there are only functions.
      * Using this instead of getStaticPropertySlot allows 'this' to avoid implementing
@@ -293,28 +272,6 @@
 
         return setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
     }
-    
-    /**
-     * Simplified version of getStaticPropertyDescriptor in case there are only functions.
-     * Using this instead of getStaticPropertyDescriptor allows 'this' to avoid implementing
-     * a dummy getValueProperty.
-     */
-    template <class ParentImp>
-    inline bool getStaticFunctionDescriptor(ExecState* exec, const HashTable* table, JSObject* thisObj, PropertyName propertyName, PropertyDescriptor& descriptor)
-    {
-        if (ParentImp::getOwnPropertyDescriptor(static_cast<ParentImp*>(thisObj), exec, propertyName, descriptor))
-            return true;
-        
-        const HashEntry* entry = table->entry(exec, propertyName);
-        if (!entry)
-            return false;
-        
-        PropertySlot slot(thisObj);
-        bool present = setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
-        if (present)
-            descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
-        return present;
-    }
 
     /**
      * Simplified version of getStaticPropertySlot in case there are no functions, only "values".
@@ -334,25 +291,6 @@
         return true;
     }
 
-    /**
-     * Simplified version of getStaticPropertyDescriptor in case there are no functions, only "values".
-     * Using this instead of getStaticPropertyDescriptor removes the need for a FuncImp class.
-     */
-    template <class ThisImp, class ParentImp>
-    inline bool getStaticValueDescriptor(ExecState* exec, const HashTable* table, ThisImp* thisObj, PropertyName propertyName, PropertyDescriptor& descriptor)
-    {
-        const HashEntry* entry = table->entry(exec, propertyName);
-        
-        if (!entry) // not found, forward to parent
-            return ParentImp::getOwnPropertyDescriptor(thisObj, exec, propertyName, descriptor);
-        
-        ASSERT(!(entry->attributes() & Function));
-        PropertySlot slot(thisObj);
-        slot.setCustom(thisObj, entry->attributes(), entry->propertyGetter());
-        descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
-        return true;
-    }
-
     template <class ThisImp>
     inline void putEntry(ExecState* exec, const HashEntry* entry, PropertyName propertyName, JSValue value, ThisImp* thisObj, bool shouldThrow = false)
     {

Modified: trunk/Source/WebCore/ChangeLog (154335 => 154336)


--- trunk/Source/WebCore/ChangeLog	2013-08-20 17:08:07 UTC (rev 154335)
+++ trunk/Source/WebCore/ChangeLog	2013-08-20 17:09:03 UTC (rev 154336)
@@ -1,3 +1,14 @@
+2013-08-20  Gavin Barraclough  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=120054
+        Remove some dead code following getOwnPropertyDescriptor cleanup
+
+        Reviewed by Oliver Hunt.
+
+        * bindings/js/JSPluginElementFunctions.cpp:
+        * bindings/js/JSPluginElementFunctions.h:
+            - remove runtimeObjectCustomGetOwnPropertyDescriptor, pluginElementCustomGetOwnPropertyDescriptor
+
 2013-08-20  Alex Christensen  <[email protected]>
 
         Use PlatformArchitecture to distinguish between 32-bit and 64-bit builds on Windows.

Modified: trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp (154335 => 154336)


--- trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp	2013-08-20 17:08:07 UTC (rev 154335)
+++ trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp	2013-08-20 17:09:03 UTC (rev 154336)
@@ -122,22 +122,6 @@
     return true;
 }
 
-bool runtimeObjectCustomGetOwnPropertyDescriptor(ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor, JSHTMLElement* element)
-{
-    JSObject* scriptObject = pluginScriptObject(exec, element);
-    if (!scriptObject)
-        return false;
-    if (!scriptObject->hasProperty(exec, propertyName))
-        return false;
-    PropertySlot slot(element);
-    slot.setCustom(element, DontDelete | DontEnum, runtimeObjectPropertyGetter);
-    // While we don't know what the plugin allows, we do know that we prevent
-    // enumeration or deletion of properties, so we mark plugin properties
-    // as DontEnum | DontDelete
-    descriptor.setDescriptor(slot.getValue(exec, propertyName), DontEnum | DontDelete);
-    return true;
-}
-
 bool runtimeObjectCustomPut(ExecState* exec, PropertyName propertyName, JSValue value, JSHTMLElement* element, PutPropertySlot& slot)
 {
     JSObject* scriptObject = pluginScriptObject(exec, element);

Modified: trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h (154335 => 154336)


--- trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h	2013-08-20 17:08:07 UTC (rev 154335)
+++ trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.h	2013-08-20 17:09:03 UTC (rev 154336)
@@ -40,7 +40,6 @@
 
     JSC::JSValue runtimeObjectPropertyGetter(JSC::ExecState*, JSC::JSValue, JSC::PropertyName);
     bool runtimeObjectCustomGetOwnPropertySlot(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&, JSHTMLElement*);
-    bool runtimeObjectCustomGetOwnPropertyDescriptor(JSC::ExecState*, JSC::PropertyName, JSC::PropertyDescriptor&, JSHTMLElement*);
     bool runtimeObjectCustomPut(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSHTMLElement*, JSC::PutPropertySlot&);
     JSC::CallType runtimeObjectGetCallData(JSHTMLElement*, JSC::CallData&);
 
@@ -58,20 +57,6 @@
         return runtimeObjectCustomGetOwnPropertySlot(exec, propertyName, slot, element);
     }
 
-    template <class Type, class Base> bool pluginElementCustomGetOwnPropertyDescriptor(JSC::ExecState* exec, JSC::PropertyName propertyName, JSC::PropertyDescriptor& descriptor, Type* element)
-    {
-        if (!element->globalObject()->world()->isNormal()) {
-            if (JSC::getStaticValueDescriptor<Type, Base>(exec, Type::info()->staticPropHashTable, element, propertyName, descriptor))
-                return true;
-
-            JSC::JSValue proto = element->prototype();
-            if (proto.isObject() && JSC::jsCast<JSC::JSObject*>(asObject(proto))->hasProperty(exec, propertyName))
-                return false;
-        }
-
-        return runtimeObjectCustomGetOwnPropertyDescriptor(exec, propertyName, descriptor, element);
-    }
-
 } // namespace WebCore
 
 #endif // JSPluginElementFunctions_h
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to