Remove need for virtual JSObject::unwrappedObject
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 23:43:58 +0000 (23:43 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2011 23:43:58 +0000 (23:43 +0000)
commit160293afcf23ad6bdefecd4f39555d3a7cb9cab0
tree75ead37e71090675dbf6c5aaf6bedc8a75a070e1
parent72f8f84df0dfc4093eb63590e0607d4bb1ea26ee
Remove need for virtual JSObject::unwrappedObject
https://bugs.webkit.org/show_bug.cgi?id=71034

Reviewed by Geoffrey Garen.

../JavaScriptCore:

* JavaScriptCore.exp:
Update exports.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.exp:
* JavaScriptCore.gypi:
* JavaScriptCore.pro:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
Add JSGlobalThis.cpp.

* runtime/JSGlobalThis.cpp: Added.
(JSC::JSGlobalThis::visitChildren):
(JSC::JSGlobalThis::unwrappedObject):
* runtime/JSGlobalThis.h:
(JSC::JSGlobalThis::createStructure):
Move underlying object from JSDOMWindowShell down to JSGlobalThis
and corresponding visitChildren method.

* runtime/JSObject.cpp:
(JSC::JSObject::unwrappedObject):
Change unwrappedObject from virtual, to just needing an if check.

* runtime/JSObject.h:
(JSC::JSObject::isGlobalThis):
* runtime/JSType.h:
Add isGlobalThis predicate and type.

../WebCore:

Move the member containing the global object from the JSDOMWindowShell
down to the JSGlobalThis class, and update JSDOMWindowShell to go through
an inline helper (which just casts) to get the window.

* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::setWindow):
(WebCore::JSDOMWindowShell::className):
(WebCore::JSDOMWindowShell::getOwnPropertySlot):
(WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
(WebCore::JSDOMWindowShell::put):
(WebCore::JSDOMWindowShell::putWithAttributes):
(WebCore::JSDOMWindowShell::defineOwnProperty):
(WebCore::JSDOMWindowShell::deleteProperty):
(WebCore::JSDOMWindowShell::getPropertyNames):
(WebCore::JSDOMWindowShell::getOwnPropertyNames):
(WebCore::JSDOMWindowShell::defineGetter):
(WebCore::JSDOMWindowShell::defineSetter):
(WebCore::JSDOMWindowShell::lookupGetter):
(WebCore::JSDOMWindowShell::lookupSetter):
(WebCore::JSDOMWindowShell::impl):
* bindings/js/JSDOMWindowShell.h:
(WebCore::JSDOMWindowShell::window):
(WebCore::JSDOMWindowShell::setWindow):
(WebCore::JSDOMWindowShell::createStructure):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/GNUmakefile.list.am
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.pro
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/runtime/JSGlobalThis.cpp [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSGlobalThis.h
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSType.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.h