Skip to content
  • mhahnenberg@apple.com's avatar
    De-virtualize isGlobalObject, isVariableObject, isActivationObject, and isErrorInstance in JSObject · ebc08a81
    mhahnenberg@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=70968
    
    Reviewed by Geoffrey Garen.
    
    Source/JavaScriptCore: 
    
    * API/JSCallbackObject.cpp: Added two specializations for createStructure that use different JSTypes in their
    TypeInfo.  Had to also create a specialization for JSNonFinalObject, even JSGlobalObject was the only that 
    needed it because Windows wouldn't build without it.
    (JSC::::createStructure):
    * API/JSCallbackObject.h:
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    * runtime/ErrorInstance.h: Removed virtual function and changed JSType provided to TypeInfo in createStructure. 
    (JSC::ErrorInstance::createStructure):
    * runtime/ErrorPrototype.h: Ditto
    (JSC::ErrorPrototype::createStructure):
    * runtime/JSActivation.h: Ditto
    (JSC::JSActivation::createStructure):
    * runtime/JSGlobalObject.h: Ditto
    (JSC::JSGlobalObject::createStructure):
    * runtime/JSObject.h: De-virtualized functions.  They now check the JSType of the object for the corresponding type.
    (JSC::JSObject::isGlobalObject):
    (JSC::JSObject::isVariableObject):
    (JSC::JSObject::isActivationObject):
    (JSC::JSObject::isErrorInstance):
    * runtime/JSType.h: Added new types for GlobalObject, VariableObject, ActivationObject, and ErrorInstance.
    * runtime/JSVariableObject.cpp: Removed virtual function.
    * runtime/JSVariableObject.h: Changed JSType provided to TypeInfo in createStructure.
    (JSC::JSVariableObject::createStructure):
    
    Source/WebCore: 
    
    No new tests.
    
    * bindings/js/JSDOMGlobalObject.h: Changed JSType provided to TypeInfo in createStructure since this 
    class inherits from JSGlobalObject. 
    (WebCore::JSDOMGlobalObject::createStructure):
    * bindings/js/JSDOMWindowBase.h: Ditto
    (WebCore::JSDOMWindowBase::createStructure):
    * bindings/js/JSWorkerContextBase.h: Ditto
    (WebCore::JSWorkerContextBase::createStructure):
    * bindings/scripts/CodeGeneratorJS.pm: Added extra check to make sure subclasses of JSGlobalObject,
    namely JSDOMWindow and JSWorkerContext, get their special JSType in their createStructure function.
    (GenerateHeader):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ebc08a81