Ignore:
Timestamp:
Jun 6, 2014, 4:56:50 PM (11 years ago)
Author:
[email protected]
Message:

Indexed getters should return values directly on the PropertySlot.
<https://webkit.org/b/133586>

Source/JavaScriptCore:
Remove PropertySlot's custom index mode.

Reviewed by Darin Adler.

  • runtime/JSObject.h:

(JSC::PropertySlot::getValue):

  • runtime/PropertySlot.h:

(JSC::PropertySlot::setCustomIndex): Deleted.

Source/WebCore:
Make indexed getters more efficient by using PropertySlot::setValue()
to pass the value directly back through the slot, instead of giving it
a function pointer that JSC would then immediately call back through
to retrieve the value.

The function pointer approach would make sense if we did inline caching
of indexed getters but since we currently don't, this is pure overhead.

Reviewed by Darin Adler.

  • bindings/js/JSCSSStyleDeclarationCustom.cpp:

(WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate):
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback): Deleted.
(WebCore::cssPropertyGetterCallback): Deleted.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::indexGetter): Deleted.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateGetOwnPropertySlotBody):
(GenerateHeader):
(GetIndexedGetterExpression):
(GenerateImplementation):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):
(JSC::RuntimeArray::indexGetter): Deleted.

  • bridge/runtime_array.h:
File:
1 edited

Legend:

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

    r167842 r169668  
    15611561    if (m_propertyType == TypeValue)
    15621562        return JSValue::decode(m_data.value);
    1563     if (m_propertyType == TypeCustomIndex)
    1564         return JSValue::decode(m_data.customIndex.getIndexValue(exec, slotBase(), JSValue::encode(m_thisValue), m_data.customIndex.index));
    15651563    if (m_propertyType == TypeGetter)
    15661564        return functionGetter(exec);
     
    15721570    if (m_propertyType == TypeValue)
    15731571        return JSValue::decode(m_data.value);
    1574     if (m_propertyType == TypeCustomIndex)
    1575         return JSValue::decode(m_data.customIndex.getIndexValue(exec, slotBase(), JSValue::encode(m_thisValue), m_data.customIndex.index));
    15761572    if (m_propertyType == TypeGetter)
    15771573        return functionGetter(exec);
Note: See TracChangeset for help on using the changeset viewer.