Make WebCore use jsCast rather than static_cast for casting JSC objects
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 22:33:19 +0000 (22:33 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Apr 2012 22:33:19 +0000 (22:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83320

Reviewed by Stephanie Lewis.

Mechanically replace static_cast with jsCast where ever we can.

* WebCore.exp.in:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::JSStringOwner::finalize):
* bindings/js/DOMWrapperWorld.h:
(WebCore::currentWorld):
* bindings/js/JSArrayBufferCustom.cpp:
(WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContextConstructor::constructJSAudioContext):
* bindings/js/JSCSSRuleListCustom.cpp:
(WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
(WebCore::cssPropertyGetterCallback):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
(WebCore::JSCSSValueOwner::finalize):
* bindings/js/JSDOMBinding.cpp:
(WebCore::reportException):
* bindings/js/JSDOMBinding.h:
(WebCore::deprecatedGlobalObjectForPrototype):
(WebCore::getDOMPrototype):
* bindings/js/JSDOMFormDataCustom.cpp:
(WebCore::toHTMLFormElement):
(WebCore::JSDOMFormDataConstructor::constructJSDOMFormData):
* bindings/js/JSDOMMimeTypeArrayCustom.cpp:
(WebCore::JSDOMMimeTypeArray::nameGetter):
* bindings/js/JSDOMPluginArrayCustom.cpp:
(WebCore::JSDOMPluginArray::nameGetter):
* bindings/js/JSDOMPluginCustom.cpp:
(WebCore::JSDOMPlugin::nameGetter):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::nameGetter):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::childFrameGetter):
(WebCore::indexGetter):
(WebCore::namedItemGetter):
(WebCore::toDOMWindow):
* bindings/js/JSDOMWindowCustom.h:
(WebCore::asJSDOMWindow):
* bindings/js/JSDOMWindowShell.h:
(WebCore::JSDOMWindowShell::window):
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::globalObject):
* bindings/js/JSDataViewCustom.cpp:
(WebCore::JSDataViewConstructor::constructJSDataView):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSEventTarget.cpp:
(WebCore):
(WebCore::toEventTarget):
* bindings/js/JSFloat32ArrayCustom.cpp:
(WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
* bindings/js/JSFloat64ArrayCustom.cpp:
(WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::nameGetter):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::nameGetter):
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter):
* bindings/js/JSHTMLFrameSetElementCustom.cpp:
(WebCore::JSHTMLFrameSetElement::nameGetter):
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::remove):
* bindings/js/JSImageConstructor.cpp:
(WebCore::constructImage):
* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
(WebCore::InjectedScriptManager::discardInjectedScript):
(WebCore::InjectedScriptManager::injectedScriptFor):
* bindings/js/JSInt16ArrayCustom.cpp:
(WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
* bindings/js/JSInt32ArrayCustom.cpp:
(WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
* bindings/js/JSInt8ArrayCustom.cpp:
(WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSNamedNodeMapCustom.cpp:
(WebCore::JSNamedNodeMap::nameGetter):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::JSNodeOwner::finalize):
* bindings/js/JSNodeCustom.h:
(WebCore::toJS):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::toNodeFilter):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
(WebCore::JSNodeList::nameGetter):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::runtimeObjectPropertyGetter):
(WebCore::callPlugin):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter):
* bindings/js/JSStyleSheetListCustom.cpp:
(WebCore::JSStyleSheetList::nameGetter):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrackOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTextTrackListCustom.cpp:
(WebCore::JSTextTrackListOwner::isReachableFromOpaqueRoots):
* bindings/js/JSTrackCustom.cpp:
(WebCore::toTrack):
* bindings/js/JSUint16ArrayCustom.cpp:
(WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
* bindings/js/JSUint32ArrayCustom.cpp:
(WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
* bindings/js/JSUint8ArrayCustom.cpp:
(WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
* bindings/js/JSUint8ClampedArrayCustom.cpp:
(WebCore::JSUint8ClampedArrayConstructor::constructJSUint8ClampedArray):
* bindings/js/JSWebKitMutationObserverCustom.cpp:
(WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
* bindings/js/JSWebKitPointCustom.cpp:
(WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
* bindings/js/JSWebSocketCustom.cpp:
(WebCore::JSWebSocketConstructor::constructJSWebSocket):
* bindings/js/JSWorkerContextBase.cpp:
(WebCore::toJSDedicatedWorkerContext):
(WebCore::toJSSharedWorkerContext):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorkerConstructor::constructJSWorker):
* bindings/js/JSXSLTProcessorCustom.cpp:
(WebCore::JSXSLTProcessor::importStylesheet):
(WebCore::JSXSLTProcessor::transformToFragment):
(WebCore::JSXSLTProcessor::transformToDocument):
* bindings/js/ScriptCallStackFactory.cpp:
(WebCore::createScriptCallStackForInspector):
* bindings/js/ScriptControllerMac.mm:
(WebCore::updateStyleIfNeededForBindings):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::dispatchDidPause):
* bindings/js/ScriptObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/ScriptState.cpp:
(WebCore::domWindowFromScriptState):
(WebCore::scriptExecutionContextFromScriptState):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneDeserializer::getJSValue):
(WebCore::CloneDeserializer::readTerminal):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
(+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
(GenerateCallWith):
(NativeToJSValue):
(GenerateConstructorDefinition):
* bridge/jni/jni_jsobject.h:
* bridge/jni/jni_jsobject.mm:
(JavaJSObject::convertJObjectToValue):
* bridge/jni/jsc/JavaInstanceJSC.cpp:
(JavaInstance::invokeMethod):
* bridge/objc/objc_utility.mm:
(JSC::Bindings::convertValueToObjcValue):
* bridge/runtime_method.cpp:
(JSC::callRuntimeMethod):
* bridge/runtime_object.cpp:
(JSC::Bindings::callRuntimeConstructor):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::injectInternalsObject):
(WebCoreTestSupport::resetInternalsObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@113387 268f45cc-cd09-0410-ab3c-d52691b4dbfc

79 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/bindings/js/DOMWrapperWorld.cpp
Source/WebCore/bindings/js/DOMWrapperWorld.h
Source/WebCore/bindings/js/JSArrayBufferCustom.cpp
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleListCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCSSValueCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp
Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
Source/WebCore/bindings/js/JSDOMPluginCustom.cpp
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.h
Source/WebCore/bindings/js/JSDOMWindowShell.h
Source/WebCore/bindings/js/JSDOMWrapper.h
Source/WebCore/bindings/js/JSDataViewCustom.cpp
Source/WebCore/bindings/js/JSEventListener.cpp
Source/WebCore/bindings/js/JSEventTarget.cpp
Source/WebCore/bindings/js/JSFloat32ArrayCustom.cpp
Source/WebCore/bindings/js/JSFloat64ArrayCustom.cpp
Source/WebCore/bindings/js/JSGeolocationCustom.cpp
Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLFrameSetElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
Source/WebCore/bindings/js/JSImageConstructor.cpp
Source/WebCore/bindings/js/JSInjectedScriptManager.cpp
Source/WebCore/bindings/js/JSInt16ArrayCustom.cpp
Source/WebCore/bindings/js/JSInt32ArrayCustom.cpp
Source/WebCore/bindings/js/JSInt8ArrayCustom.cpp
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.h
Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
Source/WebCore/bindings/js/JSNodeListCustom.cpp
Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
Source/WebCore/bindings/js/JSPopStateEventCustom.cpp
Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp
Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp
Source/WebCore/bindings/js/JSTextTrackCustom.cpp
Source/WebCore/bindings/js/JSTextTrackListCustom.cpp
Source/WebCore/bindings/js/JSTrackCustom.cpp
Source/WebCore/bindings/js/JSUint16ArrayCustom.cpp
Source/WebCore/bindings/js/JSUint32ArrayCustom.cpp
Source/WebCore/bindings/js/JSUint8ArrayCustom.cpp
Source/WebCore/bindings/js/JSUint8ClampedArrayCustom.cpp
Source/WebCore/bindings/js/JSWebKitMutationObserverCustom.cpp
Source/WebCore/bindings/js/JSWebKitPointCustom.cpp
Source/WebCore/bindings/js/JSWebSocketCustom.cpp
Source/WebCore/bindings/js/JSWorkerContextBase.cpp
Source/WebCore/bindings/js/JSWorkerCustom.cpp
Source/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
Source/WebCore/bindings/js/ScriptCallStackFactory.cpp
Source/WebCore/bindings/js/ScriptControllerMac.mm
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/bindings/js/ScriptObject.cpp
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/objc/WebScriptObject.mm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bridge/jni/jni_jsobject.h
Source/WebCore/bridge/jni/jni_jsobject.mm
Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp
Source/WebCore/bridge/objc/objc_utility.mm
Source/WebCore/bridge/runtime_method.cpp
Source/WebCore/bridge/runtime_object.cpp
Source/WebCore/testing/js/WebCoreTestSupport.cpp

index fa85906..0f0b743 100644 (file)
@@ -1,3 +1,196 @@
+2012-04-05  Oliver Hunt  <oliver@apple.com>
+
+        Make WebCore use jsCast rather than static_cast for casting JSC objects
+        https://bugs.webkit.org/show_bug.cgi?id=83320
+
+        Reviewed by Stephanie Lewis.
+
+        Mechanically replace static_cast with jsCast where ever we can.
+
+        * WebCore.exp.in:
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::JSStringOwner::finalize):
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::currentWorld):
+        * bindings/js/JSArrayBufferCustom.cpp:
+        (WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::JSAudioContextConstructor::constructJSAudioContext):
+        * bindings/js/JSCSSRuleListCustom.cpp:
+        (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
+        (WebCore::cssPropertyGetterCallback):
+        * bindings/js/JSCSSValueCustom.cpp:
+        (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSCSSValueOwner::finalize):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::reportException):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::deprecatedGlobalObjectForPrototype):
+        (WebCore::getDOMPrototype):
+        * bindings/js/JSDOMFormDataCustom.cpp:
+        (WebCore::toHTMLFormElement):
+        (WebCore::JSDOMFormDataConstructor::constructJSDOMFormData):
+        * bindings/js/JSDOMMimeTypeArrayCustom.cpp:
+        (WebCore::JSDOMMimeTypeArray::nameGetter):
+        * bindings/js/JSDOMPluginArrayCustom.cpp:
+        (WebCore::JSDOMPluginArray::nameGetter):
+        * bindings/js/JSDOMPluginCustom.cpp:
+        (WebCore::JSDOMPlugin::nameGetter):
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::nameGetter):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::toJSDOMWindow):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::childFrameGetter):
+        (WebCore::indexGetter):
+        (WebCore::namedItemGetter):
+        (WebCore::toDOMWindow):
+        * bindings/js/JSDOMWindowCustom.h:
+        (WebCore::asJSDOMWindow):
+        * bindings/js/JSDOMWindowShell.h:
+        (WebCore::JSDOMWindowShell::window):
+        * bindings/js/JSDOMWrapper.h:
+        (WebCore::JSDOMWrapper::globalObject):
+        * bindings/js/JSDataViewCustom.cpp:
+        (WebCore::JSDataViewConstructor::constructJSDataView):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSEventTarget.cpp:
+        (WebCore):
+        (WebCore::toEventTarget):
+        * bindings/js/JSFloat32ArrayCustom.cpp:
+        (WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
+        * bindings/js/JSFloat64ArrayCustom.cpp:
+        (WebCore::JSFloat64ArrayConstructor::constructJSFloat64Array):
+        * bindings/js/JSGeolocationCustom.cpp:
+        (WebCore::JSGeolocation::getCurrentPosition):
+        (WebCore::JSGeolocation::watchPosition):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::callHTMLAllCollection):
+        (WebCore::JSHTMLAllCollection::nameGetter):
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::JSHTMLCollection::nameGetter):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::JSHTMLDocument::nameGetter):
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::nameGetter):
+        * bindings/js/JSHTMLFrameSetElementCustom.cpp:
+        (WebCore::JSHTMLFrameSetElement::nameGetter):
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+        (WebCore::JSHTMLOptionsCollection::remove):
+        * bindings/js/JSImageConstructor.cpp:
+        (WebCore::constructImage):
+        * bindings/js/JSInjectedScriptManager.cpp:
+        (WebCore::InjectedScriptManager::createInjectedScript):
+        (WebCore::InjectedScriptManager::discardInjectedScript):
+        (WebCore::InjectedScriptManager::injectedScriptFor):
+        * bindings/js/JSInt16ArrayCustom.cpp:
+        (WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
+        * bindings/js/JSInt32ArrayCustom.cpp:
+        (WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
+        * bindings/js/JSInt8ArrayCustom.cpp:
+        (WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::initializeJSFunction):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::nameGetter):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSNodeOwner::finalize):
+        * bindings/js/JSNodeCustom.h:
+        (WebCore::toJS):
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::toNodeFilter):
+        * bindings/js/JSNodeListCustom.cpp:
+        (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSNodeList::nameGetter):
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::runtimeObjectPropertyGetter):
+        (WebCore::callPlugin):
+        * bindings/js/JSPopStateEventCustom.cpp:
+        (WebCore::JSPopStateEvent::state):
+        * bindings/js/JSSQLTransactionCustom.cpp:
+        (WebCore::JSSQLTransaction::executeSql):
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::nameGetter):
+        * bindings/js/JSStyleSheetListCustom.cpp:
+        (WebCore::JSStyleSheetList::nameGetter):
+        * bindings/js/JSTextTrackCueCustom.cpp:
+        (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSTextTrackCustom.cpp:
+        (WebCore::JSTextTrackOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSTextTrackListCustom.cpp:
+        (WebCore::JSTextTrackListOwner::isReachableFromOpaqueRoots):
+        * bindings/js/JSTrackCustom.cpp:
+        (WebCore::toTrack):
+        * bindings/js/JSUint16ArrayCustom.cpp:
+        (WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
+        * bindings/js/JSUint32ArrayCustom.cpp:
+        (WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
+        * bindings/js/JSUint8ArrayCustom.cpp:
+        (WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
+        * bindings/js/JSUint8ClampedArrayCustom.cpp:
+        (WebCore::JSUint8ClampedArrayConstructor::constructJSUint8ClampedArray):
+        * bindings/js/JSWebKitMutationObserverCustom.cpp:
+        (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver):
+        * bindings/js/JSWebKitPointCustom.cpp:
+        (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
+        * bindings/js/JSWebSocketCustom.cpp:
+        (WebCore::JSWebSocketConstructor::constructJSWebSocket):
+        * bindings/js/JSWorkerContextBase.cpp:
+        (WebCore::toJSDedicatedWorkerContext):
+        (WebCore::toJSSharedWorkerContext):
+        * bindings/js/JSWorkerCustom.cpp:
+        (WebCore::JSWorkerConstructor::constructJSWorker):
+        * bindings/js/JSXSLTProcessorCustom.cpp:
+        (WebCore::JSXSLTProcessor::importStylesheet):
+        (WebCore::JSXSLTProcessor::transformToFragment):
+        (WebCore::JSXSLTProcessor::transformToDocument):
+        * bindings/js/ScriptCallStackFactory.cpp:
+        (WebCore::createScriptCallStackForInspector):
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::updateStyleIfNeededForBindings):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::dispatchDidPause):
+        * bindings/js/ScriptObject.cpp:
+        (WebCore::ScriptGlobalObject::set):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::domWindowFromScriptState):
+        (WebCore::scriptExecutionContextFromScriptState):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::fillTransferMap):
+        (WebCore::CloneSerializer::dumpArrayBufferView):
+        (WebCore::CloneDeserializer::getJSValue):
+        (WebCore::CloneDeserializer::readTerminal):
+        * bindings/objc/WebScriptObject.mm:
+        (-[WebScriptObject _isSafeScript]):
+        (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateGetOwnPropertySlotBody):
+        (GenerateGetOwnPropertyDescriptorBody):
+        (GenerateImplementation):
+        (GenerateCallWith):
+        (NativeToJSValue):
+        (GenerateConstructorDefinition):
+        * bridge/jni/jni_jsobject.h:
+        * bridge/jni/jni_jsobject.mm:
+        (JavaJSObject::convertJObjectToValue):
+        * bridge/jni/jsc/JavaInstanceJSC.cpp:
+        (JavaInstance::invokeMethod):
+        * bridge/objc/objc_utility.mm:
+        (JSC::Bindings::convertValueToObjcValue):
+        * bridge/runtime_method.cpp:
+        (JSC::callRuntimeMethod):
+        * bridge/runtime_object.cpp:
+        (JSC::Bindings::callRuntimeConstructor):
+        * testing/js/WebCoreTestSupport.cpp:
+        (WebCoreTestSupport::injectInternalsObject):
+        (WebCoreTestSupport::resetInternalsObject):
+
 2012-04-05  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] Scrolling some iframes that are partially out of the viewport leads to repaint errors
index 2ff3620..e83d92c 100644 (file)
@@ -537,6 +537,7 @@ __ZN7WebCore17DeviceOrientation6createEbdbdbdbb
 __ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
 __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
 __ZN7WebCore17HistoryController33restoreScrollPositionAndViewStateEv
+__ZN7WebCore17JSDOMGlobalObject6s_infoE
 __ZN7WebCore17RegularExpressionC1ERKN3WTF6StringENS1_19TextCaseSensitivityE
 __ZN7WebCore17RegularExpressionD1Ev
 __ZN7WebCore17cacheDOMStructureEPNS_17JSDOMGlobalObjectEPN3JSC9StructureEPKNS2_9ClassInfoE
@@ -1165,6 +1166,7 @@ __ZN7WebCore9plainTextEPKNS_5RangeENS_20TextIteratorBehaviorE
 __ZN7WebCore9toElementEN3JSC7JSValueE
 __ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0EEE
 __ZN7WebCore11BitmapImageC1EPNS_13ImageObserverE
+__ZN7WebCore11JSDOMWindow6s_infoE
 __ZN7WebCore5Image7setDataEN3WTF10PassRefPtrINS_12SharedBufferEEEb
 __ZNK3JSC8Bindings10RootObject12globalObjectEv
 __ZNK3WTF6String14createCFStringEv
index d082242..a1f86d4 100644 (file)
@@ -32,7 +32,7 @@ namespace WebCore {
 
 void JSStringOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
-    JSString* jsString = static_cast<JSString*>(handle.get().asCell());
+    JSString* jsString = jsCast<JSString*>(handle.get().asCell());
     StringImpl* stringImpl = static_cast<StringImpl*>(context);
     ASSERT_UNUSED(jsString, m_world->m_stringCache.find(stringImpl)->second.was(jsString));
     m_world->m_stringCache.remove(stringImpl);
index 010be04..755375d 100644 (file)
@@ -91,7 +91,7 @@ inline DOMWrapperWorld* pluginWorld() { return mainThreadNormalWorld(); }
 
 inline DOMWrapperWorld* currentWorld(JSC::ExecState* exec)
 {
-    return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
+    return JSC::jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->world();
 }
 
 } // namespace WebCore
index 3ddcf9a..2fa306a 100644 (file)
@@ -36,7 +36,7 @@ using namespace JSC;
 
 EncodedJSValue JSC_HOST_CALL JSArrayBufferConstructor::constructJSArrayBuffer(ExecState* exec)
 {
-    JSArrayBufferConstructor* jsConstructor = static_cast<JSArrayBufferConstructor*>(exec->callee());
+    JSArrayBufferConstructor* jsConstructor = jsCast<JSArrayBufferConstructor*>(exec->callee());
 
     int length = 0;
     if (exec->argumentCount() > 0)
index cbeb514..9f5e26e 100644 (file)
@@ -51,7 +51,7 @@ void JSAudioContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 EncodedJSValue JSC_HOST_CALL JSAudioContextConstructor::constructJSAudioContext(ExecState* exec)
 {
-    JSAudioContextConstructor* jsConstructor = static_cast<JSAudioContextConstructor*>(exec->callee());
+    JSAudioContextConstructor* jsConstructor = jsCast<JSAudioContextConstructor*>(exec->callee());
     if (!jsConstructor)
         return throwVMError(exec, createReferenceError(exec, "AudioContext constructor callee is unavailable"));
 
index 28ccb1f..87b69a6 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 bool JSCSSRuleListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSCSSRuleList* jsCSSRuleList = static_cast<JSCSSRuleList*>(handle.get().asCell());
+    JSCSSRuleList* jsCSSRuleList = jsCast<JSCSSRuleList*>(handle.get().asCell());
     if (!jsCSSRuleList->hasCustomProperties())
         return false;
     if (CSSStyleSheet* styleSheet = jsCSSRuleList->impl()->styleSheet())
index 61ccd02..7d19c22 100644 (file)
@@ -292,7 +292,7 @@ static inline JSValue cssPropertyGetterPixelOrPosPrefix(ExecState* exec, JSCSSSt
 
 static JSValue cssPropertyGetterPixelOrPosPrefixCallback(ExecState* exec, JSValue slotBase, unsigned propertyID)
 {
-    return cssPropertyGetterPixelOrPosPrefix(exec, static_cast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);
+    return cssPropertyGetterPixelOrPosPrefix(exec, jsCast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);
 }
 
 static inline JSValue cssPropertyGetter(ExecState* exec, JSCSSStyleDeclaration* thisObj, unsigned propertyID)
@@ -306,7 +306,7 @@ static inline JSValue cssPropertyGetter(ExecState* exec, JSCSSStyleDeclaration*
 
 static JSValue cssPropertyGetterCallback(ExecState* exec, JSValue slotBase, unsigned propertyID)
 {
-    return cssPropertyGetter(exec, static_cast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);
+    return cssPropertyGetter(exec, jsCast<JSCSSStyleDeclaration*>(asObject(slotBase)), propertyID);
 }
 
 bool JSCSSStyleDeclaration::getOwnPropertySlotDelegate(ExecState*, const Identifier& propertyIdentifier, PropertySlot& slot)
index 0efb4bb..3771e49 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
 
 bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void* context, SlotVisitor& visitor)
 {
-    JSCSSValue* jsCSSValue = static_cast<JSCSSValue*>(handle.get().asCell());
+    JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.get().asCell());
     if (!jsCSSValue->hasCustomProperties())
         return false;
     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
@@ -64,7 +64,7 @@ bool JSCSSValueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handl
 
 void JSCSSValueOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
-    JSCSSValue* jsCSSValue = static_cast<JSCSSValue*>(handle.get().asCell());
+    JSCSSValue* jsCSSValue = jsCast<JSCSSValue*>(handle.get().asCell());
     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
     world->m_cssValueRoots.remove(jsCSSValue->impl());
     uncacheWrapper(world, jsCSSValue->impl(), jsCSSValue);
index c11f601..346c267 100644 (file)
@@ -160,7 +160,7 @@ void reportException(ExecState* exec, JSValue exception)
     if (ExceptionBase* exceptionBase = toExceptionBase(exception))
         errorMessage = stringToUString(exceptionBase->message() + ": "  + exceptionBase->description());
 
-    ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+    ScriptExecutionContext* scriptExecutionContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
 
     // scriptExecutionContext can be null when the relevant global object is a stale inner window object.
     // It's harmless to return here without reporting the exception to the log and the debugger in this case.
index 98746e9..aef89d2 100644 (file)
@@ -104,7 +104,7 @@ enum ParameterDefaultPolicy {
         // FIXME: Callers to this function should be using the global object
         // from which the object is being created, instead of assuming the lexical one.
         // e.g. subframe.document.body should use the subframe's global object, not the lexical one.
-        return static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
+        return JSC::jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     }
 
     template<class WrapperClass> inline JSC::Structure* getDOMStructure(JSC::ExecState* exec, JSDOMGlobalObject* globalObject)
@@ -122,7 +122,7 @@ enum ParameterDefaultPolicy {
 
     template<class WrapperClass> inline JSC::JSObject* getDOMPrototype(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject)
     {
-        return static_cast<JSC::JSObject*>(asObject(getDOMStructure<WrapperClass>(exec, static_cast<JSDOMGlobalObject*>(globalObject))->storedPrototype()));
+        return JSC::jsCast<JSC::JSObject*>(asObject(getDOMStructure<WrapperClass>(exec, JSC::jsCast<JSDOMGlobalObject*>(globalObject))->storedPrototype()));
     }
 
     // Overload these functions to provide a fast path for wrapper access.
index 65c1cf4..7be9332 100644 (file)
@@ -43,12 +43,12 @@ namespace WebCore {
 
 static HTMLFormElement* toHTMLFormElement(JSC::JSValue value)
 {
-    return value.inherits(&JSHTMLFormElement::s_info) ? static_cast<HTMLFormElement*>(static_cast<JSHTMLFormElement*>(asObject(value))->impl()) : 0;
+    return value.inherits(&JSHTMLFormElement::s_info) ? static_cast<HTMLFormElement*>(jsCast<JSHTMLFormElement*>(asObject(value))->impl()) : 0;
 }
 
 EncodedJSValue JSC_HOST_CALL JSDOMFormDataConstructor::constructJSDOMFormData(ExecState* exec)
 {
-    JSDOMFormDataConstructor* jsConstructor = static_cast<JSDOMFormDataConstructor*>(exec->callee());
+    JSDOMFormDataConstructor* jsConstructor = jsCast<JSDOMFormDataConstructor*>(exec->callee());
 
     HTMLFormElement* form = 0;
     if (exec->argumentCount() > 0)
index dcd4c5a..bd8a342 100644 (file)
@@ -35,7 +35,7 @@ bool JSDOMMimeTypeArray::canGetItemsForName(ExecState*, DOMMimeTypeArray* mimeTy
 
 JSValue JSDOMMimeTypeArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMMimeTypeArray* thisObj = static_cast<JSDOMMimeTypeArray*>(asObject(slotBase));
+    JSDOMMimeTypeArray* thisObj = jsCast<JSDOMMimeTypeArray*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
index 036a5a3..12a2d7a 100644 (file)
@@ -35,7 +35,7 @@ bool JSDOMPluginArray::canGetItemsForName(ExecState*, DOMPluginArray* pluginArra
 
 JSValue JSDOMPluginArray::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMPluginArray* thisObj = static_cast<JSDOMPluginArray*>(asObject(slotBase));
+    JSDOMPluginArray* thisObj = jsCast<JSDOMPluginArray*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
index 32b76ed..061da3a 100644 (file)
@@ -34,7 +34,7 @@ bool JSDOMPlugin::canGetItemsForName(ExecState*, DOMPlugin* plugin, const Identi
 
 JSValue JSDOMPlugin::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMPlugin* thisObj = static_cast<JSDOMPlugin*>(asObject(slotBase));
+    JSDOMPlugin* thisObj = jsCast<JSDOMPlugin*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->namedItem(identifierToAtomicString(propertyName)));
 }
 
index 7c599c5..56871c2 100644 (file)
@@ -42,7 +42,7 @@ bool JSDOMStringMap::canGetItemsForName(ExecState*, DOMStringMap* impl, const Id
 
 JSValue JSDOMStringMap::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMStringMap* thisObj = static_cast<JSDOMStringMap*>(asObject(slotBase));
+    JSDOMStringMap* thisObj = jsCast<JSDOMStringMap*>(asObject(slotBase));
     return jsString(exec, thisObj->impl()->item(identifierToAtomicString(propertyName)));
 }
 
index 160465f..39e0ec1 100644 (file)
@@ -237,9 +237,9 @@ JSDOMWindow* toJSDOMWindow(JSValue value)
         return 0;
     const ClassInfo* classInfo = asObject(value)->classInfo();
     if (classInfo == &JSDOMWindow::s_info)
-        return static_cast<JSDOMWindow*>(asObject(value));
+        return jsCast<JSDOMWindow*>(asObject(value));
     if (classInfo == &JSDOMWindowShell::s_info)
-        return static_cast<JSDOMWindowShell*>(asObject(value))->window();
+        return jsCast<JSDOMWindowShell*>(asObject(value))->window();
     return 0;
 }
 
index be551bf..4e9f206 100644 (file)
@@ -99,17 +99,17 @@ JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, const Identifie
 
 static JSValue childFrameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(identifierToAtomicString(propertyName))->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(identifierToAtomicString(propertyName))->domWindow());
 }
 
 static JSValue indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
 {
-    return toJS(exec, static_cast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(index)->domWindow());
+    return toJS(exec, jsCast<JSDOMWindow*>(asObject(slotBase))->impl()->frame()->tree()->scopedChild(index)->domWindow());
 }
 
 static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSDOMWindowBase* thisObj = static_cast<JSDOMWindow*>(asObject(slotBase));
+    JSDOMWindowBase* thisObj = jsCast<JSDOMWindow*>(asObject(slotBase));
     Document* document = thisObj->impl()->frame()->document();
 
     ASSERT(thisObj->allowsAccessFrom(exec));
@@ -663,9 +663,9 @@ DOMWindow* toDOMWindow(JSValue value)
         return 0;
     JSObject* object = asObject(value);
     if (object->inherits(&JSDOMWindow::s_info))
-        return static_cast<JSDOMWindow*>(object)->impl();
+        return jsCast<JSDOMWindow*>(object)->impl();
     if (object->inherits(&JSDOMWindowShell::s_info))
-        return static_cast<JSDOMWindowShell*>(object)->impl();
+        return jsCast<JSDOMWindowShell*>(object)->impl();
     return 0;
 }
 
index 7551fe4..57e8166 100644 (file)
@@ -28,7 +28,7 @@ namespace WebCore {
 
 inline JSDOMWindow* asJSDOMWindow(JSC::JSGlobalObject* globalObject)
 {
-    return static_cast<JSDOMWindow*>(globalObject);
+    return JSC::jsCast<JSDOMWindow*>(globalObject);
 }
  
 inline const JSDOMWindow* asJSDOMWindow(const JSC::JSGlobalObject* globalObject)
index b7c7501..f1e2739 100644 (file)
@@ -43,7 +43,7 @@ namespace WebCore {
         JSDOMWindowShell(PassRefPtr<DOMWindow>, JSC::Structure*, DOMWrapperWorld*);
         static void destroy(JSCell*);
 
-        JSDOMWindow* window() const { return static_cast<JSDOMWindow*>(m_unwrappedObject.get()); }
+        JSDOMWindow* window() const { return JSC::jsCast<JSDOMWindow*>(m_unwrappedObject.get()); }
         void setWindow(JSC::JSGlobalData& globalData, JSDOMWindow* window)
         {
             ASSERT_ARG(window, window);
index 74f156a..f0a8a3a 100644 (file)
@@ -33,7 +33,7 @@ class JSDOMWrapper : public JSC::JSNonFinalObject {
 public:
     JSDOMGlobalObject* globalObject() const
     {
-        return static_cast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject());
+        return JSC::jsCast<JSDOMGlobalObject*>(JSC::JSNonFinalObject::globalObject());
     }
 
     ScriptExecutionContext* scriptExecutionContext() const
index 87d4458..ab79c83 100644 (file)
@@ -58,7 +58,7 @@ EncodedJSValue JSC_HOST_CALL JSDataViewConstructor::constructJSDataView(ExecStat
         return JSValue::encode(jsUndefined());
     }
 
-    JSDataViewConstructor* jsConstructor = static_cast<JSDataViewConstructor*>(exec->callee());
+    JSDataViewConstructor* jsConstructor = jsCast<JSDataViewConstructor*>(exec->callee());
     return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), view.get())));
 }
 
index 5836900..fa996e5 100644 (file)
@@ -87,7 +87,7 @@ void JSEventListener::handleEvent(ScriptExecutionContext* scriptExecutionContext
 
     Frame* frame = 0;
     if (scriptExecutionContext->isDocument()) {
-        JSDOMWindow* window = static_cast<JSDOMWindow*>(globalObject);
+        JSDOMWindow* window = jsCast<JSDOMWindow*>(globalObject);
         frame = window->impl()->frame();
         if (!frame)
             return;
index 45fad7f..66e1576 100644 (file)
@@ -66,12 +66,12 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget* targ
 
 #define TRY_TO_UNWRAP_WITH_INTERFACE(interfaceName) \
     if (value.inherits(&JS##interfaceName::s_info)) \
-        return static_cast<interfaceName*>(static_cast<JS##interfaceName*>(asObject(value))->impl());
+        return static_cast<interfaceName*>(jsCast<JS##interfaceName*>(asObject(value))->impl());
 
 EventTarget* toEventTarget(JSC::JSValue value)
 {
     if (value.inherits(&JSDOMWindowShell::s_info))
-        return static_cast<JSDOMWindowShell*>(asObject(value))->impl();
+        return jsCast<JSDOMWindowShell*>(asObject(value))->impl();
 
     DOM_EVENT_TARGET_INTERFACES_FOR_EACH(TRY_TO_UNWRAP_WITH_INTERFACE)
     return 0;
index ed3b112..cade52e 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSFloat32Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSFloat32ArrayConstructor::constructJSFloat32Array(ExecState* exec)
 {
-    JSFloat32ArrayConstructor* jsConstructor = static_cast<JSFloat32ArrayConstructor*>(exec->callee());
+    JSFloat32ArrayConstructor* jsConstructor = jsCast<JSFloat32ArrayConstructor*>(exec->callee());
     RefPtr<Float32Array> array = constructArrayBufferView<Float32Array, float>(exec);
     if (!array.get())
         // Exception has already been thrown.
index fbd82b5..15619e3 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSFloat64Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSFloat64ArrayConstructor::constructJSFloat64Array(ExecState* exec)
 {
-    JSFloat64ArrayConstructor* jsConstructor = static_cast<JSFloat64ArrayConstructor*>(exec->callee());
+    JSFloat64ArrayConstructor* jsConstructor = jsCast<JSFloat64ArrayConstructor*>(exec->callee());
     RefPtr<Float64Array> array = constructArrayBufferView<Float64Array, double>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 8a91856..57fb180 100644 (file)
@@ -101,12 +101,12 @@ JSValue JSGeolocation::getCurrentPosition(ExecState* exec)
 {
     // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions
 
-    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<JSPositionCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0));
+    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<JSPositionCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0));
     if (exec->hadException())
         return jsUndefined();
     ASSERT(positionCallback);
 
-    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<JSPositionErrorCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1), CallbackAllowUndefined | CallbackAllowNull);
+    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<JSPositionErrorCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1), CallbackAllowUndefined | CallbackAllowNull);
     if (exec->hadException())
         return jsUndefined();
 
@@ -123,12 +123,12 @@ JSValue JSGeolocation::watchPosition(ExecState* exec)
 {
     // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions
 
-    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<JSPositionCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0));
+    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<JSPositionCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(0));
     if (exec->hadException())
         return jsUndefined();
     ASSERT(positionCallback);
 
-    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<JSPositionErrorCallback>(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1), CallbackAllowUndefined | CallbackAllowNull);
+    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<JSPositionErrorCallback>(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), exec->argument(1), CallbackAllowUndefined | CallbackAllowNull);
     if (exec->hadException())
         return jsUndefined();
 
index 3626cdc..f98c176 100644 (file)
@@ -64,7 +64,7 @@ static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
         return JSValue::encode(jsUndefined());
 
     // Do not use thisObj here. It can be the JSHTMLDocument, in the document.forms(i) case.
-    JSHTMLAllCollection* jsCollection = static_cast<JSHTMLAllCollection*>(exec->callee());
+    JSHTMLAllCollection* jsCollection = jsCast<JSHTMLAllCollection*>(exec->callee());
     HTMLAllCollection* collection = static_cast<HTMLAllCollection*>(jsCollection->impl());
 
     // Also, do we need the TypeError test here ?
@@ -106,7 +106,7 @@ bool JSHTMLAllCollection::canGetItemsForName(ExecState*, HTMLAllCollection* coll
 
 JSValue JSHTMLAllCollection::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLAllCollection* thisObj = static_cast<JSHTMLAllCollection*>(asObject(slotBase));
+    JSHTMLAllCollection* thisObj = jsCast<JSHTMLAllCollection*>(asObject(slotBase));
     return getNamedItems(exec, thisObj, propertyName);
 }
 
index d3f936f..74e924f 100644 (file)
@@ -65,7 +65,7 @@ bool JSHTMLCollection::canGetItemsForName(ExecState*, HTMLCollection* collection
 
 JSValue JSHTMLCollection::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLCollection* thisObj = static_cast<JSHTMLCollection*>(asObject(slotBase));
+    JSHTMLCollection* thisObj = jsCast<JSHTMLCollection*>(asObject(slotBase));
     return getNamedItems(exec, thisObj, propertyName);
 }
 
index e64e243..5d2e83c 100644 (file)
@@ -59,7 +59,7 @@ bool JSHTMLDocument::canGetItemsForName(ExecState*, HTMLDocument* document, cons
 
 JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(asObject(slotBase));
+    JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(asObject(slotBase));
     HTMLDocument* document = static_cast<HTMLDocument*>(thisObj->impl());
 
     HTMLCollection* collection = document->documentNamedItems(identifierToAtomicString(propertyName));
index 757b502..3087cd4 100644 (file)
@@ -46,7 +46,7 @@ bool JSHTMLFormElement::canGetItemsForName(ExecState*, HTMLFormElement* form, co
 
 JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slotBase));
+    JSHTMLElement* jsForm = jsCast<JSHTMLFormElement*>(asObject(slotBase));
     HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());
 
     Vector<RefPtr<Node> > namedItems;
index 07bac61..95093c9 100644 (file)
@@ -49,7 +49,7 @@ bool JSHTMLFrameSetElement::canGetItemsForName(ExecState*, HTMLFrameSetElement*
 
 JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    HTMLElement* element = static_cast<JSHTMLElement*>(asObject(slotBase))->impl();
+    HTMLElement* element = jsCast<JSHTMLElement*>(asObject(slotBase))->impl();
     Node* frameElement = element->children()->namedItem(identifierToAtomicString(propertyName));
     if (Document* document = static_cast<HTMLFrameElement*>(frameElement)->contentDocument()) {
         if (JSDOMWindowShell* window = toJSDOMWindowShell(document->frame(), currentWorld(exec)))
index d98602a..480b88a 100644 (file)
@@ -91,7 +91,7 @@ JSValue JSHTMLOptionsCollection::add(ExecState* exec)
 JSValue JSHTMLOptionsCollection::remove(ExecState* exec)
 {
     HTMLOptionsCollection* imp = static_cast<HTMLOptionsCollection*>(impl());
-    JSHTMLSelectElement* base = static_cast<JSHTMLSelectElement*>(asObject(toJS(exec, globalObject(), imp->base())));
+    JSHTMLSelectElement* base = jsCast<JSHTMLSelectElement*>(asObject(toJS(exec, globalObject(), imp->base())));
     return base->remove(exec);
 }
 
index 956c961..9a61160 100644 (file)
@@ -49,7 +49,7 @@ void JSImageConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* glob
 
 static EncodedJSValue JSC_HOST_CALL constructImage(ExecState* exec)
 {
-    JSImageConstructor* jsConstructor = static_cast<JSImageConstructor*>(exec->callee());
+    JSImageConstructor* jsConstructor = jsCast<JSImageConstructor*>(exec->callee());
     Document* document = jsConstructor->document();
     if (!document)
         return throwVMError(exec, createReferenceError(exec, "Image constructor associated document is unavailable"));
index 500737d..249993f 100644 (file)
@@ -54,7 +54,7 @@ ScriptObject InjectedScriptManager::createInjectedScript(const String& source, S
     JSLock lock(SilenceAssertionsOnly);
 
     SourceCode sourceCode = makeSource(stringToUString(source));
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     JSValue globalThisValue = scriptState->globalThisValue();
 
     JSValue evaluationException;
@@ -80,14 +80,14 @@ ScriptObject InjectedScriptManager::createInjectedScript(const String& source, S
 
 void InjectedScriptManager::discardInjectedScript(ScriptState* scriptState)
 {
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     globalObject->setInjectedScript(0);
 }
 
 InjectedScript InjectedScriptManager::injectedScriptFor(ScriptState* scriptState)
 {
     JSLock lock(SilenceAssertionsOnly);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     JSObject* injectedScript = globalObject->injectedScript();
     if (injectedScript)
         return InjectedScript(ScriptObject(scriptState, injectedScript), m_inspectedStateAccessCheck);
index 76aaba0..bc77a6d 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSInt16Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSInt16ArrayConstructor::constructJSInt16Array(ExecState* exec)
 {
-    JSInt16ArrayConstructor* jsConstructor = static_cast<JSInt16ArrayConstructor*>(exec->callee());
+    JSInt16ArrayConstructor* jsConstructor = jsCast<JSInt16ArrayConstructor*>(exec->callee());
     RefPtr<Int16Array> array = constructArrayBufferView<Int16Array, short>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 43390b1..d85287f 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSInt32Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSInt32ArrayConstructor::constructJSInt32Array(ExecState* exec)
 {
-    JSInt32ArrayConstructor* jsConstructor = static_cast<JSInt32ArrayConstructor*>(exec->callee());
+    JSInt32ArrayConstructor* jsConstructor = jsCast<JSInt32ArrayConstructor*>(exec->callee());
     RefPtr<Int32Array> array = constructArrayBufferView<Int32Array, int>(exec);
     if (!array.get())
         // Exception has already been thrown.
index bb7fe8a..b6e1507 100644 (file)
@@ -51,7 +51,7 @@ JSC::JSValue JSInt8Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSInt8ArrayConstructor::constructJSInt8Array(ExecState* exec)
 {
-    JSInt8ArrayConstructor* jsConstructor = static_cast<JSInt8ArrayConstructor*>(exec->callee());
+    JSInt8ArrayConstructor* jsConstructor = jsCast<JSInt8ArrayConstructor*>(exec->callee());
     RefPtr<Int8Array> array = constructArrayBufferView<Int8Array, signed char>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 4e30012..f11bf90 100644 (file)
@@ -104,7 +104,7 @@ JSObject* JSLazyEventListener::initializeJSFunction(ScriptExecutionContext* exec
         return 0;
     }
 
-    JSFunction* listenerAsFunction = static_cast<JSFunction*>(jsFunction);
+    JSFunction* listenerAsFunction = jsCast<JSFunction*>(jsFunction);
     if (m_originalNode) {
         if (!wrapper()) {
             // Ensure that 'node' has a JavaScript wrapper to mark the event listener we're creating.
@@ -115,7 +115,7 @@ JSObject* JSLazyEventListener::initializeJSFunction(ScriptExecutionContext* exec
 
         // Add the event's home element to the scope
         // (and the document, and the form - see JSHTMLElement::eventHandlerScope)
-        listenerAsFunction->setScope(exec->globalData(), static_cast<JSNode*>(wrapper())->pushEventHandlerScope(exec, listenerAsFunction->scope()));
+        listenerAsFunction->setScope(exec->globalData(), jsCast<JSNode*>(wrapper())->pushEventHandlerScope(exec, listenerAsFunction->scope()));
     }
 
     // Since we only parse once, there's no need to keep data used for parsing around anymore.
index 871f06a..b128032 100644 (file)
@@ -42,7 +42,7 @@ bool JSNamedNodeMap::canGetItemsForName(ExecState*, NamedNodeMap* impl, const Id
 
 JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSNamedNodeMap* thisObj = static_cast<JSNamedNodeMap*>(asObject(slotBase));
+    JSNamedNodeMap* thisObj = jsCast<JSNamedNodeMap*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->getNamedItem(identifierToString(propertyName)));
 }
 
index 7cdd5fc..394d0f3 100644 (file)
@@ -132,13 +132,13 @@ static inline bool isReachableFromDOM(JSNode* jsNode, Node* node, SlotVisitor& v
 
 bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSNode* jsNode = static_cast<JSNode*>(handle.get().asCell());
+    JSNode* jsNode = jsCast<JSNode*>(handle.get().asCell());
     return isReachableFromDOM(jsNode, jsNode->impl(), visitor);
 }
 
 void JSNodeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
 {
-    JSNode* jsNode = static_cast<JSNode*>(handle.get().asCell());
+    JSNode* jsNode = jsCast<JSNode*>(handle.get().asCell());
     DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
     uncacheWrapper(world, jsNode->impl(), jsNode);
     jsNode->releaseImpl();
index 518b21d..dd242e3 100644 (file)
@@ -61,7 +61,7 @@ inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject,
     if (!node)
         return JSC::jsNull();
 
-    JSNode* wrapper = static_cast<JSNode*>(getCachedWrapper(currentWorld(exec), node));
+    JSNode* wrapper = JSC::jsCast<JSNode*>(getCachedWrapper(currentWorld(exec), node));
     if (wrapper)
         return wrapper;
 
index f402342..3d9cf3d 100644 (file)
@@ -49,7 +49,7 @@ void JSNodeFilter::visitChildren(JSCell* cell, SlotVisitor& visitor)
 PassRefPtr<NodeFilter> toNodeFilter(JSGlobalData& globalData, JSValue value)
 {
     if (value.inherits(&JSNodeFilter::s_info))
-        return static_cast<JSNodeFilter*>(asObject(value))->impl();
+        return jsCast<JSNodeFilter*>(asObject(value))->impl();
 
     RefPtr<NodeFilter> result = NodeFilter::create();
     result->setCondition(JSNodeFilterCondition::create(globalData, result.get(), value));
index 5602d24..725e053 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 
 bool JSNodeListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSNodeList* jsNodeList = static_cast<JSNodeList*>(handle.get().asCell());
+    JSNodeList* jsNodeList = jsCast<JSNodeList*>(handle.get().asCell());
     if (!jsNodeList->hasCustomProperties())
         return false;
     if (!jsNodeList->impl()->isDynamicNodeList())
@@ -53,7 +53,7 @@ bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, const Identifier
 
 JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSNodeList* thisObj = static_cast<JSNodeList*>(asObject(slotBase));
+    JSNodeList* thisObj = jsCast<JSNodeList*>(asObject(slotBase));
     return toJS(exec, thisObj->globalObject(), thisObj->impl()->itemWithName(identifierToAtomicString(propertyName)));
 }
 
index 2d6553a..83819e3 100644 (file)
@@ -102,7 +102,7 @@ JSObject* pluginScriptObject(ExecState* exec, JSHTMLElement* jsHTMLElement)
     
 JSValue runtimeObjectPropertyGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSHTMLElement* element = static_cast<JSHTMLElement*>(asObject(slotBase));
+    JSHTMLElement* element = jsCast<JSHTMLElement*>(asObject(slotBase));
     JSObject* scriptObject = pluginScriptObject(exec, element);
     if (!scriptObject)
         return jsUndefined();
@@ -151,7 +151,7 @@ bool runtimeObjectCustomPut(ExecState* exec, const Identifier& propertyName, JSV
 
 static EncodedJSValue JSC_HOST_CALL callPlugin(ExecState* exec)
 {
-    JSHTMLElement* element = static_cast<JSHTMLElement*>(exec->callee());
+    JSHTMLElement* element = jsCast<JSHTMLElement*>(exec->callee());
 
     // Get the plug-in script object.
     JSObject* scriptObject = pluginScriptObject(exec, element);
index f01f84b..3de2807 100644 (file)
@@ -70,7 +70,7 @@ JSValue JSPopStateEvent::state(ExecState* exec) const
     JSValue result;
 
     if (isSameState) {
-        JSHistory* jsHistory = static_cast<JSHistory*>(toJS(exec, globalObject(), history).asCell());
+        JSHistory* jsHistory = jsCast<JSHistory*>(toJS(exec, globalObject(), history).asCell());
         result = jsHistory->state(exec);
     } else
         result = event->serializedState()->deserialize(exec, globalObject(), 0);
index 30aae1b..a3c198f 100644 (file)
@@ -96,7 +96,7 @@ JSValue JSSQLTransaction::executeSql(ExecState* exec)
             return jsUndefined();
         }
 
-        callback = JSSQLStatementCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
+        callback = JSSQLStatementCallback::create(object, jsCast<JSDOMGlobalObject*>(globalObject()));
     }
 
     RefPtr<SQLStatementErrorCallback> errorCallback;
@@ -107,7 +107,7 @@ JSValue JSSQLTransaction::executeSql(ExecState* exec)
             return jsUndefined();
         }
 
-        errorCallback = JSSQLStatementErrorCallback::create(object, static_cast<JSDOMGlobalObject*>(globalObject()));
+        errorCallback = JSSQLStatementErrorCallback::create(object, jsCast<JSDOMGlobalObject*>(globalObject()));
     }
 
     ExceptionCode ec = 0;
index fb8dc18..2827bbf 100644 (file)
@@ -57,7 +57,7 @@ void JSSharedWorker::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(ExecState* exec)
 {
-    JSSharedWorkerConstructor* jsConstructor = static_cast<JSSharedWorkerConstructor*>(exec->callee());
+    JSSharedWorkerConstructor* jsConstructor = jsCast<JSSharedWorkerConstructor*>(exec->callee());
 
     if (exec->argumentCount() < 1)
         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
index 31be269..a4b9089 100644 (file)
@@ -41,7 +41,7 @@ bool JSStorage::canGetItemsForName(ExecState*, Storage* impl, const Identifier&
 
 JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSStorage* thisObj = static_cast<JSStorage*>(asObject(slotBase));
+    JSStorage* thisObj = jsCast<JSStorage*>(asObject(slotBase));
     return jsStringOrNull(exec, thisObj->impl()->getItem(identifierToString(propertyName)));
 }
 
index a2c8b67..c05eef5 100644 (file)
@@ -42,7 +42,7 @@ bool JSStyleSheetList::canGetItemsForName(ExecState*, StyleSheetList* styleSheet
 
 JSValue JSStyleSheetList::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
 {
-    JSStyleSheetList* thisObj = static_cast<JSStyleSheetList*>(asObject(slotBase));
+    JSStyleSheetList* thisObj = jsCast<JSStyleSheetList*>(asObject(slotBase));
     HTMLStyleElement* element = thisObj->impl()->getNamedItem(identifierToString(propertyName));
     ASSERT(element);
     return toJS(exec, thisObj->globalObject(), element->sheet());
index c6de15f..5dd9dca 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 bool JSTextTrackCueOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSTextTrackCue* jsTextTrackCue = static_cast<JSTextTrackCue*>(handle.get().asCell());
+    JSTextTrackCue* jsTextTrackCue = jsCast<JSTextTrackCue*>(handle.get().asCell());
     TextTrackCue* textTrackCue = static_cast<TextTrackCue*>(jsTextTrackCue->impl());
 
     // If the cue is firing event listeners, its wrapper is reachable because
index 613bbe3..5d64124 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 bool JSTextTrackOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSTextTrack* jsTextTrack = static_cast<JSTextTrack*>(handle.get().asCell());
+    JSTextTrack* jsTextTrack = jsCast<JSTextTrack*>(handle.get().asCell());
     TextTrack* textTrack = static_cast<TextTrack*>(jsTextTrack->impl());
 
     // If the cue is firing event listeners, its wrapper is reachable because
index 8fc1e56..a967fe1 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 bool JSTextTrackListOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
 {
-    JSTextTrackList* jsTextTrackList = static_cast<JSTextTrackList*>(handle.get().asCell());
+    JSTextTrackList* jsTextTrackList = jsCast<JSTextTrackList*>(handle.get().asCell());
     TextTrackList* textTrackList = static_cast<TextTrackList*>(jsTextTrackList->impl());
 
     // If the list is firing event listeners, its wrapper is reachable because
index 1d9ca00..7b97945 100644 (file)
@@ -42,7 +42,7 @@ TrackBase* toTrack(JSValue value)
 
     JSObject* object = asObject(value);
     if (object->inherits(&JSTextTrack::s_info))
-        return static_cast<JSTextTrack*>(object)->impl();
+        return jsCast<JSTextTrack*>(object)->impl();
     
     // FIXME: Fill in additional tests and casts here for VideoTrack and AudioTrack when 
     // they have been added to WebCore.
index a21d351..47b4402 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSUint16Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSUint16ArrayConstructor::constructJSUint16Array(ExecState* exec)
 {
-    JSUint16ArrayConstructor* jsConstructor = static_cast<JSUint16ArrayConstructor*>(exec->callee());
+    JSUint16ArrayConstructor* jsConstructor = jsCast<JSUint16ArrayConstructor*>(exec->callee());
     RefPtr<Uint16Array> array = constructArrayBufferView<Uint16Array, unsigned short>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 8288044..aa8b826 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSUint32Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSUint32ArrayConstructor::constructJSUint32Array(ExecState* exec)
 {
-    JSUint32ArrayConstructor* jsConstructor = static_cast<JSUint32ArrayConstructor*>(exec->callee());
+    JSUint32ArrayConstructor* jsConstructor = jsCast<JSUint32ArrayConstructor*>(exec->callee());
     RefPtr<Uint32Array> array = constructArrayBufferView<Uint32Array, unsigned int>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 0b28647..6a4fa1d 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSUint8Array::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSUint8ArrayConstructor::constructJSUint8Array(ExecState* exec)
 {
-    JSUint8ArrayConstructor* jsConstructor = static_cast<JSUint8ArrayConstructor*>(exec->callee());
+    JSUint8ArrayConstructor* jsConstructor = jsCast<JSUint8ArrayConstructor*>(exec->callee());
     RefPtr<Uint8Array> array = constructArrayBufferView<Uint8Array, unsigned char>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 1566d04..2d5ca78 100644 (file)
@@ -50,7 +50,7 @@ JSC::JSValue JSUint8ClampedArray::set(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSUint8ClampedArrayConstructor::constructJSUint8ClampedArray(ExecState* exec)
 {
-    JSUint8ClampedArrayConstructor* jsConstructor = static_cast<JSUint8ClampedArrayConstructor*>(exec->callee());
+    JSUint8ClampedArrayConstructor* jsConstructor = jsCast<JSUint8ClampedArrayConstructor*>(exec->callee());
     RefPtr<Uint8ClampedArray> array = constructArrayBufferView<Uint8ClampedArray, unsigned char>(exec);
     if (!array.get())
         // Exception has already been thrown.
index 455f4d4..adfcf07 100644 (file)
@@ -59,7 +59,7 @@ EncodedJSValue JSC_HOST_CALL JSWebKitMutationObserverConstructor::constructJSWeb
         return JSValue::encode(jsUndefined());
     }
 
-    JSWebKitMutationObserverConstructor* jsConstructor = static_cast<JSWebKitMutationObserverConstructor*>(exec->callee());
+    JSWebKitMutationObserverConstructor* jsConstructor = jsCast<JSWebKitMutationObserverConstructor*>(exec->callee());
     RefPtr<MutationCallback> callback = JSMutationCallback::create(object, jsConstructor->globalObject());
     return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), WebKitMutationObserver::create(callback.release()))));
 }
index e1b20ce..aa14e65 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 
 EncodedJSValue JSC_HOST_CALL JSWebKitPointConstructor::constructJSWebKitPoint(ExecState* exec)
 {
-    JSWebKitPointConstructor* jsConstructor = static_cast<JSWebKitPointConstructor*>(exec->callee());
+    JSWebKitPointConstructor* jsConstructor = jsCast<JSWebKitPointConstructor*>(exec->callee());
 
     float x = 0;
     float y = 0;
index c8e0069..71ad57a 100644 (file)
@@ -52,7 +52,7 @@ namespace WebCore {
 
 EncodedJSValue JSC_HOST_CALL JSWebSocketConstructor::constructJSWebSocket(ExecState* exec)
 {
-    JSWebSocketConstructor* jsConstructor = static_cast<JSWebSocketConstructor*>(exec->callee());
+    JSWebSocketConstructor* jsConstructor = jsCast<JSWebSocketConstructor*>(exec->callee());
     ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
     if (!context)
         return throwVMError(exec, createReferenceError(exec, "WebSocket constructor associated document is unavailable"));
index e79c6e4..2c13a9d 100644 (file)
@@ -93,7 +93,7 @@ JSDedicatedWorkerContext* toJSDedicatedWorkerContext(JSValue value)
         return 0;
     const ClassInfo* classInfo = asObject(value)->classInfo();
     if (classInfo == &JSDedicatedWorkerContext::s_info)
-        return static_cast<JSDedicatedWorkerContext*>(asObject(value));
+        return jsCast<JSDedicatedWorkerContext*>(asObject(value));
     return 0;
 }
 
@@ -104,7 +104,7 @@ JSSharedWorkerContext* toJSSharedWorkerContext(JSValue value)
         return 0;
     const ClassInfo* classInfo = asObject(value)->classInfo();
     if (classInfo == &JSSharedWorkerContext::s_info)
-        return static_cast<JSSharedWorkerContext*>(asObject(value));
+        return jsCast<JSSharedWorkerContext*>(asObject(value));
     return 0;
 }
 #endif
index ca0f761..70bd887 100644 (file)
@@ -52,7 +52,7 @@ JSC::JSValue JSWorker::webkitPostMessage(JSC::ExecState* exec)
 
 EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
 {
-    JSWorkerConstructor* jsConstructor = static_cast<JSWorkerConstructor*>(exec->callee());
+    JSWorkerConstructor* jsConstructor = jsCast<JSWorkerConstructor*>(exec->callee());
 
     if (!exec->argumentCount())
         return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
index da80097..70b6980 100644 (file)
@@ -50,7 +50,7 @@ JSValue JSXSLTProcessor::importStylesheet(ExecState* exec)
 {
     JSValue nodeVal = exec->argument(0);
     if (nodeVal.inherits(&JSNode::s_info)) {
-        JSNode* node = static_cast<JSNode*>(asObject(nodeVal));
+        JSNode* node = jsCast<JSNode*>(asObject(nodeVal));
         impl()->importStylesheet(node->impl());
         return jsUndefined();
     }
@@ -63,8 +63,8 @@ JSValue JSXSLTProcessor::transformToFragment(ExecState* exec)
     JSValue nodeVal = exec->argument(0);
     JSValue docVal = exec->argument(1);
     if (nodeVal.inherits(&JSNode::s_info) && docVal.inherits(&JSDocument::s_info)) {
-        WebCore::Node* node = static_cast<JSNode*>(asObject(nodeVal))->impl();
-        Document* doc = static_cast<Document*>(static_cast<JSDocument*>(asObject(docVal))->impl());
+        WebCore::Node* node = jsCast<JSNode*>(asObject(nodeVal))->impl();
+        Document* doc = static_cast<Document*>(jsCast<JSDocument*>(asObject(docVal))->impl());
         return toJS(exec, globalObject(), impl()->transformToFragment(node, doc).get());
     }
     // Throw exception?
@@ -75,7 +75,7 @@ JSValue JSXSLTProcessor::transformToDocument(ExecState* exec)
 {
     JSValue nodeVal = exec->argument(0);
     if (nodeVal.inherits(&JSNode::s_info)) {
-        JSNode* node = static_cast<JSNode*>(asObject(nodeVal));
+        JSNode* node = jsCast<JSNode*>(asObject(nodeVal));
         RefPtr<Document> resultDocument = impl()->transformToDocument(node->impl());
         if (resultDocument)
             return toJS(exec, globalObject(), resultDocument.get());
index 63ebe62..ccf673f 100644 (file)
@@ -90,7 +90,7 @@ PassRefPtr<ScriptCallStack> createScriptCallStackForInspector(JSC::ExecState* ex
 {
     size_t maxStackSize = 1;
     if (InspectorInstrumentation::hasFrontends()) {
-        ScriptExecutionContext* scriptExecutionContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+        ScriptExecutionContext* scriptExecutionContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
         if (InspectorInstrumentation::hasFrontendForScriptContext(scriptExecutionContext))
             maxStackSize = ScriptCallStack::maxCallStackSizeToCapture;
     }
index f7ad3ff..50a5a7e 100644 (file)
@@ -148,7 +148,7 @@ static void updateStyleIfNeededForBindings(JSC::ExecState*, JSC::JSObject* rootO
     if (!rootObject)
         return;
 
-    JSDOMWindow* window = static_cast<JSDOMWindow*>(rootObject);
+    JSDOMWindow* window = JSC::jsCast<JSDOMWindow*>(rootObject);
     if (!window)
         return;
 
index 10ded70..1d6117c 100644 (file)
@@ -211,7 +211,7 @@ void ScriptDebugServer::dispatchDidPause(ScriptDebugListener* listener)
     JSValue jsCallFrame;
     {
         if (m_currentCallFrame->isValid() && globalObject->inherits(&JSDOMGlobalObject::s_info)) {
-            JSDOMGlobalObject* domGlobalObject = static_cast<JSDOMGlobalObject*>(globalObject);
+            JSDOMGlobalObject* domGlobalObject = jsCast<JSDOMGlobalObject*>(globalObject);
             JSLock lock(SilenceAssertionsOnly);
             jsCallFrame = toJS(state, domGlobalObject, m_currentCallFrame.get());
         } else
index 6760e47..1fcd9cb 100644 (file)
@@ -70,7 +70,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, const S
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InspectorFrontendHost* value)
 {
     JSLock lock(SilenceAssertionsOnly);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     globalObject->putDirect(scriptState->globalData(), Identifier(scriptState, name), toJS(scriptState, globalObject, value));
     return handleException(scriptState);
 }
@@ -78,7 +78,7 @@ bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, Inspect
 bool ScriptGlobalObject::set(ScriptState* scriptState, const char* name, InjectedScriptHost* value)
 {
     JSLock lock(SilenceAssertionsOnly);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
     globalObject->putDirect(scriptState->globalData(), Identifier(scriptState, name), toJS(scriptState, globalObject, value));
     return handleException(scriptState);
 }
index eb66bdc..780ca4d 100644 (file)
@@ -68,7 +68,7 @@ DOMWindow* domWindowFromScriptState(ScriptState* scriptState)
     JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
     if (!globalObject->inherits(&JSDOMWindowBase::s_info))
         return 0;
-    return static_cast<JSDOMWindowBase*>(globalObject)->impl();
+    return JSC::jsCast<JSDOMWindowBase*>(globalObject)->impl();
 }
 
 ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState* scriptState)
@@ -76,7 +76,7 @@ ScriptExecutionContext* scriptExecutionContextFromScriptState(ScriptState* scrip
     JSC::JSGlobalObject* globalObject = scriptState->lexicalGlobalObject();
     if (!globalObject->inherits(&JSDOMGlobalObject::s_info))
         return 0;
-    return static_cast<JSDOMGlobalObject*>(globalObject)->scriptExecutionContext();
+    return JSC::jsCast<JSDOMGlobalObject*>(globalObject)->scriptExecutionContext();
 }
 
 bool evalEnabled(ScriptState* scriptState)
index b259290..316408b 100644 (file)
@@ -370,7 +370,7 @@ private:
     {
         if (!input)
             return;
-        JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject());
+        JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject());
         for (size_t i = 0; i < input->size(); i++) {
             JSC::JSValue value = toJS(m_exec, globalObject, input->at(i).get());
             JSC::JSObject* obj = value.getObject();
@@ -539,7 +539,7 @@ private:
             code = ValidationError;
             return true;
         }
-        JSValue bufferObj = toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), arrayBuffer.get());
+        JSValue bufferObj = toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject()), arrayBuffer.get());
         return dumpIfTerminal(bufferObj, code);
     }
 
@@ -1350,7 +1350,7 @@ private:
     template<class T>
     JSValue getJSValue(T* nativeObj)
     {
-        return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), nativeObj);
+        return toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), nativeObj);
     }
 
     JSValue readTerminal()
@@ -1393,7 +1393,7 @@ private:
                 return JSValue();
             if (!m_isDOMGlobalObject)
                 return jsNull();
-            return toJS(m_exec, static_cast<JSDOMGlobalObject*>(m_globalObject), file.get());
+            return toJS(m_exec, jsCast<JSDOMGlobalObject*>(m_globalObject), file.get());
         }
         case FileListTag: {
             unsigned length = 0;
index d0df7bf..aeef941 100644 (file)
@@ -221,7 +221,7 @@ static void _didExecute(WebScriptObject *obj)
     if (!_private->originRootObject->isValid())
         return false;
 
-    return static_cast<JSDOMWindowBase*>(root->globalObject())->allowsAccessFrom(_private->originRootObject->globalObject());
+    return jsCast<JSDOMWindowBase*>(root->globalObject())->allowsAccessFrom(_private->originRootObject->globalObject());
 }
 
 - (void)dealloc
@@ -519,7 +519,7 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
 
         if (object->inherits(&JSHTMLElement::s_info)) {
             // Plugin elements cache the instance internally.
-            HTMLElement* el = static_cast<JSHTMLElement*>(object)->impl();
+            HTMLElement* el = jsCast<JSHTMLElement*>(object)->impl();
             ObjcInstance* instance = static_cast<ObjcInstance*>(pluginInstance(el));
             if (instance)
                 return instance->getObject();
index f77878c..4ece20a 100644 (file)
@@ -392,7 +392,7 @@ sub GenerateGetOwnPropertySlotBody
 
     if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
         push(@getOwnPropertySlotImpl, "    ${namespaceMaybe}JSValue proto = thisObject->prototype();\n");
-        push(@getOwnPropertySlotImpl, "    if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n");
+        push(@getOwnPropertySlotImpl, "    if (proto.isObject() && jsCast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n");
         push(@getOwnPropertySlotImpl, "        return false;\n\n");
     }
 
@@ -484,7 +484,7 @@ sub GenerateGetOwnPropertyDescriptorBody
     
     if ($interfaceName eq "NamedNodeMap" or $interfaceName eq "HTMLCollection" or $interfaceName eq "HTMLAllCollection") {
         push(@getOwnPropertyDescriptorImpl, "    ${namespaceMaybe}JSValue proto = thisObject->prototype();\n");
-        push(@getOwnPropertyDescriptorImpl, "    if (proto.isObject() && static_cast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n");
+        push(@getOwnPropertyDescriptorImpl, "    if (proto.isObject() && jsCast<${namespaceMaybe}JSObject*>(asObject(proto))->hasProperty(exec, propertyName))\n");
         push(@getOwnPropertyDescriptorImpl, "        return false;\n\n");
     }
     
@@ -1676,7 +1676,7 @@ sub GenerateImplementation
 
                 push(@implContent, "JSValue ${getFunctionName}(ExecState* exec, JSValue slotBase, const Identifier&)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* castedThis = static_cast<$className*>(asObject(slotBase));\n");
+                push(@implContent, "    ${className}* castedThis = jsCast<$className*>(asObject(slotBase));\n");
 
                 if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
                     $needsMarkChildren = 1;
@@ -1795,7 +1795,7 @@ sub GenerateImplementation
 
                 push(@implContent, "JSValue ${constructorFunctionName}(ExecState* exec, JSValue slotBase, const Identifier&)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* domObject = static_cast<$className*>(asObject(slotBase));\n");
+                push(@implContent, "    ${className}* domObject = jsCast<$className*>(asObject(slotBase));\n");
 
                 if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
                     push(@implContent, "    if (!domObject->allowsAccessFrom(exec))\n");
@@ -1870,19 +1870,19 @@ sub GenerateImplementation
 
                         if ($dataNode->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
                             if ($interfaceName eq "DOMWindow") {
-                                push(@implContent, "    if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
+                                push(@implContent, "    if (!jsCast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
                             } else {
-                                push(@implContent, "    if (!shouldAllowAccessToFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
+                                push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n");
                             }
                             push(@implContent, "        return;\n");
                         }
 
                         if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomSetter"} || $attribute->signature->extendedAttributes->{"JSCustomSetter"}) {
-                            push(@implContent, "    static_cast<$className*>(thisObject)->set$implSetterFunctionName(exec, value);\n");
+                            push(@implContent, "    jsCast<$className*>(thisObject)->set$implSetterFunctionName(exec, value);\n");
                         } elsif ($type eq "EventListener") {
                             $implIncludes{"JSEventListener.h"} = 1;
                             push(@implContent, "    UNUSED_PARAM(exec);\n");
-                            push(@implContent, "    ${className}* castedThis = static_cast<${className}*>(thisObject);\n");
+                            push(@implContent, "    ${className}* castedThis = jsCast<${className}*>(thisObject);\n");
                             my $windowEventListener = $attribute->signature->extendedAttributes->{"JSWindowEventListener"};
                             if ($windowEventListener) {
                                 push(@implContent, "    JSDOMGlobalObject* globalObject = castedThis->globalObject();\n");
@@ -1906,15 +1906,15 @@ sub GenerateImplementation
                             push(@implContent, "    // Shadowing a built-in constructor\n");
                             if ($interfaceName eq "DOMWindow" && $className eq "JSblah") {
                                 # FIXME: This branch never executes and should be removed.
-                                push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n");
+                                push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n");
                             } else {
-                                push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
+                                push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
                             }
                         } elsif ($attribute->signature->extendedAttributes->{"Replaceable"}) {
                             push(@implContent, "    // Shadowing a built-in object\n");
-                            push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
+                            push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), Identifier(exec, \"$name\"), value);\n");
                         } else {
-                            push(@implContent, "    $className* castedThis = static_cast<$className*>(thisObject);\n");
+                            push(@implContent, "    $className* castedThis = jsCast<$className*>(thisObject);\n");
                             push(@implContent, "    $implType* impl = static_cast<$implType*>(castedThis->impl());\n");
                             push(@implContent, "    ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
 
@@ -1995,9 +1995,9 @@ sub GenerateImplementation
                 push(@implContent, "{\n");
                 if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
                     if ($interfaceName eq "DOMWindow") {
-                        push(@implContent, "    if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
+                        push(@implContent, "    if (!jsCast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
                     } else {
-                        push(@implContent, "    if (!shouldAllowAccessToFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
+                        push(@implContent, "    if (!shouldAllowAccessToFrame(exec, jsCast<$className*>(thisObject)->impl()->frame()))\n");
                     }
                     push(@implContent, "        return;\n");
                 }
@@ -2005,7 +2005,7 @@ sub GenerateImplementation
                 push(@implContent, "    // Shadowing a built-in constructor\n");
 
                 if ($interfaceName eq "DOMWindow") {
-                    push(@implContent, "    static_cast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n");
+                    push(@implContent, "    jsCast<$className*>(thisObject)->putDirect(exec->globalData(), exec->propertyNames().constructor, value);\n");
                 } else {
                     die "No way to handle interface with ReplaceableConstructor extended attribute: $interfaceName";
                 }
@@ -2029,7 +2029,7 @@ sub GenerateImplementation
 
     if (!$dataNode->extendedAttributes->{"OmitConstructor"}) {
         push(@implContent, "JSValue ${className}::getConstructor(ExecState* exec, JSGlobalObject* globalObject)\n{\n");
-        push(@implContent, "    return getDOMConstructor<${className}Constructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));\n");
+        push(@implContent, "    return getDOMConstructor<${className}Constructor>(exec, jsCast<JSDOMGlobalObject*>(globalObject));\n");
         push(@implContent, "}\n\n");
     }
 
@@ -2095,7 +2095,7 @@ sub GenerateImplementation
                     push(@implContent, "    JSValue thisValue = exec->hostThisValue();\n");
                     push(@implContent, "    if (!thisValue.inherits(&${className}::s_info))\n");
                     push(@implContent, "        return throwVMTypeError(exec);\n");
-                    push(@implContent, "    $className* castedThis = static_cast<$className*>(asObject(thisValue));\n");
+                    push(@implContent, "    $className* castedThis = jsCast<$className*>(asObject(thisValue));\n");
                 }
 
                 push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(castedThis, &${className}::s_info);\n");
@@ -2213,7 +2213,7 @@ sub GenerateImplementation
     if ($dataNode->extendedAttributes->{"IndexedGetter"}) {
         push(@implContent, "\nJSValue ${className}::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}* thisObj = static_cast<$className*>(asObject(slotBase));\n");
+        push(@implContent, "    ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);\n");
         if (IndexGetterReturnsStrings($implClassName)) {
             $implIncludes{"KURL.h"} = 1;
@@ -2252,7 +2252,7 @@ sub GenerateImplementation
             push(@implContent, "}\n\n");
             push(@implContent, "JSValue ${className}::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObj = static_cast<$className*>(asObject(slotBase));\n");
+            push(@implContent, "    ${className}* thisObj = jsCast<$className*>(asObject(slotBase));\n");
             push(@implContent, "    return toJS(exec, thisObj->globalObject(), static_cast<$implClassName*>(thisObj->impl())->namedItem(identifierToAtomicString(propertyName)));\n");
             push(@implContent, "}\n\n");
         }
@@ -2272,7 +2272,7 @@ sub GenerateImplementation
 
         push(@implContent, "bool JS${implClassName}Owner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    JS${implClassName}* js${implClassName} = static_cast<JS${implClassName}*>(handle.get().asCell());\n");
+        push(@implContent, "    JS${implClassName}* js${implClassName} = jsCast<JS${implClassName}*>(handle.get().asCell());\n");
         # All ActiveDOMObjects implement hasPendingActivity(), but not all of them
         # increment their C++ reference counts when hasPendingActivity() becomes
         # true. As a result, ActiveDOMObjects can be prematurely destroyed before
@@ -2329,7 +2329,7 @@ sub GenerateImplementation
          $dataNode->extendedAttributes->{"ActiveDOMObject"})) {
         push(@implContent, "void JS${implClassName}Owner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    JS${implClassName}* js${implClassName} = static_cast<JS${implClassName}*>(handle.get().asCell());\n");
+        push(@implContent, "    JS${implClassName}* js${implClassName} = jsCast<JS${implClassName}*>(handle.get().asCell());\n");
         push(@implContent, "    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);\n");
         push(@implContent, "    uncacheWrapper(world, js${implClassName}->impl(), js${implClassName});\n");
         push(@implContent, "    js${implClassName}->releaseImpl();\n");
@@ -2350,7 +2350,7 @@ sub GenerateImplementation
     if ((!$hasParent or $dataNode->extendedAttributes->{"JSGenerateToNativeObject"}) and !$dataNode->extendedAttributes->{"JSCustomToNativeObject"}) {
         push(@implContent, "$implType* to${interfaceName}(JSC::JSValue value)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    return value.inherits(&${className}::s_info) ? static_cast<$className*>(asObject(value))->impl() : 0");
+        push(@implContent, "    return value.inherits(&${className}::s_info) ? jsCast<$className*>(asObject(value))->impl() : 0");
         push(@implContent, ";\n}\n");
     }
 
@@ -2373,7 +2373,7 @@ sub GenerateCallWith
         push(@callWithArgs, "exec");
     }
     if ($codeGenerator->ExtendedAttributeContains($callWith, "ScriptExecutionContext")) {
-        push(@$outputArray, "    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
+        push(@$outputArray, "    ScriptExecutionContext* scriptContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
         push(@$outputArray, "    if (!scriptContext)\n");
         push(@$outputArray, "        return" . ($returnValue ? " " . $returnValue : "") . ";\n");
         push(@callWithArgs, "scriptContext");
@@ -3081,7 +3081,7 @@ sub NativeToJSValue
     if ($globalObject) {
         return "toJS(exec, $globalObject, WTF::getPtr($value))";
     } else {
-        return "toJS(exec, static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), WTF::getPtr($value))";
+        return "toJS(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), WTF::getPtr($value))";
     }
 }
 
@@ -3483,12 +3483,12 @@ sub GenerateConstructorDefinition
 
         push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
         push(@$outputArray, "{\n");
-        push(@$outputArray, "    return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, static_cast<${constructorClassName}*>(cell), propertyName, slot);\n");
+        push(@$outputArray, "    return getStatic${kind}Slot<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, jsCast<${constructorClassName}*>(cell), propertyName, slot);\n");
         push(@$outputArray, "}\n\n");
 
         push(@$outputArray, "bool ${constructorClassName}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
         push(@$outputArray, "{\n");
-        push(@$outputArray, "    return getStatic${kind}Descriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, static_cast<${constructorClassName}*>(object), propertyName, descriptor);\n");
+        push(@$outputArray, "    return getStatic${kind}Descriptor<${constructorClassName}, JSDOMWrapper>(exec, &${constructorClassName}Table, jsCast<${constructorClassName}*>(object), propertyName, descriptor);\n");
         push(@$outputArray, "}\n\n");
     }
 
@@ -3500,7 +3500,7 @@ sub GenerateConstructorDefinition
             push(@$outputArray, <<END);
 EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec)
 {
-    ${constructorClassName}* jsConstructor = static_cast<${constructorClassName}*>(exec->callee());
+    ${constructorClassName}* jsConstructor = jsCast<${constructorClassName}*>(exec->callee());
 
     ScriptExecutionContext* executionContext = jsConstructor->scriptExecutionContext();
     if (!executionContext)
@@ -3561,7 +3561,7 @@ END
             push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* exec)\n");
             push(@$outputArray, "{\n");
 
-            push(@$outputArray, "    ${constructorClassName}* castedThis = static_cast<${constructorClassName}*>(exec->callee());\n");
+            push(@$outputArray, "    ${constructorClassName}* castedThis = jsCast<${constructorClassName}*>(exec->callee());\n");
 
             my $function = $dataNode->constructor;
             my @constructorArgList;
index d91473f..174f163 100644 (file)
@@ -33,7 +33,7 @@
 #include <wtf/RefPtr.h>
 
 #define jlong_to_ptr(a) ((void*)(uintptr_t)(a))
-#define jlong_to_impptr(a) (static_cast<JSC::JSObject*>(((void*)(uintptr_t)(a))))
+#define jlong_to_impptr(a) (JSC::jsCast<JSC::JSObject*>((static_cast<JSCell*>((void*)(uintptr_t)(a)))))
 #define ptr_to_jlong(a) ((jlong)(uintptr_t)(a))
 
 #if PLATFORM(MAC)
index e0b5dbd..e56c322 100644 (file)
@@ -576,7 +576,7 @@ JSValue JavaJSObject::convertJObjectToValue(ExecState* exec, jobject theObject)
     jlong nativeHandle = env->GetLongField(theObject, fieldID);
     if (nativeHandle == UndefinedHandle)
         return jsUndefined();
-    JSObject *imp = static_cast<JSObject*>(jlong_to_impptr(nativeHandle));
+    JSObject *imp = jsCast<JSObject*>(jlong_to_impptr(nativeHandle));
     return imp;
 }
 
index c942719..6af2da5 100644 (file)
@@ -245,7 +245,7 @@ JSValue JavaInstance::invokeMethod(ExecState* exec, RuntimeMethod* runtimeMethod
                         // and so it does between different versions of LiveConnect spec. There should not be multiple code paths to do the same work.
                         if (nativeHandle == 1 /* UndefinedHandle */)
                             return jsUndefined();
-                        return static_cast<JSObject*>(jlong_to_ptr(nativeHandle));
+                        return jlong_to_impptr(nativeHandle);
                     } else
                         return JavaInstance::create(result.l, rootObject)->createRuntimeObject(exec);
                 }
index 1a7b929..04acf73 100644 (file)
@@ -143,7 +143,7 @@ ObjcValue convertValueToObjcValue(ExecState* exec, JSValue value, ObjcValueType
 
             JSGlobalObject* globalObject = 0;
             if (value.isObject() && asObject(value)->isGlobalObject())
-                globalObject = static_cast<JSGlobalObject*>(asObject(value));
+                globalObject = jsCast<JSGlobalObject*>(asObject(value));
 
             if (!globalObject)
                 globalObject = originGlobalObject;
index 6b86231..5efc712 100644 (file)
@@ -116,7 +116,7 @@ static EncodedJSValue JSC_HOST_CALL callRuntimeMethod(ExecState* exec)
     } else {
         // Calling a runtime object of a plugin element?
         if (thisValue.inherits(&JSHTMLElement::s_info)) {
-            HTMLElement* element = static_cast<JSHTMLElement*>(asObject(thisValue))->impl();
+            HTMLElement* element = jsCast<JSHTMLElement*>(asObject(thisValue))->impl();
             instance = pluginInstance(element);
         }
         if (!instance)
index 7ec087d..74bcc3f 100644 (file)
@@ -290,7 +290,7 @@ static EncodedJSValue JSC_HOST_CALL callRuntimeConstructor(ExecState* exec)
     instance->end();
     
     ASSERT(result);
-    return JSValue::encode(result.isObject() ? static_cast<JSObject*>(result.asCell()) : constructor);
+    return JSValue::encode(result.isObject() ? jsCast<JSObject*>(result.asCell()) : constructor);
 }
 
 ConstructType RuntimeObject::getConstructData(JSCell* cell, ConstructData& constructData)
index 1d2a457..7e50bc2 100644 (file)
@@ -41,7 +41,7 @@ void injectInternalsObject(JSContextRef context)
 {
     JSLock lock(SilenceAssertionsOnly);
     ExecState* exec = toJS(context);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     ScriptExecutionContext* scriptContext = globalObject->scriptExecutionContext();
     Document* document = scriptContext->isDocument() ? static_cast<Document*>(scriptContext) : 0;
     globalObject->putDirect(exec->globalData(), Identifier(exec, Internals::internalsId), toJS(exec, globalObject, Internals::create(document)));
@@ -51,7 +51,7 @@ void resetInternalsObject(JSContextRef context)
 {
     JSLock lock(SilenceAssertionsOnly);
     ExecState* exec = toJS(context);
-    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
+    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     Internals * internals = toInternals(globalObject->getDirect(exec->globalData(), Identifier(exec, Internals::internalsId)));
     if (internals) {
         ScriptExecutionContext* scriptContext = globalObject->scriptExecutionContext();