Ignore:
Timestamp:
Oct 31, 2011, 4:43:58 PM (14 years ago)
Author:
[email protected]
Message:

Remove need for virtual JSObject::unwrappedObject
https://bugs.webkit.org/show_bug.cgi?id=71034

Reviewed by Geoffrey Garen.

../JavaScriptCore:

Update exports.

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):

File:
1 edited

Legend:

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

    r98889 r98909  
    3030#include "JSFunction.h"
    3131#include "JSGlobalObject.h"
     32#include "JSGlobalThis.h"
     33#include "Lookup.h"
    3234#include "NativeErrorConstructor.h"
     35#include "Nodes.h"
    3336#include "ObjectPrototype.h"
     37#include "Operations.h"
    3438#include "PropertyDescriptor.h"
    3539#include "PropertyNameArray.h"
    36 #include "Lookup.h"
    37 #include "Nodes.h"
    38 #include "Operations.h"
    3940#include <math.h>
    4041#include <wtf/Assertions.h>
     
    565566JSObject* JSObject::unwrappedObject()
    566567{
     568    if (isGlobalThis())
     569        return static_cast<JSGlobalThis*>(this)->unwrappedObject();
    567570    return this;
    568571}
Note: See TracChangeset for help on using the changeset viewer.