JSDOMWindow should not claim HasImpureGetOwnPropertySlot
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 23:03:06 +0000 (23:03 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 May 2014 23:03:06 +0000 (23:03 +0000)
commitd4e73f3b9b6b074a87f6e0fc94a5f49cb6290a84
tree62a699c671bb24012c3aa0a300abf89342615a46
parenta0b52761830f5d6a8678fbf5d8458c6e4c7447ab
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/cached-window-properties-expected.txt [new file with mode: 0644]
LayoutTests/js/cached-window-properties.html [new file with mode: 0644]
LayoutTests/js/cached-window-prototype-properties-expected.txt [new file with mode: 0644]
LayoutTests/js/cached-window-prototype-properties.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/Repatch.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm