Ignore:
Timestamp:
Aug 18, 2013, 12:29:15 PM (12 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=119972
Add attributes field to PropertySlot

Reviewed by Geoff Garen.

For all JSC types, this makes getOwnPropertyDescriptor redundant.
There will be a bit more hacking required in WebCore to remove GOPD whilst maintaining current behaviour.
(Current behaviour is in many ways broken, particularly in that GOPD & GOPS are inconsistent, but we should fix incrementally).

Source/JavaScriptCore:

No performance impact.

  • runtime/PropertySlot.h:

(JSC::PropertySlot::setValue):
(JSC::PropertySlot::setCustom):
(JSC::PropertySlot::setCacheableCustom):
(JSC::PropertySlot::setCustomIndex):
(JSC::PropertySlot::setGetterSlot):
(JSC::PropertySlot::setCacheableGetterSlot):

  • These mathods now all require 'attributes'.
  • runtime/JSObject.h:

(JSC::JSObject::getDirect):
(JSC::JSObject::getDirectOffset):
(JSC::JSObject::inlineGetOwnPropertySlot):

  • Added variants of getDirect, getDirectOffset that return the attributes.
  • API/JSCallbackObjectFunctions.h:

(JSC::::getOwnPropertySlot):

  • runtime/Arguments.cpp:

(JSC::Arguments::getOwnPropertySlotByIndex):
(JSC::Arguments::getOwnPropertySlot):

  • runtime/JSActivation.cpp:

(JSC::JSActivation::symbolTableGet):
(JSC::JSActivation::getOwnPropertySlot):

  • runtime/JSArray.cpp:

(JSC::JSArray::getOwnPropertySlot):

  • runtime/JSArrayBuffer.cpp:

(JSC::JSArrayBuffer::getOwnPropertySlot):

  • runtime/JSArrayBufferView.cpp:

(JSC::JSArrayBufferView::getOwnPropertySlot):

  • runtime/JSDataView.cpp:

(JSC::JSDataView::getOwnPropertySlot):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::getOwnPropertySlot):

  • runtime/JSGenericTypedArrayViewInlines.h:

(JSC::::getOwnPropertySlot):
(JSC::::getOwnPropertySlotByIndex):

  • runtime/JSObject.cpp:

(JSC::JSObject::getOwnPropertySlotByIndex):
(JSC::JSObject::fillGetterPropertySlot):

  • runtime/JSString.h:

(JSC::JSString::getStringPropertySlot):

  • runtime/JSSymbolTableObject.h:

(JSC::symbolTableGet):

  • runtime/Lookup.cpp:

(JSC::setUpStaticFunctionSlot):

  • runtime/Lookup.h:

(JSC::getStaticPropertySlot):
(JSC::getStaticPropertyDescriptor):
(JSC::getStaticValueSlot):
(JSC::getStaticValueDescriptor):

  • runtime/RegExpObject.cpp:

(JSC::RegExpObject::getOwnPropertySlot):

  • runtime/SparseArrayValueMap.cpp:

(JSC::SparseArrayEntry::get):

  • Pass attributes to PropertySlot::set* methods.

Source/WebCore:

  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):

  • bindings/js/JSHistoryCustom.cpp:

(WebCore::JSHistory::getOwnPropertySlotDelegate):
(WebCore::JSHistory::getOwnPropertyDescriptorDelegate):

  • bindings/js/JSLocationCustom.cpp:

(WebCore::JSLocation::getOwnPropertySlotDelegate):
(WebCore::JSLocation::getOwnPropertyDescriptorDelegate):

  • bindings/js/JSPluginElementFunctions.cpp:

(WebCore::runtimeObjectCustomGetOwnPropertySlot):
(WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertyDescriptor):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):

  • bridge/runtime_method.cpp:

(JSC::RuntimeMethod::getOwnPropertySlot):
(JSC::RuntimeMethod::getOwnPropertyDescriptor):

  • bridge/runtime_object.cpp:

(JSC::Bindings::RuntimeObject::getOwnPropertySlot):
(JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):

  • Pass attributes to PropertySlot::set* methods.

Source/WebKit2:

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::getOwnPropertySlot):
(WebKit::JSNPObject::getOwnPropertyDescriptor):

  • Pass attributes to PropertySlot::set* methods.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r154113 r154253  
    290290        JSValue value = butterfly->contiguous()[i].get();
    291291        if (value) {
    292             slot.setValue(thisObject, value);
     292            slot.setValue(thisObject, None, value);
    293293            return true;
    294294        }
     
    304304        double value = butterfly->contiguousDouble()[i];
    305305        if (value == value) {
    306             slot.setValue(thisObject, JSValue(JSValue::EncodeAsDouble, value));
     306            slot.setValue(thisObject, None, JSValue(JSValue::EncodeAsDouble, value));
    307307            return true;
    308308        }
     
    319319            JSValue value = storage->m_vector[i].get();
    320320            if (value) {
    321                 slot.setValue(thisObject, value);
     321                slot.setValue(thisObject, None, value);
    322322                return true;
    323323            }
     
    16261626}
    16271627
    1628 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue getterSetter, PropertyOffset offset)
     1628NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue getterSetter, unsigned attributes, PropertyOffset offset)
    16291629{
    16301630    if (structure()->isDictionary()) {
    1631         slot.setGetterSlot(this, jsCast<GetterSetter*>(getterSetter));
    1632         return;
    1633     }
    1634 
    1635     slot.setCacheableGetterSlot(this, jsCast<GetterSetter*>(getterSetter), offset);
     1631        slot.setGetterSlot(this, attributes, jsCast<GetterSetter*>(getterSetter));
     1632        return;
     1633    }
     1634
     1635    slot.setCacheableGetterSlot(this, attributes, jsCast<GetterSetter*>(getterSetter), offset);
    16361636}
    16371637
Note: See TracChangeset for help on using the changeset viewer.