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/JSString.h

    r154113 r154253  
    474474    {
    475475        if (propertyName == exec->propertyNames().length) {
    476             slot.setValue(this, jsNumber(m_length));
     476            slot.setValue(this, DontEnum | DontDelete | ReadOnly, jsNumber(m_length));
    477477            return true;
    478478        }
     
    481481        if (i < m_length) {
    482482            ASSERT(i != PropertyName::NotAnIndex); // No need for an explicit check, the above test would always fail!
    483             slot.setValue(this, getIndex(exec, i));
     483            slot.setValue(this, DontDelete | ReadOnly, getIndex(exec, i));
    484484            return true;
    485485        }
     
    491491    {
    492492        if (propertyName < m_length) {
    493             slot.setValue(this, getIndex(exec, propertyName));
     493            slot.setValue(this, DontDelete | ReadOnly, getIndex(exec, propertyName));
    494494            return true;
    495495        }
Note: See TracChangeset for help on using the changeset viewer.