Changeset 168914 in webkit


Ignore:
Timestamp:
May 15, 2014 4:03:06 PM (10 years ago)
Author:
mhahnenberg@apple.com
Message:

JSDOMWindow should not claim HasImpureGetOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=132918

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  • jit/Repatch.cpp:

(JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in".

Source/WebCore:
Tests: js/cached-window-properties.html

js/cached-window-prototype-properties.html

We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the
blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow
us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used
across the web.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::getOwnPropertySlot):

  • bindings/scripts/CodeGeneratorJS.pm:

(HasComplexGetOwnProperty):
(InterfaceRequiresAttributesOnInstance):
(InstanceOverridesGetOwnPropertySlot):
(GenerateHeader):

LayoutTests:
We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the
blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow
us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used
across the web.

These tests trigger inline caching of window and window prototype properties.

  • js/cached-window-properties-expected.txt: Added.
  • js/cached-window-properties.html: Added.
  • js/cached-window-prototype-properties-expected.txt: Added.
  • js/cached-window-prototype-properties.html: Added.
Location:
trunk
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r168908 r168914  
     12014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        JSDOMWindow should not claim HasImpureGetOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=132918
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the
     9        blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
     10        any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow
     11        us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used
     12        across the web.
     13
     14        These tests trigger inline caching of window and window prototype properties.
     15
     16        * js/cached-window-properties-expected.txt: Added.
     17        * js/cached-window-properties.html: Added.
     18        * js/cached-window-prototype-properties-expected.txt: Added.
     19        * js/cached-window-prototype-properties.html: Added.
     20
    1212014-05-15  Alexey Proskuryakov  <ap@apple.com>
    222
  • trunk/Source/JavaScriptCore/ChangeLog

    r168903 r168914  
     12014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        JSDOMWindow should not claim HasImpureGetOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=132918
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * jit/Repatch.cpp:
     9        (JSC::tryRepatchIn): We forgot to check for watchpoints when repatching "in".
     10
    1112014-05-15  Alex Christensen  <achristensen@webkit.org>
    212
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r168861 r168914  
    14591459            vm->registerWatchpointForImpureProperty(ident, stubInfo.addWatchpoint(codeBlock));
    14601460
     1461        if (slot.watchpointSet())
     1462            slot.watchpointSet()->add(stubInfo.addWatchpoint(codeBlock));
     1463
    14611464        Structure* currStructure = structure;
    14621465        WriteBarrier<Structure>* it = chain->head();
  • trunk/Source/WebCore/ChangeLog

    r168909 r168914  
     12014-05-15  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        JSDOMWindow should not claim HasImpureGetOwnPropertySlot
     4        https://bugs.webkit.org/show_bug.cgi?id=132918
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Tests: js/cached-window-properties.html
     9               js/cached-window-prototype-properties.html
     10
     11        We now correctly handle the impurity of JSDOMWindow's custom getOwnPropertySlot without needing the
     12        blanket HasImpureGetOwnPropertySlot. We do this through the use of watchpoints and by explicitly forbidding
     13        any caching beyond a certain point using PropertySlot::disableCaching. Getting rid of this flag will allow
     14        us to cache many properties/methods on both the JSDOMWindow and its prototype, which are very commonly used
     15        across the web.
     16
     17        * bindings/js/JSDOMWindowCustom.cpp:
     18        (WebCore::JSDOMWindow::getOwnPropertySlot):
     19        * bindings/scripts/CodeGeneratorJS.pm:
     20        (HasComplexGetOwnProperty):
     21        (InterfaceRequiresAttributesOnInstance):
     22        (InstanceOverridesGetOwnPropertySlot):
     23        (GenerateHeader):
     24
    1252014-05-15  Alexey Proskuryakov  <ap@apple.com>
    226
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r168902 r168914  
    193193    entry = JSDOMWindow::info()->propHashTable(exec)->entry(exec, propertyName);
    194194    if (entry) {
    195         slot.setCustom(thisObject, allowsAccess ? entry->attributes() : ReadOnly | DontDelete | DontEnum, entry->propertyGetter());
     195        slot.setCacheableCustom(thisObject, allowsAccess ? entry->attributes() : ReadOnly | DontDelete | DontEnum, entry->propertyGetter());
    196196        return true;
    197197    }
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r168385 r168914  
    590590
    591591    my $hasImpureNamedGetter = $namedGetterFunction
    592         || $interface->extendedAttributes->{"CustomNamedGetter"}
    593         || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"};
     592        || $interface->extendedAttributes->{"CustomNamedGetter"};
    594593
    595594    my $hasComplexGetter = $indexedGetterFunction
    596595        || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}
     596        || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}
    597597        || $hasImpureNamedGetter;
    598598
     
    617617    # overrides are handled so that we get the correct semantics and lookup ordering
    618618    my $hasImpureNamedGetter = $namedGetterFunction
    619     || $interface->extendedAttributes->{"CustomNamedGetter"}
    620     || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"};
    621     return 1 if $hasImpureNamedGetter;
     619        || $interface->extendedAttributes->{"CustomNamedGetter"};
     620    return 1 if $hasImpureNamedGetter
     621        || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"};
    622622
    623623    # FIXME: These two should be fixed by removing the custom override of message, etc
     
    728728
    729729    my $hasImpureNamedGetter = $namedGetterFunction
    730         || $interface->extendedAttributes->{"CustomNamedGetter"}
    731         || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"};
     730        || $interface->extendedAttributes->{"CustomNamedGetter"};
    732731
    733732    my $hasComplexGetter = $indexedGetterFunction
    734733        || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}
     734        || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}
    735735        || $hasImpureNamedGetter;
    736736
     
    892892    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
    893893
    894     my $hasImpureNamedGetter =
    895         $namedGetterFunction
    896         || $interface->extendedAttributes->{"CustomNamedGetter"}
    897         || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"};
     894    my $hasImpureNamedGetter = $namedGetterFunction
     895        || $interface->extendedAttributes->{"CustomNamedGetter"};
    898896
    899897    my $hasComplexGetter =
    900898        $indexedGetterFunction
    901899        || $interface->extendedAttributes->{"JSCustomGetOwnPropertySlotAndDescriptor"}
     900        || $interface->extendedAttributes->{"CustomGetOwnPropertySlot"}
    902901        || $hasImpureNamedGetter;
    903902   
Note: See TracChangeset for help on using the changeset viewer.