JSDOMWindow should have a WatchpointSet to fire on window close
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2014 20:26:17 +0000 (20:26 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 May 2014 20:26:17 +0000 (20:26 +0000)
commit4648ebb88968a3fbaff2dcb42a493eddaf2d3798
tree1902e46751fb3edbec10fdcac9df2a53c7ae2b50
parentf92756eb0cdbb21c096f6c57aa72511da1d0327a
JSDOMWindow should have a WatchpointSet to fire on window close
https://bugs.webkit.org/show_bug.cgi?id=132721

Reviewed by Filip Pizlo.

Source/JavaScriptCore:
This patch allows us to reset the inline caches that assumed they could skip
the first part of JSDOMWindow::getOwnPropertySlot that checks if the window has
been closed. This is part of getting rid of HasImpureGetOwnPropertySlot on JSDOMWindow.

PropertySlot now accepts a WatchpointSet which the inline cache code can look for
to see if it should create a new Watchpoint for that particular inline cache site.

* bytecode/Watchpoint.h:
* jit/Repatch.cpp:
(JSC::generateByIdStub):
(JSC::tryBuildGetByIDList):
(JSC::tryCachePutByID):
(JSC::tryBuildPutByIdList):
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::watchpointSet):
(JSC::PropertySlot::setWatchpointSet):

Source/WebCore:
No new tests.

This patch allows us to reset the inline caches that assumed they could skip
the first part of JSDOMWindow::getOwnPropertySlot that checks if the window has
been closed. This is part of getting rid of HasImpureGetOwnPropertySlot on JSDOMWindow.

JSDOMWindowBase now has a WatchpointSet that the underlying DOMWindow fires when its
frame is cleared. In getOwnPropertySlot, we now pass this WatchpointSet to PropertySlot
which will shepherd it back up to the code that generates the inline cache (and the
Watchpoint for clearing it).

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::frameDestroyed):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
Source/JavaScriptCore/bytecode/PolymorphicGetByIdList.h
Source/JavaScriptCore/bytecode/Watchpoint.h
Source/JavaScriptCore/jit/Repatch.cpp
Source/JavaScriptCore/runtime/PropertySlot.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/page/DOMWindow.cpp