Add jsCast to replace static_cast
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2011 20:40:10 +0000 (20:40 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2011 20:40:10 +0000 (20:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72071

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Added new jsCast and changed all of the static_cast sites in functions that
are in the MethodTable to use jsCast instead.

* API/JSCallbackFunction.cpp:
(JSC::JSCallbackFunction::toStringCallback):
(JSC::JSCallbackFunction::valueOfCallback):
* API/JSCallbackObject.h:
(JSC::JSCallbackObject::visitChildren):
* API/JSCallbackObjectFunctions.h:
(JSC::::className):
(JSC::::getOwnPropertySlot):
(JSC::::getOwnPropertyDescriptor):
(JSC::::put):
(JSC::::deleteProperty):
(JSC::::deletePropertyByIndex):
(JSC::::getConstructData):
(JSC::::hasInstance):
(JSC::::getCallData):
(JSC::::getOwnPropertyNames):
* debugger/DebuggerActivation.cpp:
(JSC::DebuggerActivation::visitChildren):
(JSC::DebuggerActivation::className):
(JSC::DebuggerActivation::getOwnPropertySlot):
(JSC::DebuggerActivation::put):
(JSC::DebuggerActivation::putWithAttributes):
(JSC::DebuggerActivation::deleteProperty):
(JSC::DebuggerActivation::getOwnPropertyNames):
(JSC::DebuggerActivation::getOwnPropertyDescriptor):
(JSC::DebuggerActivation::defineGetter):
(JSC::DebuggerActivation::defineSetter):
* runtime/Arguments.cpp:
(JSC::Arguments::visitChildren):
(JSC::Arguments::getOwnPropertySlotByIndex):
(JSC::Arguments::getOwnPropertySlot):
(JSC::Arguments::getOwnPropertyDescriptor):
(JSC::Arguments::getOwnPropertyNames):
(JSC::Arguments::putByIndex):
(JSC::Arguments::put):
(JSC::Arguments::deletePropertyByIndex):
(JSC::Arguments::deleteProperty):
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getOwnPropertySlot):
(JSC::ArrayConstructor::getOwnPropertyDescriptor):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::getOwnPropertySlot):
(JSC::ArrayPrototype::getOwnPropertyDescriptor):
* runtime/BooleanPrototype.cpp:
(JSC::BooleanPrototype::getOwnPropertySlot):
(JSC::BooleanPrototype::getOwnPropertyDescriptor):
* runtime/DateConstructor.cpp:
(JSC::DateConstructor::getOwnPropertySlot):
(JSC::DateConstructor::getOwnPropertyDescriptor):
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::getOwnPropertySlot):
(JSC::DatePrototype::getOwnPropertyDescriptor):
* runtime/ErrorPrototype.cpp:
(JSC::ErrorPrototype::getOwnPropertySlot):
(JSC::ErrorPrototype::getOwnPropertyDescriptor):
* runtime/Executable.cpp:
(JSC::ExecutableBase::clearCode):
(JSC::EvalExecutable::visitChildren):
(JSC::ProgramExecutable::visitChildren):
(JSC::FunctionExecutable::visitChildren):
* runtime/GetterSetter.cpp:
(JSC::GetterSetter::visitChildren):
* runtime/JSActivation.cpp:
(JSC::JSActivation::visitChildren):
(JSC::JSActivation::getOwnPropertyNames):
(JSC::JSActivation::getOwnPropertySlot):
(JSC::JSActivation::put):
(JSC::JSActivation::putWithAttributes):
* runtime/JSArray.cpp:
(JSC::JSArray::getOwnPropertySlotByIndex):
(JSC::JSArray::getOwnPropertySlot):
(JSC::JSArray::getOwnPropertyDescriptor):
(JSC::JSArray::put):
(JSC::JSArray::putByIndex):
(JSC::JSArray::deleteProperty):
(JSC::JSArray::deletePropertyByIndex):
(JSC::JSArray::getOwnPropertyNames):
(JSC::JSArray::visitChildren):
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::hasInstance):
(JSC::JSBoundFunction::visitChildren):
* runtime/JSByteArray.cpp:
(JSC::JSByteArray::getOwnPropertySlot):
(JSC::JSByteArray::getOwnPropertyDescriptor):
(JSC::JSByteArray::getOwnPropertySlotByIndex):
(JSC::JSByteArray::put):
(JSC::JSByteArray::putByIndex):
(JSC::JSByteArray::getOwnPropertyNames):
* runtime/JSCell.h:
(JSC::JSCell::visitChildren):
(JSC::jsCast):
* runtime/JSFunction.cpp:
(JSC::JSFunction::visitChildren):
(JSC::JSFunction::getCallData):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnPropertyDescriptor):
(JSC::JSFunction::getOwnPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::getConstructData):
* runtime/JSGlobalData.cpp:
(JSC::StackPreservingRecompiler::operator()):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::put):
(JSC::JSGlobalObject::putWithAttributes):
(JSC::JSGlobalObject::defineGetter):
(JSC::JSGlobalObject::defineSetter):
(JSC::JSGlobalObject::visitChildren):
(JSC::JSGlobalObject::getOwnPropertySlot):
(JSC::JSGlobalObject::getOwnPropertyDescriptor):
(JSC::JSGlobalObject::clearRareData):
* runtime/JSGlobalThis.cpp:
(JSC::JSGlobalThis::visitChildren):
* runtime/JSONObject.cpp:
(JSC::JSONObject::getOwnPropertySlot):
(JSC::JSONObject::getOwnPropertyDescriptor):
* runtime/JSObject.cpp:
(JSC::JSObject::finalize):
(JSC::JSObject::visitChildren):
(JSC::JSObject::getOwnPropertySlotByIndex):
(JSC::JSObject::put):
(JSC::JSObject::putByIndex):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::deletePropertyByIndex):
* runtime/JSObject.h:
(JSC::JSObject::getOwnPropertySlot):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::visitChildren):
* runtime/JSStaticScopeObject.cpp:
(JSC::JSStaticScopeObject::visitChildren):
(JSC::JSStaticScopeObject::put):
(JSC::JSStaticScopeObject::putWithAttributes):
(JSC::JSStaticScopeObject::getOwnPropertySlot):
* runtime/JSString.cpp:
(JSC::JSString::visitChildren):
(JSC::JSString::toThisObject):
(JSC::JSString::getOwnPropertySlot):
(JSC::JSString::getOwnPropertySlotByIndex):
* runtime/JSVariableObject.cpp:
(JSC::JSVariableObject::deleteProperty):
(JSC::JSVariableObject::getOwnPropertyNames):
* runtime/JSWrapperObject.cpp:
(JSC::JSWrapperObject::visitChildren):
* runtime/MathObject.cpp:
(JSC::MathObject::getOwnPropertySlot):
(JSC::MathObject::getOwnPropertyDescriptor):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::visitChildren):
* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::getOwnPropertySlot):
(JSC::NumberConstructor::getOwnPropertyDescriptor):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::getOwnPropertySlot):
(JSC::NumberPrototype::getOwnPropertyDescriptor):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::getOwnPropertySlot):
(JSC::ObjectConstructor::getOwnPropertyDescriptor):
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::put):
(JSC::ObjectPrototype::getOwnPropertySlotByIndex):
(JSC::ObjectPrototype::getOwnPropertySlot):
(JSC::ObjectPrototype::getOwnPropertyDescriptor):
* runtime/RegExpConstructor.cpp:
(JSC::RegExpConstructor::getOwnPropertySlot):
(JSC::RegExpConstructor::getOwnPropertyDescriptor):
(JSC::RegExpConstructor::put):
* runtime/RegExpMatchesArray.h:
(JSC::RegExpMatchesArray::getOwnPropertySlot):
(JSC::RegExpMatchesArray::getOwnPropertySlotByIndex):
(JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
(JSC::RegExpMatchesArray::put):
(JSC::RegExpMatchesArray::putByIndex):
(JSC::RegExpMatchesArray::deleteProperty):
(JSC::RegExpMatchesArray::deletePropertyByIndex):
(JSC::RegExpMatchesArray::getOwnPropertyNames):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::visitChildren):
(JSC::RegExpObject::getOwnPropertySlot):
(JSC::RegExpObject::getOwnPropertyDescriptor):
(JSC::RegExpObject::put):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::getOwnPropertySlot):
(JSC::RegExpPrototype::getOwnPropertyDescriptor):
* runtime/ScopeChain.cpp:
(JSC::ScopeChainNode::visitChildren):
* runtime/StringConstructor.cpp:
(JSC::StringConstructor::getOwnPropertySlot):
(JSC::StringConstructor::getOwnPropertyDescriptor):
* runtime/StringObject.cpp:
(JSC::StringObject::getOwnPropertySlot):
(JSC::StringObject::getOwnPropertySlotByIndex):
(JSC::StringObject::getOwnPropertyDescriptor):
(JSC::StringObject::deleteProperty):
(JSC::StringObject::getOwnPropertyNames):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::getOwnPropertySlot):
(JSC::StringPrototype::getOwnPropertyDescriptor):
* runtime/Structure.cpp:
(JSC::Structure::visitChildren):
* runtime/StructureChain.cpp:
(JSC::StructureChain::visitChildren):

Source/JavaScriptGlue:

Added new jsCast and changed all of the static_cast sites in functions that
are in the MethodTable to use jsCast instead.

* UserObjectImp.cpp:
(UserObjectImp::getCallData):
(UserObjectImp::getOwnPropertyNames):
(UserObjectImp::getOwnPropertySlot):
(UserObjectImp::put):
(UserObjectImp::visitChildren):

Source/WebCore:

No new tests.

Added new jsCast and changed all of the static_cast sites in functions that
are in the MethodTable to use jsCast instead.

* bindings/js/JSAttrCustom.cpp:
(WebCore::JSAttr::visitChildren):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::JSAudioContext::visitChildren):
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::JSCSSRule::visitChildren):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::visitChildren):
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toHTMLCanvasStyle):
* bindings/js/JSCanvasRenderingContextCustom.cpp:
(WebCore::JSCanvasRenderingContext::visitChildren):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertyNames):
(WebCore::JSDOMStringMap::deleteProperty):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::toThisObject):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::visitChildren):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::deleteProperty):
(WebCore::JSDOMWindow::getPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
(WebCore::JSDOMWindow::defineGetter):
(WebCore::JSDOMWindow::defineSetter):
(WebCore::JSDOMWindow::defineOwnProperty):
* bindings/js/JSDOMWindowShell.cpp:
(WebCore::JSDOMWindowShell::className):
(WebCore::JSDOMWindowShell::getOwnPropertySlot):
(WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
(WebCore::JSDOMWindowShell::put):
(WebCore::JSDOMWindowShell::putWithAttributes):
(WebCore::JSDOMWindowShell::defineOwnProperty):
(WebCore::JSDOMWindowShell::deleteProperty):
(WebCore::JSDOMWindowShell::getPropertyNames):
(WebCore::JSDOMWindowShell::getOwnPropertyNames):
(WebCore::JSDOMWindowShell::defineGetter):
(WebCore::JSDOMWindowShell::defineSetter):
* bindings/js/JSHTMLAppletElementCustom.cpp:
(WebCore::JSHTMLAppletElement::getCallData):
* bindings/js/JSHTMLEmbedElementCustom.cpp:
(WebCore::JSHTMLEmbedElement::getCallData):
* bindings/js/JSHTMLObjectElementCustom.cpp:
(WebCore::JSHTMLObjectElement::getCallData):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::deleteProperty):
(WebCore::JSHistory::getOwnPropertyNames):
* bindings/js/JSJavaScriptAudioNodeCustom.cpp:
(WebCore::JSJavaScriptAudioNode::visitChildren):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::deleteProperty):
(WebCore::JSLocation::getOwnPropertyNames):
* bindings/js/JSMessageChannelCustom.cpp:
(WebCore::JSMessageChannel::visitChildren):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::visitChildren):
* bindings/js/JSNamedNodeMapCustom.cpp:
(WebCore::JSNamedNodeMap::visitChildren):
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::visitChildren):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::visitChildren):
* bindings/js/JSNodeIteratorCustom.cpp:
(WebCore::JSNodeIterator::visitChildren):
* bindings/js/JSSVGElementInstanceCustom.cpp:
(WebCore::JSSVGElementInstance::visitChildren):
* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorker::visitChildren):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::deleteProperty):
(WebCore::JSStorage::getOwnPropertyNames):
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::JSStyleSheet::visitChildren):
* bindings/js/JSTreeWalkerCustom.cpp:
(WebCore::JSTreeWalker::visitChildren):
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::JSWebGLRenderingContext::visitChildren):
* bindings/js/JSWorkerContextCustom.cpp:
(WebCore::JSWorkerContext::visitChildren):
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitChildren):
* bindings/js/JSXPathResultCustom.cpp:
(WebCore::JSXPathResult::visitChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::getOwnPropertySlot):
(WebCore::JSTestInterface::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertySlot):
(WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestMediaQueryListListener::getOwnPropertySlot):
(WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::getOwnPropertySlot):
(WebCore::JSTestNamedConstructor::getOwnPropertyDescriptor):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::getOwnPropertySlot):
(WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
(WebCore::JSTestObj::getOwnPropertySlot):
(WebCore::JSTestObj::getOwnPropertyDescriptor):
(WebCore::JSTestObj::put):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::getOwnPropertySlot):
(WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::getCallData):
(JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
* bridge/qt/qt_instance.cpp:
(JSC::Bindings::QtRuntimeObject::visitChildren):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
(JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
(JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertyNames):
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::getOwnPropertyDescriptor):
(JSC::RuntimeArray::getOwnPropertySlotByIndex):
(JSC::RuntimeArray::put):
(JSC::RuntimeArray::putByIndex):
* bridge/runtime_method.cpp:
(JSC::RuntimeMethod::getOwnPropertySlot):
(JSC::RuntimeMethod::getOwnPropertyDescriptor):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::getOwnPropertySlot):
(JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
(JSC::Bindings::RuntimeObject::put):
(JSC::Bindings::RuntimeObject::defaultValue):
(JSC::Bindings::RuntimeObject::getCallData):
(JSC::Bindings::RuntimeObject::getConstructData):
(JSC::Bindings::RuntimeObject::getOwnPropertyNames):

Source/WebKit2:

Added new jsCast and changed all of the static_cast sites in functions that
are in the MethodTable to use jsCast instead.

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::getCallData):
(WebKit::JSNPObject::getConstructData):
(WebKit::JSNPObject::getOwnPropertySlot):
(WebKit::JSNPObject::getOwnPropertyDescriptor):
(WebKit::JSNPObject::put):
(WebKit::JSNPObject::deleteProperty):
(WebKit::JSNPObject::deletePropertyByIndex):
(WebKit::JSNPObject::getOwnPropertyNames):

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

96 files changed:
Source/JavaScriptCore/API/JSCallbackFunction.cpp
Source/JavaScriptCore/API/JSCallbackObject.h
Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/DebuggerActivation.cpp
Source/JavaScriptCore/runtime/Arguments.cpp
Source/JavaScriptCore/runtime/ArrayConstructor.cpp
Source/JavaScriptCore/runtime/ArrayPrototype.cpp
Source/JavaScriptCore/runtime/BooleanPrototype.cpp
Source/JavaScriptCore/runtime/DateConstructor.cpp
Source/JavaScriptCore/runtime/DatePrototype.cpp
Source/JavaScriptCore/runtime/ErrorPrototype.cpp
Source/JavaScriptCore/runtime/Executable.cpp
Source/JavaScriptCore/runtime/GetterSetter.cpp
Source/JavaScriptCore/runtime/JSActivation.cpp
Source/JavaScriptCore/runtime/JSArray.cpp
Source/JavaScriptCore/runtime/JSBoundFunction.cpp
Source/JavaScriptCore/runtime/JSByteArray.cpp
Source/JavaScriptCore/runtime/JSCell.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSGlobalData.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalThis.cpp
Source/JavaScriptCore/runtime/JSONObject.cpp
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp
Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp
Source/JavaScriptCore/runtime/JSString.cpp
Source/JavaScriptCore/runtime/JSVariableObject.cpp
Source/JavaScriptCore/runtime/JSWrapperObject.cpp
Source/JavaScriptCore/runtime/MathObject.cpp
Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp
Source/JavaScriptCore/runtime/NumberConstructor.cpp
Source/JavaScriptCore/runtime/NumberPrototype.cpp
Source/JavaScriptCore/runtime/ObjectConstructor.cpp
Source/JavaScriptCore/runtime/ObjectPrototype.cpp
Source/JavaScriptCore/runtime/RegExpConstructor.cpp
Source/JavaScriptCore/runtime/RegExpMatchesArray.h
Source/JavaScriptCore/runtime/RegExpObject.cpp
Source/JavaScriptCore/runtime/RegExpPrototype.cpp
Source/JavaScriptCore/runtime/ScopeChain.cpp
Source/JavaScriptCore/runtime/StringConstructor.cpp
Source/JavaScriptCore/runtime/StringObject.cpp
Source/JavaScriptCore/runtime/StringPrototype.cpp
Source/JavaScriptCore/runtime/Structure.cpp
Source/JavaScriptCore/runtime/StructureChain.cpp
Source/JavaScriptGlue/ChangeLog
Source/JavaScriptGlue/UserObjectImp.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSAttrCustom.cpp
Source/WebCore/bindings/js/JSAudioContextCustom.cpp
Source/WebCore/bindings/js/JSCSSRuleCustom.cpp
Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDOMWindowShell.cpp
Source/WebCore/bindings/js/JSHTMLAppletElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLEmbedElementCustom.cpp
Source/WebCore/bindings/js/JSHTMLObjectElementCustom.cpp
Source/WebCore/bindings/js/JSHistoryCustom.cpp
Source/WebCore/bindings/js/JSJavaScriptAudioNodeCustom.cpp
Source/WebCore/bindings/js/JSLocationCustom.cpp
Source/WebCore/bindings/js/JSMessageChannelCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
Source/WebCore/bindings/js/JSNodeCustom.cpp
Source/WebCore/bindings/js/JSNodeFilterCustom.cpp
Source/WebCore/bindings/js/JSNodeIteratorCustom.cpp
Source/WebCore/bindings/js/JSSVGElementInstanceCustom.cpp
Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetCustom.cpp
Source/WebCore/bindings/js/JSTreeWalkerCustom.cpp
Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
Source/WebCore/bindings/js/JSWorkerContextCustom.cpp
Source/WebCore/bindings/js/JSXMLHttpRequestCustom.cpp
Source/WebCore/bindings/js/JSXPathResultCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bridge/objc/objc_runtime.mm
Source/WebCore/bridge/qt/qt_instance.cpp
Source/WebCore/bridge/qt/qt_runtime.cpp
Source/WebCore/bridge/runtime_array.cpp
Source/WebCore/bridge/runtime_method.cpp
Source/WebCore/bridge/runtime_object.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp

index ad02f19..e8ea62e 100644 (file)
@@ -88,9 +88,9 @@ JSValueRef JSCallbackFunction::toStringCallback(JSContextRef ctx, JSObjectRef, J
 {
     JSObject* object = toJS(thisObject);
     if (object->inherits(&JSCallbackObject<JSNonFinalObject>::s_info))
-        return static_cast<JSCallbackObject<JSNonFinalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeString, exception);
+        return jsCast<JSCallbackObject<JSNonFinalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeString, exception);
     if (object->inherits(&JSCallbackObject<JSGlobalObject>::s_info))
-        return static_cast<JSCallbackObject<JSGlobalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeString, exception);
+        return jsCast<JSCallbackObject<JSGlobalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeString, exception);
     return 0;
 }
 
@@ -98,9 +98,9 @@ JSValueRef JSCallbackFunction::valueOfCallback(JSContextRef ctx, JSObjectRef, JS
 {
     JSObject* object = toJS(thisObject);
     if (object->inherits(&JSCallbackObject<JSNonFinalObject>::s_info))
-        return static_cast<JSCallbackObject<JSNonFinalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeNumber, exception);
+        return jsCast<JSCallbackObject<JSNonFinalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeNumber, exception);
     if (object->inherits(&JSCallbackObject<JSGlobalObject>::s_info))
-        return static_cast<JSCallbackObject<JSGlobalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeNumber, exception);
+        return jsCast<JSCallbackObject<JSGlobalObject>*>(object)->classRef()->convertToType(ctx, thisObject, kJSTypeNumber, exception);
     return 0;
 }
 
index 482a611..91ff624 100644 (file)
@@ -194,7 +194,7 @@ private:
 
     static void visitChildren(JSCell* cell, SlotVisitor& visitor)
     {
-        JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+        JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
         ASSERT_GC_OBJECT_INHERITS((static_cast<Parent*>(thisObject)), &JSCallbackObject<Parent>::s_info);
         COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
         ASSERT(thisObject->Parent::structure()->typeInfo().overridesVisitChildren());
index f8b21a2..2871e64 100644 (file)
@@ -116,7 +116,7 @@ void JSCallbackObject<Parent>::init(ExecState* exec)
 template <class Parent>
 UString JSCallbackObject<Parent>::className(const JSObject* object)
 {
-    const JSCallbackObject* thisObject = static_cast<const JSCallbackObject*>(object);
+    const JSCallbackObject* thisObject = jsCast<const JSCallbackObject*>(object);
     UString thisClassName = thisObject->classRef()->className();
     if (!thisClassName.isEmpty())
         return thisClassName;
@@ -127,7 +127,7 @@ UString JSCallbackObject<Parent>::className(const JSObject* object)
 template <class Parent>
 bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     JSContextRef ctx = toRef(exec);
     JSObjectRef thisRef = toRef(thisObject);
     RefPtr<OpaqueJSString> propertyNameRef;
@@ -186,7 +186,7 @@ bool JSCallbackObject<Parent>::getOwnPropertySlot(JSCell* cell, ExecState* exec,
 template <class Parent>
 bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
     PropertySlot slot;
     if (thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, propertyName, slot)) {
         // Ideally we should return an access descriptor, but returning a value descriptor is better than nothing.
@@ -206,7 +206,7 @@ bool JSCallbackObject<Parent>::getOwnPropertyDescriptor(JSObject* object, ExecSt
 template <class Parent>
 void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     JSContextRef ctx = toRef(exec);
     JSObjectRef thisRef = toRef(thisObject);
     RefPtr<OpaqueJSString> propertyNameRef;
@@ -265,7 +265,7 @@ void JSCallbackObject<Parent>::put(JSCell* cell, ExecState* exec, const Identifi
 template <class Parent>
 bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     JSContextRef ctx = toRef(exec);
     JSObjectRef thisRef = toRef(thisObject);
     RefPtr<OpaqueJSString> propertyNameRef;
@@ -309,14 +309,14 @@ bool JSCallbackObject<Parent>::deleteProperty(JSCell* cell, ExecState* exec, con
 template <class Parent>
 bool JSCallbackObject<Parent>::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
 }
 
 template <class Parent>
 ConstructType JSCallbackObject<Parent>::getConstructData(JSCell* cell, ConstructData& constructData)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
         if (jsClass->callAsConstructor) {
             constructData.native.function = construct;
@@ -358,7 +358,7 @@ EncodedJSValue JSCallbackObject<Parent>::construct(ExecState* exec)
 template <class Parent>
 bool JSCallbackObject<Parent>::hasInstance(JSObject* object, ExecState* exec, JSValue value, JSValue)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
     JSContextRef execRef = toRef(exec);
     JSObjectRef thisRef = toRef(thisObject);
     
@@ -382,7 +382,7 @@ bool JSCallbackObject<Parent>::hasInstance(JSObject* object, ExecState* exec, JS
 template <class Parent>
 CallType JSCallbackObject<Parent>::getCallData(JSCell* cell, CallData& callData)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(cell);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(cell);
     for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
         if (jsClass->callAsFunction) {
             callData.native.function = call;
@@ -424,7 +424,7 @@ EncodedJSValue JSCallbackObject<Parent>::call(ExecState* exec)
 template <class Parent>
 void JSCallbackObject<Parent>::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSCallbackObject* thisObject = static_cast<JSCallbackObject*>(object);
+    JSCallbackObject* thisObject = jsCast<JSCallbackObject*>(object);
     JSContextRef execRef = toRef(exec);
     JSObjectRef thisRef = toRef(thisObject);
     
index ef77964..e7981f4 100644 (file)
@@ -1,3 +1,215 @@
+2011-11-11  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add jsCast to replace static_cast
+        https://bugs.webkit.org/show_bug.cgi?id=72071
+
+        Reviewed by Geoffrey Garen.
+
+        Added new jsCast and changed all of the static_cast sites in functions that 
+        are in the MethodTable to use jsCast instead.
+
+        * API/JSCallbackFunction.cpp:
+        (JSC::JSCallbackFunction::toStringCallback):
+        (JSC::JSCallbackFunction::valueOfCallback):
+        * API/JSCallbackObject.h:
+        (JSC::JSCallbackObject::visitChildren):
+        * API/JSCallbackObjectFunctions.h:
+        (JSC::::className):
+        (JSC::::getOwnPropertySlot):
+        (JSC::::getOwnPropertyDescriptor):
+        (JSC::::put):
+        (JSC::::deleteProperty):
+        (JSC::::deletePropertyByIndex):
+        (JSC::::getConstructData):
+        (JSC::::hasInstance):
+        (JSC::::getCallData):
+        (JSC::::getOwnPropertyNames):
+        * debugger/DebuggerActivation.cpp:
+        (JSC::DebuggerActivation::visitChildren):
+        (JSC::DebuggerActivation::className):
+        (JSC::DebuggerActivation::getOwnPropertySlot):
+        (JSC::DebuggerActivation::put):
+        (JSC::DebuggerActivation::putWithAttributes):
+        (JSC::DebuggerActivation::deleteProperty):
+        (JSC::DebuggerActivation::getOwnPropertyNames):
+        (JSC::DebuggerActivation::getOwnPropertyDescriptor):
+        (JSC::DebuggerActivation::defineGetter):
+        (JSC::DebuggerActivation::defineSetter):
+        * runtime/Arguments.cpp:
+        (JSC::Arguments::visitChildren):
+        (JSC::Arguments::getOwnPropertySlotByIndex):
+        (JSC::Arguments::getOwnPropertySlot):
+        (JSC::Arguments::getOwnPropertyDescriptor):
+        (JSC::Arguments::getOwnPropertyNames):
+        (JSC::Arguments::putByIndex):
+        (JSC::Arguments::put):
+        (JSC::Arguments::deletePropertyByIndex):
+        (JSC::Arguments::deleteProperty):
+        * runtime/ArrayConstructor.cpp:
+        (JSC::ArrayConstructor::getOwnPropertySlot):
+        (JSC::ArrayConstructor::getOwnPropertyDescriptor):
+        * runtime/ArrayPrototype.cpp:
+        (JSC::ArrayPrototype::getOwnPropertySlot):
+        (JSC::ArrayPrototype::getOwnPropertyDescriptor):
+        * runtime/BooleanPrototype.cpp:
+        (JSC::BooleanPrototype::getOwnPropertySlot):
+        (JSC::BooleanPrototype::getOwnPropertyDescriptor):
+        * runtime/DateConstructor.cpp:
+        (JSC::DateConstructor::getOwnPropertySlot):
+        (JSC::DateConstructor::getOwnPropertyDescriptor):
+        * runtime/DatePrototype.cpp:
+        (JSC::DatePrototype::getOwnPropertySlot):
+        (JSC::DatePrototype::getOwnPropertyDescriptor):
+        * runtime/ErrorPrototype.cpp:
+        (JSC::ErrorPrototype::getOwnPropertySlot):
+        (JSC::ErrorPrototype::getOwnPropertyDescriptor):
+        * runtime/Executable.cpp:
+        (JSC::ExecutableBase::clearCode):
+        (JSC::EvalExecutable::visitChildren):
+        (JSC::ProgramExecutable::visitChildren):
+        (JSC::FunctionExecutable::visitChildren):
+        * runtime/GetterSetter.cpp:
+        (JSC::GetterSetter::visitChildren):
+        * runtime/JSActivation.cpp:
+        (JSC::JSActivation::visitChildren):
+        (JSC::JSActivation::getOwnPropertyNames):
+        (JSC::JSActivation::getOwnPropertySlot):
+        (JSC::JSActivation::put):
+        (JSC::JSActivation::putWithAttributes):
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::getOwnPropertySlotByIndex):
+        (JSC::JSArray::getOwnPropertySlot):
+        (JSC::JSArray::getOwnPropertyDescriptor):
+        (JSC::JSArray::put):
+        (JSC::JSArray::putByIndex):
+        (JSC::JSArray::deleteProperty):
+        (JSC::JSArray::deletePropertyByIndex):
+        (JSC::JSArray::getOwnPropertyNames):
+        (JSC::JSArray::visitChildren):
+        * runtime/JSBoundFunction.cpp:
+        (JSC::JSBoundFunction::hasInstance):
+        (JSC::JSBoundFunction::visitChildren):
+        * runtime/JSByteArray.cpp:
+        (JSC::JSByteArray::getOwnPropertySlot):
+        (JSC::JSByteArray::getOwnPropertyDescriptor):
+        (JSC::JSByteArray::getOwnPropertySlotByIndex):
+        (JSC::JSByteArray::put):
+        (JSC::JSByteArray::putByIndex):
+        (JSC::JSByteArray::getOwnPropertyNames):
+        * runtime/JSCell.h:
+        (JSC::JSCell::visitChildren):
+        (JSC::jsCast):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::visitChildren):
+        (JSC::JSFunction::getCallData):
+        (JSC::JSFunction::getOwnPropertySlot):
+        (JSC::JSFunction::getOwnPropertyDescriptor):
+        (JSC::JSFunction::getOwnPropertyNames):
+        (JSC::JSFunction::put):
+        (JSC::JSFunction::deleteProperty):
+        (JSC::JSFunction::getConstructData):
+        * runtime/JSGlobalData.cpp:
+        (JSC::StackPreservingRecompiler::operator()):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::put):
+        (JSC::JSGlobalObject::putWithAttributes):
+        (JSC::JSGlobalObject::defineGetter):
+        (JSC::JSGlobalObject::defineSetter):
+        (JSC::JSGlobalObject::visitChildren):
+        (JSC::JSGlobalObject::getOwnPropertySlot):
+        (JSC::JSGlobalObject::getOwnPropertyDescriptor):
+        (JSC::JSGlobalObject::clearRareData):
+        * runtime/JSGlobalThis.cpp:
+        (JSC::JSGlobalThis::visitChildren):
+        * runtime/JSONObject.cpp:
+        (JSC::JSONObject::getOwnPropertySlot):
+        (JSC::JSONObject::getOwnPropertyDescriptor):
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::finalize):
+        (JSC::JSObject::visitChildren):
+        (JSC::JSObject::getOwnPropertySlotByIndex):
+        (JSC::JSObject::put):
+        (JSC::JSObject::putByIndex):
+        (JSC::JSObject::deleteProperty):
+        (JSC::JSObject::deletePropertyByIndex):
+        * runtime/JSObject.h:
+        (JSC::JSObject::getOwnPropertySlot):
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::visitChildren):
+        * runtime/JSStaticScopeObject.cpp:
+        (JSC::JSStaticScopeObject::visitChildren):
+        (JSC::JSStaticScopeObject::put):
+        (JSC::JSStaticScopeObject::putWithAttributes):
+        (JSC::JSStaticScopeObject::getOwnPropertySlot):
+        * runtime/JSString.cpp:
+        (JSC::JSString::visitChildren):
+        (JSC::JSString::toThisObject):
+        (JSC::JSString::getOwnPropertySlot):
+        (JSC::JSString::getOwnPropertySlotByIndex):
+        * runtime/JSVariableObject.cpp:
+        (JSC::JSVariableObject::deleteProperty):
+        (JSC::JSVariableObject::getOwnPropertyNames):
+        * runtime/JSWrapperObject.cpp:
+        (JSC::JSWrapperObject::visitChildren):
+        * runtime/MathObject.cpp:
+        (JSC::MathObject::getOwnPropertySlot):
+        (JSC::MathObject::getOwnPropertyDescriptor):
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::NativeErrorConstructor::visitChildren):
+        * runtime/NumberConstructor.cpp:
+        (JSC::NumberConstructor::getOwnPropertySlot):
+        (JSC::NumberConstructor::getOwnPropertyDescriptor):
+        * runtime/NumberPrototype.cpp:
+        (JSC::NumberPrototype::getOwnPropertySlot):
+        (JSC::NumberPrototype::getOwnPropertyDescriptor):
+        * runtime/ObjectConstructor.cpp:
+        (JSC::ObjectConstructor::getOwnPropertySlot):
+        (JSC::ObjectConstructor::getOwnPropertyDescriptor):
+        * runtime/ObjectPrototype.cpp:
+        (JSC::ObjectPrototype::put):
+        (JSC::ObjectPrototype::getOwnPropertySlotByIndex):
+        (JSC::ObjectPrototype::getOwnPropertySlot):
+        (JSC::ObjectPrototype::getOwnPropertyDescriptor):
+        * runtime/RegExpConstructor.cpp:
+        (JSC::RegExpConstructor::getOwnPropertySlot):
+        (JSC::RegExpConstructor::getOwnPropertyDescriptor):
+        (JSC::RegExpConstructor::put):
+        * runtime/RegExpMatchesArray.h:
+        (JSC::RegExpMatchesArray::getOwnPropertySlot):
+        (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex):
+        (JSC::RegExpMatchesArray::getOwnPropertyDescriptor):
+        (JSC::RegExpMatchesArray::put):
+        (JSC::RegExpMatchesArray::putByIndex):
+        (JSC::RegExpMatchesArray::deleteProperty):
+        (JSC::RegExpMatchesArray::deletePropertyByIndex):
+        (JSC::RegExpMatchesArray::getOwnPropertyNames):
+        * runtime/RegExpObject.cpp:
+        (JSC::RegExpObject::visitChildren):
+        (JSC::RegExpObject::getOwnPropertySlot):
+        (JSC::RegExpObject::getOwnPropertyDescriptor):
+        (JSC::RegExpObject::put):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::RegExpPrototype::getOwnPropertySlot):
+        (JSC::RegExpPrototype::getOwnPropertyDescriptor):
+        * runtime/ScopeChain.cpp:
+        (JSC::ScopeChainNode::visitChildren):
+        * runtime/StringConstructor.cpp:
+        (JSC::StringConstructor::getOwnPropertySlot):
+        (JSC::StringConstructor::getOwnPropertyDescriptor):
+        * runtime/StringObject.cpp:
+        (JSC::StringObject::getOwnPropertySlot):
+        (JSC::StringObject::getOwnPropertySlotByIndex):
+        (JSC::StringObject::getOwnPropertyDescriptor):
+        (JSC::StringObject::deleteProperty):
+        (JSC::StringObject::getOwnPropertyNames):
+        * runtime/StringPrototype.cpp:
+        (JSC::StringPrototype::getOwnPropertySlot):
+        (JSC::StringPrototype::getOwnPropertyDescriptor):
+        * runtime/Structure.cpp:
+        (JSC::Structure::visitChildren):
+        * runtime/StructureChain.cpp:
+        (JSC::StructureChain::visitChildren):
+
 2011-11-11  Gavin Barraclough  <barraclough@apple.com>
 
         Enable DFG JIT for ARMv7/iOS.
index 52d4c29..1e03cd1 100644 (file)
@@ -45,7 +45,7 @@ void DebuggerActivation::finishCreation(JSGlobalData& globalData, JSObject* acti
 
 void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -57,55 +57,55 @@ void DebuggerActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 UString DebuggerActivation::className(const JSObject* object)
 {
-    const DebuggerActivation* thisObject = static_cast<const DebuggerActivation*>(object);
+    const DebuggerActivation* thisObject = jsCast<const DebuggerActivation*>(object);
     return thisObject->m_activation->methodTable()->className(thisObject->m_activation.get());
 }
 
 bool DebuggerActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(cell);
     return thisObject->m_activation->methodTable()->getOwnPropertySlot(thisObject->m_activation.get(), exec, propertyName, slot);
 }
 
 void DebuggerActivation::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(cell);
     thisObject->m_activation->methodTable()->put(thisObject->m_activation.get(), exec, propertyName, value, slot);
 }
 
 void DebuggerActivation::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
     thisObject->m_activation->methodTable()->putWithAttributes(thisObject->m_activation.get(), exec, propertyName, value, attributes);
 }
 
 bool DebuggerActivation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(cell);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(cell);
     return thisObject->m_activation->methodTable()->deleteProperty(thisObject->m_activation.get(), exec, propertyName);
 }
 
 void DebuggerActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
     thisObject->m_activation->methodTable()->getPropertyNames(thisObject->m_activation.get(), exec, propertyNames, mode);
 }
 
 bool DebuggerActivation::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
     return thisObject->m_activation->methodTable()->getOwnPropertyDescriptor(thisObject->m_activation.get(), exec, propertyName, descriptor);
 }
 
 void DebuggerActivation::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
     thisObject->m_activation->methodTable()->defineGetter(thisObject->m_activation.get(), exec, propertyName, getterFunction, attributes);
 }
 
 void DebuggerActivation::defineSetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes)
 {
-    DebuggerActivation* thisObject = static_cast<DebuggerActivation*>(object);
+    DebuggerActivation* thisObject = jsCast<DebuggerActivation*>(object);
     thisObject->m_activation->methodTable()->defineSetter(thisObject->m_activation.get(), exec, propertyName, setterFunction, attributes);
 }
 
index b025194..95e222f 100644 (file)
@@ -45,7 +45,7 @@ Arguments::~Arguments()
 
 void Arguments::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -147,7 +147,7 @@ void Arguments::fillArgList(ExecState* exec, MarkedArgumentBuffer& args)
 
 bool Arguments::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
         if (i < thisObject->d->numParameters) {
             slot.setValue(thisObject->d->registers[thisObject->d->firstParameterIndex + i].get());
@@ -185,7 +185,7 @@ void Arguments::createStrictModeCalleeIfNecessary(ExecState* exec)
 
 bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
@@ -217,7 +217,7 @@ bool Arguments::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifi
 
 bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    Arguments* thisObject = static_cast<Arguments*>(object);
+    Arguments* thisObject = jsCast<Arguments*>(object);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
@@ -249,7 +249,7 @@ bool Arguments::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, cons
 
 void Arguments::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    Arguments* thisObject = static_cast<Arguments*>(object);
+    Arguments* thisObject = jsCast<Arguments*>(object);
     for (unsigned i = 0; i < thisObject->d->numArguments; ++i) {
         if (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])
             propertyNames.add(Identifier(exec, UString::number(i)));
@@ -263,7 +263,7 @@ void Arguments::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyN
 
 void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     if (i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
         if (i < thisObject->d->numParameters)
             thisObject->d->registers[thisObject->d->firstParameterIndex + i].set(exec->globalData(), thisObject->d->activation ? static_cast<JSCell*>(thisObject->d->activation.get()) : cell, value);
@@ -278,7 +278,7 @@ void Arguments::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue va
 
 void Arguments::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex && i < thisObject->d->numArguments && (!thisObject->d->deletedArguments || !thisObject->d->deletedArguments[i])) {
@@ -312,7 +312,7 @@ void Arguments::put(JSCell* cell, ExecState* exec, const Identifier& propertyNam
 
 bool Arguments::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i) 
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     if (i < thisObject->d->numArguments) {
         if (!thisObject->d->deletedArguments) {
             thisObject->d->deletedArguments = adoptArrayPtr(new bool[thisObject->d->numArguments]);
@@ -329,7 +329,7 @@ bool Arguments::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
 
 bool Arguments::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName) 
 {
-    Arguments* thisObject = static_cast<Arguments*>(cell);
+    Arguments* thisObject = jsCast<Arguments*>(cell);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex && i < thisObject->d->numArguments) {
index dbea177..9836a12 100644 (file)
@@ -65,12 +65,12 @@ void ArrayConstructor::finishCreation(ExecState* exec, ArrayPrototype* arrayProt
 
 bool ArrayConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(cell), propertyName, slot);
 }
 
 bool ArrayConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), static_cast<ArrayConstructor*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::arrayConstructorTable(exec), jsCast<ArrayConstructor*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions ---------------------------
index 9e7b941..b63d3aa 100644 (file)
@@ -127,12 +127,12 @@ void ArrayPrototype::finishCreation(JSGlobalObject* globalObject)
 
 bool ArrayPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(cell), propertyName, slot);
 }
 
 bool ArrayPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), static_cast<ArrayPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSArray>(exec, ExecState::arrayPrototypeTable(exec), jsCast<ArrayPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Array Functions ----------------------------
index e53c0f6..c7ea964 100644 (file)
@@ -64,12 +64,12 @@ void BooleanPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
 
 bool BooleanPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(cell), propertyName, slot);
 }
 
 bool BooleanPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), static_cast<BooleanPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<BooleanObject>(exec, ExecState::booleanPrototypeTable(exec), jsCast<BooleanPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions ---------------------------
index 9805e17..5c8d21a 100644 (file)
@@ -87,12 +87,12 @@ void DateConstructor::finishCreation(ExecState* exec, DatePrototype* datePrototy
 
 bool DateConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(cell), propertyName, slot);
 }
 
 bool DateConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), static_cast<DateConstructor*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::dateConstructorTable(exec), jsCast<DateConstructor*>(object), propertyName, descriptor);
 }
 
 // ECMA 15.9.3
index 04784d3..561bf62 100644 (file)
@@ -445,12 +445,12 @@ void DatePrototype::finishCreation(ExecState* exec, JSGlobalObject*)
 
 bool DatePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(cell), propertyName, slot);
 }
 
 bool DatePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), static_cast<DatePrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::dateTable(exec), jsCast<DatePrototype*>(object), propertyName, descriptor);
 }
 
 // Functions
index 8ad8031..904dc3c 100644 (file)
@@ -64,12 +64,12 @@ void ErrorPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
 
 bool ErrorPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(cell), propertyName, slot);
 }
 
 bool ErrorPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), static_cast<ErrorPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<ErrorInstance>(exec, ExecState::errorPrototypeTable(exec), jsCast<ErrorPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions ---------------------------
index 9ca1be7..e6fce61 100644 (file)
@@ -40,7 +40,7 @@ const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0, CREATE_METHOD_
 
 void ExecutableBase::clearCode(JSCell* cell)
 {
-    static_cast<ExecutableBase*>(cell)->clearCodeVirtual();
+    jsCast<ExecutableBase*>(cell)->clearCodeVirtual();
 }
 
 void ExecutableBase::clearCodeVirtual()
@@ -237,7 +237,7 @@ void EvalExecutable::jettisonOptimizedCode(JSGlobalData& globalData)
 
 void EvalExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    EvalExecutable* thisObject = static_cast<EvalExecutable*>(cell);
+    EvalExecutable* thisObject = jsCast<EvalExecutable*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -386,7 +386,7 @@ void ProgramExecutable::unlinkCalls()
 
 void ProgramExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ProgramExecutable* thisObject = static_cast<ProgramExecutable*>(cell);
+    ProgramExecutable* thisObject = jsCast<ProgramExecutable*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -629,7 +629,7 @@ void FunctionExecutable::jettisonOptimizedCodeForConstruct(JSGlobalData& globalD
 
 void FunctionExecutable::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    FunctionExecutable* thisObject = static_cast<FunctionExecutable*>(cell);
+    FunctionExecutable* thisObject = jsCast<FunctionExecutable*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index bef987f..17cbb44 100644 (file)
@@ -32,7 +32,7 @@ const ClassInfo GetterSetter::s_info = { "GetterSetter", 0, 0, 0, CREATE_METHOD_
 
 void GetterSetter::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    GetterSetter* thisObject = static_cast<GetterSetter*>(cell);
+    GetterSetter* thisObject = jsCast<GetterSetter*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     JSCell::visitChildren(thisObject, visitor);
index ffe13d4..a0a3193 100644 (file)
@@ -65,7 +65,7 @@ JSActivation::~JSActivation()
 
 void JSActivation::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSActivation* thisObject = static_cast<JSActivation*>(cell);
+    JSActivation* thisObject = jsCast<JSActivation*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -112,7 +112,7 @@ inline bool JSActivation::symbolTablePut(JSGlobalData& globalData, const Identif
 
 void JSActivation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSActivation* thisObject = static_cast<JSActivation*>(object);
+    JSActivation* thisObject = jsCast<JSActivation*>(object);
     SymbolTable::const_iterator end = thisObject->symbolTable().end();
     for (SymbolTable::const_iterator it = thisObject->symbolTable().begin(); it != end; ++it) {
         if (it->second.getAttributes() & DontEnum && mode != IncludeDontEnumProperties)
@@ -144,7 +144,7 @@ inline bool JSActivation::symbolTablePutWithAttributes(JSGlobalData& globalData,
 
 bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSActivation* thisObject = static_cast<JSActivation*>(cell);
+    JSActivation* thisObject = jsCast<JSActivation*>(cell);
     if (propertyName == exec->propertyNames().arguments) {
         slot.setCustom(thisObject, thisObject->getArgumentsGetter());
         return true;
@@ -167,7 +167,7 @@ bool JSActivation::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ident
 
 void JSActivation::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSActivation* thisObject = static_cast<JSActivation*>(cell);
+    JSActivation* thisObject = jsCast<JSActivation*>(cell);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
 
     if (thisObject->symbolTablePut(exec->globalData(), propertyName, value))
@@ -183,7 +183,7 @@ void JSActivation::put(JSCell* cell, ExecState* exec, const Identifier& property
 // FIXME: Make this function honor ReadOnly (const) and DontEnum
 void JSActivation::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
-    JSActivation* thisObject = static_cast<JSActivation*>(object);
+    JSActivation* thisObject = jsCast<JSActivation*>(object);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
 
     if (thisObject->symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
index 53a2967..6547381 100644 (file)
@@ -247,7 +247,7 @@ JSArray::~JSArray()
 
 bool JSArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     ArrayStorage* storage = thisObject->m_storage;
     
     if (i >= storage->m_length) {
@@ -277,7 +277,7 @@ bool JSArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned
 
 bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     if (propertyName == exec->propertyNames().length) {
         slot.setValue(jsNumber(thisObject->length()));
         return true;
@@ -293,7 +293,7 @@ bool JSArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier
 
 bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSArray* thisObject = static_cast<JSArray*>(object);
+    JSArray* thisObject = jsCast<JSArray*>(object);
     if (propertyName == exec->propertyNames().length) {
         descriptor.setDescriptor(jsNumber(thisObject->length()), DontDelete | DontEnum);
         return true;
@@ -328,7 +328,7 @@ bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const
 // ECMA 15.4.5.1
 void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex) {
@@ -351,7 +351,7 @@ void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName,
 
 void JSArray::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue value)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     thisObject->checkConsistency();
 
     ArrayStorage* storage = thisObject->m_storage;
@@ -490,7 +490,7 @@ NEVER_INLINE void JSArray::putSlowCase(ExecState* exec, unsigned i, JSValue valu
 
 bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     bool isArrayIndex;
     unsigned i = propertyName.toArrayIndex(isArrayIndex);
     if (isArrayIndex)
@@ -504,7 +504,7 @@ bool JSArray::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& pr
 
 bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     thisObject->checkConsistency();
 
     ArrayStorage* storage = thisObject->m_storage;
@@ -542,7 +542,7 @@ bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
 
 void JSArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSArray* thisObject = static_cast<JSArray*>(object);
+    JSArray* thisObject = jsCast<JSArray*>(object);
     // FIXME: Filling PropertyNameArray with an identifier for every integer
     // is incredibly inefficient for large arrays. We need a different approach,
     // which almost certainly means a different structure for PropertyNameArray.
@@ -881,7 +881,7 @@ void JSArray::unshiftCount(ExecState* exec, int count)
 
 void JSArray::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSArray* thisObject = static_cast<JSArray*>(cell);
+    JSArray* thisObject = jsCast<JSArray*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 845a9f3..cf0ba83 100644 (file)
@@ -89,7 +89,7 @@ JSBoundFunction* JSBoundFunction::create(ExecState* exec, JSGlobalObject* global
 
 bool JSBoundFunction::hasInstance(JSObject* object, ExecState* exec, JSValue value, JSValue)
 {
-    JSBoundFunction* thisObject = static_cast<JSBoundFunction*>(object);
+    JSBoundFunction* thisObject = jsCast<JSBoundFunction*>(object);
     // FIXME: our instanceof implementation will have already (incorrectly) performed
     // a [[Get]] of .prototype from the bound function object, which is incorrect!
     // https://bugs.webkit.org/show_bug.cgi?id=68656
@@ -116,7 +116,7 @@ void JSBoundFunction::finishCreation(ExecState* exec, NativeExecutable* executab
 
 void JSBoundFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSBoundFunction* thisObject = static_cast<JSBoundFunction*>(cell);
+    JSBoundFunction* thisObject = jsCast<JSBoundFunction*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 4d82cff..9973c56 100644 (file)
@@ -56,7 +56,7 @@ Structure* JSByteArray::createStructure(JSGlobalData& globalData, JSGlobalObject
 
 bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
+    JSByteArray* thisObject = jsCast<JSByteArray*>(cell);
     bool ok;
     unsigned index = propertyName.toUInt32(ok);
     if (ok && thisObject->canAccessIndex(index)) {
@@ -68,7 +68,7 @@ bool JSByteArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identi
 
 bool JSByteArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSByteArray* thisObject = static_cast<JSByteArray*>(object);
+    JSByteArray* thisObject = jsCast<JSByteArray*>(object);
     bool ok;
     unsigned index = propertyName.toUInt32(ok);
     if (ok && thisObject->canAccessIndex(index)) {
@@ -80,7 +80,7 @@ bool JSByteArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, co
 
 bool JSByteArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
-    JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
+    JSByteArray* thisObject = jsCast<JSByteArray*>(cell);
     if (thisObject->canAccessIndex(propertyName)) {
         slot.setValue(thisObject->getIndex(exec, propertyName));
         return true;
@@ -90,7 +90,7 @@ bool JSByteArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsig
 
 void JSByteArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSByteArray* thisObject = static_cast<JSByteArray*>(cell);
+    JSByteArray* thisObject = jsCast<JSByteArray*>(cell);
     bool ok;
     unsigned index = propertyName.toUInt32(ok);
     if (ok) {
@@ -102,12 +102,12 @@ void JSByteArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyN
 
 void JSByteArray::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
 {
-    static_cast<JSByteArray*>(cell)->setIndex(exec, propertyName, value);
+    jsCast<JSByteArray*>(cell)->setIndex(exec, propertyName, value);
 }
 
 void JSByteArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSByteArray* thisObject = static_cast<JSByteArray*>(object);
+    JSByteArray* thisObject = jsCast<JSByteArray*>(object);
     unsigned length = thisObject->m_storage->length();
     for (unsigned i = 0; i < length; ++i)
         propertyNames.add(Identifier::from(exec, i));
index a5e64ec..650321c 100644 (file)
@@ -199,8 +199,7 @@ namespace JSC {
 
     inline void JSCell::visitChildren(JSCell* cell, SlotVisitor& visitor)
     {
-        JSCell* thisObject = static_cast<JSCell*>(cell);
-        visitor.append(&thisObject->m_structure);
+        visitor.append(&cell->m_structure);
     }
 
     // --- JSValue inlines ----------------------------
@@ -331,6 +330,13 @@ namespace JSC {
         return cell->isZapped();
     }
 
+    template<typename To, typename From>
+    inline To jsCast(From* from)
+    {
+        ASSERT(from->inherits(&WTF::RemovePointer<To>::Type::s_info));
+        return static_cast<To>(from);
+    }
+
 } // namespace JSC
 
 #endif // JSCell_h
index eeaf7d5..5dd8537 100644 (file)
@@ -151,7 +151,7 @@ const UString JSFunction::calculatedDisplayName(ExecState* exec)
 
 void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -164,7 +164,7 @@ void JSFunction::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 CallType JSFunction::getCallData(JSCell* cell, CallData& callData)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     if (thisObject->isHostFunction()) {
         callData.native.function = thisObject->nativeFunction();
         return CallTypeHost;
@@ -197,7 +197,7 @@ JSValue JSFunction::lengthGetter(ExecState*, JSValue slotBase, const Identifier&
 
 bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     if (thisObject->isHostFunction())
         return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
 
@@ -253,7 +253,7 @@ bool JSFunction::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identif
 
 bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(object);
+    JSFunction* thisObject = jsCast<JSFunction*>(object);
     if (thisObject->isHostFunction())
         return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
     
@@ -301,7 +301,7 @@ bool JSFunction::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, con
 
 void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(object);
+    JSFunction* thisObject = jsCast<JSFunction*>(object);
     if (!thisObject->isHostFunction() && (mode == IncludeDontEnumProperties)) {
         // Make sure prototype has been reified.
         PropertySlot slot;
@@ -316,7 +316,7 @@ void JSFunction::getOwnPropertyNames(JSObject* object, ExecState* exec, Property
 
 void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     if (thisObject->isHostFunction()) {
         Base::put(thisObject, exec, propertyName, value, slot);
         return;
@@ -341,7 +341,7 @@ void JSFunction::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
 
 bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     if (thisObject->isHostFunction())
         return Base::deleteProperty(thisObject, exec, propertyName);
     if (propertyName == exec->propertyNames().arguments || propertyName == exec->propertyNames().length)
@@ -352,7 +352,7 @@ bool JSFunction::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
 // ECMA 13.2.2 [[Construct]]
 ConstructType JSFunction::getConstructData(JSCell* cell, ConstructData& constructData)
 {
-    JSFunction* thisObject = static_cast<JSFunction*>(cell);
+    JSFunction* thisObject = jsCast<JSFunction*>(cell);
     if (thisObject->isHostFunction()) {
         constructData.native.function = thisObject->nativeConstructor();
         return ConstructTypeHost;
index 03b7683..dc75069 100644 (file)
@@ -457,7 +457,7 @@ struct StackPreservingRecompiler : public MarkedBlock::VoidFunctor {
     {
         if (!cell->inherits(&FunctionExecutable::s_info))
             return;
-        FunctionExecutable* executable = static_cast<FunctionExecutable*>(cell);
+        FunctionExecutable* executable = jsCast<FunctionExecutable*>(cell);
         if (currentlyExecutingFunctions.contains(executable))
             return;
         executable->discardCode();
index 3db50aa..342985c 100644 (file)
@@ -140,7 +140,7 @@ void JSGlobalObject::init(JSObject* thisValue)
 
 void JSGlobalObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(cell);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
 
     if (thisObject->symbolTablePut(exec->globalData(), propertyName, value))
@@ -150,7 +150,7 @@ void JSGlobalObject::put(JSCell* cell, ExecState* exec, const Identifier& proper
 
 void JSGlobalObject::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
 
     if (thisObject->symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
@@ -168,7 +168,7 @@ void JSGlobalObject::putWithAttributes(JSObject* object, ExecState* exec, const
 
 void JSGlobalObject::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunc, unsigned attributes)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
     PropertySlot slot;
     if (!thisObject->symbolTableGet(propertyName, slot))
         JSVariableObject::defineGetter(thisObject, exec, propertyName, getterFunc, attributes);
@@ -176,7 +176,7 @@ void JSGlobalObject::defineGetter(JSObject* object, ExecState* exec, const Ident
 
 void JSGlobalObject::defineSetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* setterFunc, unsigned attributes)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
     PropertySlot slot;
     if (!thisObject->symbolTableGet(propertyName, slot))
         JSVariableObject::defineSetter(thisObject, exec, propertyName, setterFunc, attributes);
@@ -328,7 +328,7 @@ void JSGlobalObject::resetPrototype(JSGlobalData& globalData, JSValue prototype)
 
 void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 { 
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -431,7 +431,7 @@ void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count)
 
 bool JSGlobalObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(cell);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(cell);
     if (getStaticFunctionSlot<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, slot))
         return true;
     return thisObject->symbolTableGet(propertyName, slot);
@@ -439,7 +439,7 @@ bool JSGlobalObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ide
 
 bool JSGlobalObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSGlobalObject* thisObject = static_cast<JSGlobalObject*>(object);
+    JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
     if (getStaticFunctionDescriptor<JSVariableObject>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, descriptor))
         return true;
     return thisObject->symbolTableGet(propertyName, descriptor);
@@ -447,7 +447,7 @@ bool JSGlobalObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec,
 
 void JSGlobalObject::clearRareData(JSCell* cell)
 {
-    static_cast<JSGlobalObject*>(cell)->m_rareData.clear();
+    jsCast<JSGlobalObject*>(cell)->m_rareData.clear();
 }
 
 DynamicGlobalObjectScope::DynamicGlobalObjectScope(JSGlobalData& globalData, JSGlobalObject* dynamicGlobalObject)
index 66641f2..85bfb7a 100644 (file)
@@ -36,7 +36,7 @@ const ClassInfo JSGlobalThis::s_info = { "JSGlobalThis", &Base::s_info, 0, 0, CR
 
 void JSGlobalThis::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSGlobalThis* thisObject = static_cast<JSGlobalThis*>(cell);
+    JSGlobalThis* thisObject = jsCast<JSGlobalThis*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
 
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
index 6f43800..126fa6b 100644 (file)
@@ -600,12 +600,12 @@ const ClassInfo JSONObject::s_info = { "JSON", &JSNonFinalObject::s_info, 0, Exe
 
 bool JSONObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(cell), propertyName, slot);
 }
 
 bool JSONObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), static_cast<JSONObject*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::jsonTable(exec), jsCast<JSONObject*>(object), propertyName, descriptor);
 }
 
 class Walker {
index 9ebd7bf..9e0d59e 100644 (file)
@@ -73,7 +73,7 @@ static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* class
 
 void JSObject::finalize(JSCell* cell)
 {
-    delete [] static_cast<JSObject*>(cell)->m_propertyStorage.get();
+    delete [] jsCast<JSObject*>(cell)->m_propertyStorage.get();
 }
 
 void JSObject::vtableAnchor()
@@ -82,7 +82,7 @@ void JSObject::vtableAnchor()
 
 void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
 #if !ASSERT_DISABLED
     bool wasCheckingForDefaultMarkViolation = visitor.m_isCheckingForDefaultMarkViolation;
@@ -111,7 +111,7 @@ UString JSObject::className(const JSObject* object)
 
 bool JSObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
     return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
 }
 
@@ -123,7 +123,7 @@ static void throwSetterError(ExecState* exec)
 // ECMA 8.6.2.2
 void JSObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
     ASSERT(value);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(thisObject));
     JSGlobalData& globalData = exec->globalData();
@@ -200,7 +200,7 @@ void JSObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName
 void JSObject::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)
 {
     PutPropertySlot slot;
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
     thisObject->methodTable()->put(thisObject, exec, Identifier::from(exec, propertyName), value, slot);
 }
 
@@ -231,7 +231,7 @@ bool JSObject::hasProperty(ExecState* exec, unsigned propertyName) const
 // ECMA 8.6.2.5
 bool JSObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
 
     if (!thisObject->staticFunctionsReified())
         thisObject->reifyStaticFunctionsForDelete(exec);
@@ -262,7 +262,7 @@ bool JSObject::hasOwnProperty(ExecState* exec, const Identifier& propertyName) c
 
 bool JSObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
 {
-    JSObject* thisObject = static_cast<JSObject*>(cell);
+    JSObject* thisObject = jsCast<JSObject*>(cell);
     return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, propertyName));
 }
 
index 20b4387..88dd35b 100644 (file)
@@ -552,7 +552,7 @@ ALWAYS_INLINE bool JSObject::inlineGetOwnPropertySlot(ExecState* exec, const Ide
 // base class call to this.
 ALWAYS_INLINE bool JSObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return static_cast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot);
+    return jsCast<JSObject*>(cell)->inlineGetOwnPropertySlot(exec, propertyName, slot);
 }
 
 ALWAYS_INLINE bool JSCell::fastGetOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
index 52b82e7..f431042 100644 (file)
@@ -94,7 +94,7 @@ JSValue JSPropertyNameIterator::get(ExecState* exec, JSObject* base, size_t i)
 
 void JSPropertyNameIterator::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSPropertyNameIterator* thisObject = static_cast<JSPropertyNameIterator*>(cell);
+    JSPropertyNameIterator* thisObject = jsCast<JSPropertyNameIterator*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     visitor.appendValues(thisObject->m_jsStrings.get(), thisObject->m_jsStringsSize);
index 4591f5b..d90c68c 100644 (file)
@@ -36,7 +36,7 @@ const ClassInfo JSStaticScopeObject::s_info = { "Object", &Base::s_info, 0, 0, C
 
 void JSStaticScopeObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSStaticScopeObject* thisObject = static_cast<JSStaticScopeObject*>(cell);
+    JSStaticScopeObject* thisObject = jsCast<JSStaticScopeObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -51,7 +51,7 @@ JSObject* JSStaticScopeObject::toThisObject(JSCell*, ExecState* exec)
 
 void JSStaticScopeObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSStaticScopeObject* thisObject = static_cast<JSStaticScopeObject*>(cell);
+    JSStaticScopeObject* thisObject = jsCast<JSStaticScopeObject*>(cell);
     if (slot.isStrictMode()) {
         // Double lookup in strict mode, but this only occurs when
         // a) indirectly writing to an exception slot
@@ -75,7 +75,7 @@ void JSStaticScopeObject::put(JSCell* cell, ExecState* exec, const Identifier& p
 
 void JSStaticScopeObject::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
-    JSStaticScopeObject* thisObject = static_cast<JSStaticScopeObject*>(object);
+    JSStaticScopeObject* thisObject = jsCast<JSStaticScopeObject*>(object);
     if (thisObject->symbolTablePutWithAttributes(exec->globalData(), propertyName, value, attributes))
         return;
     
@@ -84,7 +84,7 @@ void JSStaticScopeObject::putWithAttributes(JSObject* object, ExecState* exec, c
 
 bool JSStaticScopeObject::getOwnPropertySlot(JSCell* cell, ExecState*, const Identifier& propertyName, PropertySlot& slot)
 {
-    return static_cast<JSStaticScopeObject*>(cell)->symbolTableGet(propertyName, slot);
+    return jsCast<JSStaticScopeObject*>(cell)->symbolTableGet(propertyName, slot);
 }
 
 }
index c4acb94..8ed9251 100644 (file)
@@ -52,7 +52,7 @@ JSString::~JSString()
 
 void JSString::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSString* thisObject = static_cast<JSString*>(cell);
+    JSString* thisObject = jsCast<JSString*>(cell);
     Base::visitChildren(thisObject, visitor);
     for (size_t i = 0; i < s_maxInternalRopeLength && thisObject->m_fibers[i]; ++i)
         visitor.append(&thisObject->m_fibers[i]);
@@ -201,12 +201,12 @@ JSObject* JSString::toObject(ExecState* exec, JSGlobalObject* globalObject) cons
 
 JSObject* JSString::toThisObject(JSCell* cell, ExecState* exec)
 {
-    return StringObject::create(exec, exec->lexicalGlobalObject(), static_cast<JSString*>(cell));
+    return StringObject::create(exec, exec->lexicalGlobalObject(), jsCast<JSString*>(cell));
 }
 
 bool JSString::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSString* thisObject = static_cast<JSString*>(cell);
+    JSString* thisObject = jsCast<JSString*>(cell);
     // The semantics here are really getPropertySlot, not getOwnPropertySlot.
     // This function should only be called by JSValue::get.
     if (thisObject->getStringPropertySlot(exec, propertyName, slot))
@@ -245,7 +245,7 @@ bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& pr
 
 bool JSString::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
-    JSString* thisObject = static_cast<JSString*>(cell);
+    JSString* thisObject = jsCast<JSString*>(cell);
     // The semantics here are really getPropertySlot, not getOwnPropertySlot.
     // This function should only be called by JSValue::get.
     if (thisObject->getStringPropertySlot(exec, propertyName, slot))
index edc41b5..9f38ea9 100644 (file)
@@ -43,7 +43,7 @@ JSVariableObject::~JSVariableObject()
 
 bool JSVariableObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSVariableObject* thisObject = static_cast<JSVariableObject*>(cell);
+    JSVariableObject* thisObject = jsCast<JSVariableObject*>(cell);
     if (thisObject->symbolTable().contains(propertyName.impl()))
         return false;
 
@@ -52,7 +52,7 @@ bool JSVariableObject::deleteProperty(JSCell* cell, ExecState* exec, const Ident
 
 void JSVariableObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSVariableObject* thisObject = static_cast<JSVariableObject*>(object);
+    JSVariableObject* thisObject = jsCast<JSVariableObject*>(object);
     SymbolTable::const_iterator end = thisObject->symbolTable().end();
     for (SymbolTable::const_iterator it = thisObject->symbolTable().begin(); it != end; ++it) {
         if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties))
index 34df7ea..ca5bd87 100644 (file)
@@ -32,7 +32,7 @@ JSWrapperObject::~JSWrapperObject()
 
 void JSWrapperObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSWrapperObject* thisObject = static_cast<JSWrapperObject*>(cell);
+    JSWrapperObject* thisObject = jsCast<JSWrapperObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 56b6b03..006559d 100644 (file)
@@ -106,12 +106,12 @@ void MathObject::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
 
 bool MathObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSObject>(exec, ExecState::mathTable(exec), jsCast<MathObject*>(cell), propertyName, slot);
 }
 
 bool MathObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), static_cast<MathObject*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::mathTable(exec), jsCast<MathObject*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions --------------------------------
index b519581..dde9278 100644 (file)
@@ -39,7 +39,7 @@ NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Str
 
 void NativeErrorConstructor::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    NativeErrorConstructor* thisObject = static_cast<NativeErrorConstructor*>(cell);
+    NativeErrorConstructor* thisObject = jsCast<NativeErrorConstructor*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 78177c4..084c63f 100644 (file)
@@ -73,12 +73,12 @@ void NumberConstructor::finishCreation(ExecState* exec, NumberPrototype* numberP
 
 bool NumberConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(cell), propertyName, slot);
+    return getStaticValueSlot<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>(cell), propertyName, slot);
 }
 
 bool NumberConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), static_cast<NumberConstructor*>(object), propertyName, descriptor);
+    return getStaticValueDescriptor<NumberConstructor, InternalFunction>(exec, ExecState::numberConstructorTable(exec), jsCast<NumberConstructor*>(object), propertyName, descriptor);
 }
 
 static JSValue numberConstructorNaNValue(ExecState*, JSValue, const Identifier&)
index 476775d..ef7bd2f 100644 (file)
@@ -85,12 +85,12 @@ void NumberPrototype::finishCreation(ExecState* exec, JSGlobalObject*)
 
 bool NumberPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>(cell), propertyName, slot);
 }
 
 bool NumberPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), static_cast<NumberPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<NumberObject>(exec, ExecState::numberPrototypeTable(exec), jsCast<NumberPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions ---------------------------
index 0dfe89e..5952ce8 100644 (file)
@@ -91,12 +91,12 @@ void ObjectConstructor::finishCreation(ExecState* exec, ObjectPrototype* objectP
 
 bool ObjectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>(cell), propertyName, slot);
 }
 
 bool ObjectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), static_cast<ObjectConstructor*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSObject>(exec, ExecState::objectConstructorTable(exec), jsCast<ObjectConstructor*>(object), propertyName, descriptor);
 }
 
 // ECMA 15.2.2
index 1fb777c..a1e4966 100644 (file)
@@ -77,7 +77,7 @@ void ObjectPrototype::finishCreation(JSGlobalData& globalData, JSGlobalObject*)
 
 void ObjectPrototype::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    ObjectPrototype* thisObject = static_cast<ObjectPrototype*>(cell);
+    ObjectPrototype* thisObject = jsCast<ObjectPrototype*>(cell);
     JSNonFinalObject::put(cell, exec, propertyName, value, slot);
 
     if (thisObject->m_hasNoPropertiesWithUInt32Names) {
@@ -89,7 +89,7 @@ void ObjectPrototype::put(JSCell* cell, ExecState* exec, const Identifier& prope
 
 bool ObjectPrototype::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
-    ObjectPrototype* thisObject = static_cast<ObjectPrototype*>(cell);
+    ObjectPrototype* thisObject = jsCast<ObjectPrototype*>(cell);
     if (thisObject->m_hasNoPropertiesWithUInt32Names)
         return false;
     return JSNonFinalObject::getOwnPropertySlotByIndex(thisObject, exec, propertyName, slot);
@@ -97,12 +97,12 @@ bool ObjectPrototype::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, u
 
 bool ObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(cell), propertyName, slot);
 }
 
 bool ObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), static_cast<ObjectPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<JSNonFinalObject>(exec, ExecState::objectPrototypeTable(exec), jsCast<ObjectPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions --------------------------------
index 6806343..03d2fd2 100644 (file)
@@ -206,12 +206,12 @@ JSValue RegExpConstructor::getRightContext(ExecState* exec) const
     
 bool RegExpConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(cell), propertyName, slot);
+    return getStaticValueSlot<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(cell), propertyName, slot);
 }
 
 bool RegExpConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(object), propertyName, descriptor);
+    return getStaticValueDescriptor<RegExpConstructor, InternalFunction>(exec, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(object), propertyName, descriptor);
 }
 
 JSValue regExpConstructorDollar1(ExecState* exec, JSValue slotBase, const Identifier&)
@@ -291,7 +291,7 @@ JSValue regExpConstructorRightContext(ExecState* exec, JSValue slotBase, const I
 
 void RegExpConstructor::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    lookupPut<RegExpConstructor, InternalFunction>(exec, propertyName, value, ExecState::regExpConstructorTable(exec), static_cast<RegExpConstructor*>(cell), slot);
+    lookupPut<RegExpConstructor, InternalFunction>(exec, propertyName, value, ExecState::regExpConstructorTable(exec), jsCast<RegExpConstructor*>(cell), slot);
 }
 
 void setRegExpConstructorInput(ExecState* exec, JSObject* baseObject, JSValue value)
index a4936f3..1cc898e 100644 (file)
@@ -52,7 +52,7 @@ namespace JSC {
     private:
         static bool getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             return JSArray::getOwnPropertySlot(thisObject, exec, propertyName, slot);
@@ -60,7 +60,7 @@ namespace JSC {
 
         static bool getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             return JSArray::getOwnPropertySlotByIndex(thisObject, exec, propertyName, slot);
@@ -68,7 +68,7 @@ namespace JSC {
 
         static bool getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(object);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             return JSArray::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
@@ -76,7 +76,7 @@ namespace JSC {
 
         static void put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue v, PutPropertySlot& slot)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             JSArray::put(thisObject, exec, propertyName, v, slot);
@@ -84,7 +84,7 @@ namespace JSC {
         
         static void putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue v)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             JSArray::putByIndex(thisObject, exec, propertyName, v);
@@ -92,7 +92,7 @@ namespace JSC {
 
         static bool deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             return JSArray::deleteProperty(thisObject, exec, propertyName);
@@ -100,7 +100,7 @@ namespace JSC {
 
         static bool deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(cell);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(cell);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             return JSArray::deletePropertyByIndex(thisObject, exec, propertyName);
@@ -108,7 +108,7 @@ namespace JSC {
 
         static void getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& arr, EnumerationMode mode = ExcludeDontEnumProperties)
         {
-            RegExpMatchesArray* thisObject = static_cast<RegExpMatchesArray*>(object);
+            RegExpMatchesArray* thisObject = jsCast<RegExpMatchesArray*>(object);
             if (thisObject->subclassData())
                 thisObject->fillArrayInstance(exec);
             JSArray::getOwnPropertyNames(thisObject, exec, arr, mode);
index 617d8e9..30c017e 100644 (file)
@@ -80,7 +80,7 @@ RegExpObject::~RegExpObject()
 
 void RegExpObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    RegExpObject* thisObject = static_cast<RegExpObject*>(cell);
+    RegExpObject* thisObject = jsCast<RegExpObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -93,12 +93,12 @@ void RegExpObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 
 bool RegExpObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(cell), propertyName, slot);
+    return getStaticValueSlot<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>(cell), propertyName, slot);
 }
 
 bool RegExpObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), static_cast<RegExpObject*>(object), propertyName, descriptor);
+    return getStaticValueDescriptor<RegExpObject, JSObject>(exec, ExecState::regExpTable(exec), jsCast<RegExpObject*>(object), propertyName, descriptor);
 }
 
 JSValue regExpObjectGlobal(ExecState*, JSValue slotBase, const Identifier&)
@@ -162,7 +162,7 @@ JSValue regExpObjectLastIndex(ExecState*, JSValue slotBase, const Identifier&)
 
 void RegExpObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    lookupPut<RegExpObject, JSObject>(exec, propertyName, value, ExecState::regExpTable(exec), static_cast<RegExpObject*>(cell), slot);
+    lookupPut<RegExpObject, JSObject>(exec, propertyName, value, ExecState::regExpTable(exec), jsCast<RegExpObject*>(cell), slot);
 }
 
 void setRegExpObjectLastIndex(ExecState* exec, JSObject* baseObject, JSValue value)
index ed9386f..6c79f94 100644 (file)
@@ -69,12 +69,12 @@ RegExpPrototype::RegExpPrototype(JSGlobalObject* globalObject, Structure* struct
 
 bool RegExpPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>(cell), propertyName, slot);
 }
 
 bool RegExpPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), static_cast<RegExpPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<RegExpObject>(exec, ExecState::regExpPrototypeTable(exec), jsCast<RegExpPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions ---------------------------
index 8366248..79f2a7a 100644 (file)
@@ -73,7 +73,7 @@ int ScopeChainNode::localDepth()
 
 void ScopeChainNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    ScopeChainNode* thisObject = static_cast<ScopeChainNode*>(cell);
+    ScopeChainNode* thisObject = jsCast<ScopeChainNode*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 1e804a9..96570b2 100644 (file)
@@ -61,12 +61,12 @@ void StringConstructor::finishCreation(ExecState* exec, StringPrototype* stringP
 
 bool StringConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>(cell), propertyName, slot);
 }
 
 bool StringConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), static_cast<StringConstructor*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<InternalFunction>(exec, ExecState::stringConstructorTable(exec), jsCast<StringConstructor*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions --------------------------------
index 7dfd124..3eed267 100644 (file)
@@ -47,7 +47,7 @@ void StringObject::finishCreation(JSGlobalData& globalData, JSString* string)
 
 bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    StringObject* thisObject = static_cast<StringObject*>(cell);
+    StringObject* thisObject = jsCast<StringObject*>(cell);
     if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot))
         return true;
     return JSObject::getOwnPropertySlot(thisObject, exec, propertyName, slot);
@@ -55,7 +55,7 @@ bool StringObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ident
     
 bool StringObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
 {
-    StringObject* thisObject = static_cast<StringObject*>(cell);
+    StringObject* thisObject = jsCast<StringObject*>(cell);
     if (thisObject->internalValue()->getStringPropertySlot(exec, propertyName, slot))
         return true;    
     return JSObject::getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
@@ -63,7 +63,7 @@ bool StringObject::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsi
 
 bool StringObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    StringObject* thisObject = static_cast<StringObject*>(object);
+    StringObject* thisObject = jsCast<StringObject*>(object);
     if (thisObject->internalValue()->getStringPropertyDescriptor(exec, propertyName, descriptor))
         return true;    
     return JSObject::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
@@ -78,7 +78,7 @@ void StringObject::put(JSCell* cell, ExecState* exec, const Identifier& property
 
 bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    StringObject* thisObject = static_cast<StringObject*>(cell);
+    StringObject* thisObject = jsCast<StringObject*>(cell);
     if (propertyName == exec->propertyNames().length)
         return false;
     bool isStrictUInt32;
@@ -90,7 +90,7 @@ bool StringObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifie
 
 void StringObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    StringObject* thisObject = static_cast<StringObject*>(object);
+    StringObject* thisObject = jsCast<StringObject*>(object);
     int size = thisObject->internalValue()->length();
     for (int i = 0; i < size; ++i)
         propertyNames.add(Identifier(exec, UString::number(i)));
index 5d501a1..3f623e2 100644 (file)
@@ -147,12 +147,12 @@ void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject*, JSString*
 
 bool StringPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(cell), propertyName, slot);
+    return getStaticFunctionSlot<StringObject>(exec, ExecState::stringTable(exec), jsCast<StringPrototype*>(cell), propertyName, slot);
 }
 
 bool StringPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), static_cast<StringPrototype*>(object), propertyName, descriptor);
+    return getStaticFunctionDescriptor<StringObject>(exec, ExecState::stringTable(exec), jsCast<StringPrototype*>(object), propertyName, descriptor);
 }
 
 // ------------------------------ Functions --------------------------
index 0410d4f..6b4ca2b 100644 (file)
@@ -742,7 +742,7 @@ void Structure::getPropertyNamesFromStructure(JSGlobalData& globalData, Property
 
 void Structure::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    Structure* thisObject = static_cast<Structure*>(cell);
+    Structure* thisObject = jsCast<Structure*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     JSCell::visitChildren(thisObject, visitor);
index 2bd781d..3a08569 100644 (file)
@@ -45,7 +45,7 @@ StructureChain::~StructureChain()
 
 void StructureChain::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    StructureChain* thisObject = static_cast<StructureChain*>(cell);
+    StructureChain* thisObject = jsCast<StructureChain*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
     size_t i = 0;
index 113c9bd..f95ff6a 100644 (file)
@@ -1,3 +1,37 @@
+2011-11-11  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add jsCast to replace static_cast
+        https://bugs.webkit.org/show_bug.cgi?id=72071
+
+        Reviewed by Geoffrey Garen.
+
+        Added new jsCast and changed all of the static_cast sites in functions that 
+        are in the MethodTable to use jsCast instead.
+
+        * UserObjectImp.cpp:
+        (UserObjectImp::getCallData):
+        (UserObjectImp::getOwnPropertyNames):
+        (UserObjectImp::getOwnPropertySlot):
+        (UserObjectImp::put):
+        (UserObjectImp::visitChildren):
+
+2011-11-10  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add jsCast to replace static_cast
+        https://bugs.webkit.org/show_bug.cgi?id=72071
+
+        Reviewed by Geoffrey Garen.
+
+        Added new jsCast and changed all of the static_cast sites in functions that 
+        are in the MethodTable to use jsCast instead.
+
+        * UserObjectImp.cpp:
+        (UserObjectImp::getCallData):
+        (UserObjectImp::getOwnPropertyNames):
+        (UserObjectImp::getOwnPropertySlot):
+        (UserObjectImp::put):
+        (UserObjectImp::visitChildren):
+
 2011-11-03  Filip Pizlo  <fpizlo@apple.com>
 
         JSC should be able to sample itself in a more flexible way than just sampling flags
index 424799a..8ea5d29 100644 (file)
@@ -48,7 +48,7 @@ UserObjectImp::~UserObjectImp()
 
 CallType UserObjectImp::getCallData(JSCell* cell, CallData& callData)
 {
-    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
+    UserObjectImp* thisObject = jsCast<UserObjectImp*>(cell);
     return thisObject->fJSUserObject ? thisObject->fJSUserObject->getCallData(callData) : CallTypeNone;
 }
 
@@ -92,7 +92,7 @@ JSValue UserObjectImp::callAsFunction(ExecState *exec)
 
 void UserObjectImp::getOwnPropertyNames(JSObject* object, ExecState *exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    UserObjectImp* thisObject = static_cast<UserObjectImp*>(object);
+    UserObjectImp* thisObject = jsCast<UserObjectImp*>(object);
     JSUserObject* ptr = thisObject->GetJSUserObject();
     if (ptr) {
         CFArrayRef cfPropertyNames = ptr->CopyPropertyNames();
@@ -126,7 +126,7 @@ JSValue UserObjectImp::userObjectGetter(ExecState*, JSValue slotBase, const Iden
 
 bool UserObjectImp::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
+    UserObjectImp* thisObject = jsCast<UserObjectImp*>(cell);
     if (!thisObject->fJSUserObject)
         return false;
 
@@ -150,7 +150,7 @@ bool UserObjectImp::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Iden
 
 void UserObjectImp::put(JSCell* cell, ExecState *exec, const Identifier &propertyName, JSValue value, PutPropertySlot&)
 {
-    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
+    UserObjectImp* thisObject = jsCast<UserObjectImp*>(cell);
     if (!thisObject->fJSUserObject)
         return;
     
@@ -287,7 +287,7 @@ bool UserObjectImp::toBoolean(ExecState *exec) const
 
 void UserObjectImp::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    UserObjectImp* thisObject = static_cast<UserObjectImp*>(cell);
+    UserObjectImp* thisObject = jsCast<UserObjectImp*>(cell);
     JSObject::visitChildren(thisObject, visitor);
     if (thisObject->fJSUserObject)
         thisObject->fJSUserObject->Mark();
index f93a53a..3fe448e 100644 (file)
@@ -1,3 +1,156 @@
+2011-11-11  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add jsCast to replace static_cast
+        https://bugs.webkit.org/show_bug.cgi?id=72071
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests. 
+
+        Added new jsCast and changed all of the static_cast sites in functions that 
+        are in the MethodTable to use jsCast instead.
+
+        * bindings/js/JSAttrCustom.cpp:
+        (WebCore::JSAttr::visitChildren):
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::JSAudioContext::visitChildren):
+        * bindings/js/JSCSSRuleCustom.cpp:
+        (WebCore::JSCSSRule::visitChildren):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::visitChildren):
+        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+        (WebCore::toHTMLCanvasStyle):
+        * bindings/js/JSCanvasRenderingContextCustom.cpp:
+        (WebCore::JSCanvasRenderingContext::visitChildren):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::visitChildren):
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::getOwnPropertyNames):
+        (WebCore::JSDOMStringMap::deleteProperty):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::toThisObject):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::visitChildren):
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
+        (WebCore::JSDOMWindow::put):
+        (WebCore::JSDOMWindow::deleteProperty):
+        (WebCore::JSDOMWindow::getPropertyNames):
+        (WebCore::JSDOMWindow::getOwnPropertyNames):
+        (WebCore::JSDOMWindow::defineGetter):
+        (WebCore::JSDOMWindow::defineSetter):
+        (WebCore::JSDOMWindow::defineOwnProperty):
+        * bindings/js/JSDOMWindowShell.cpp:
+        (WebCore::JSDOMWindowShell::className):
+        (WebCore::JSDOMWindowShell::getOwnPropertySlot):
+        (WebCore::JSDOMWindowShell::getOwnPropertyDescriptor):
+        (WebCore::JSDOMWindowShell::put):
+        (WebCore::JSDOMWindowShell::putWithAttributes):
+        (WebCore::JSDOMWindowShell::defineOwnProperty):
+        (WebCore::JSDOMWindowShell::deleteProperty):
+        (WebCore::JSDOMWindowShell::getPropertyNames):
+        (WebCore::JSDOMWindowShell::getOwnPropertyNames):
+        (WebCore::JSDOMWindowShell::defineGetter):
+        (WebCore::JSDOMWindowShell::defineSetter):
+        * bindings/js/JSHTMLAppletElementCustom.cpp:
+        (WebCore::JSHTMLAppletElement::getCallData):
+        * bindings/js/JSHTMLEmbedElementCustom.cpp:
+        (WebCore::JSHTMLEmbedElement::getCallData):
+        * bindings/js/JSHTMLObjectElementCustom.cpp:
+        (WebCore::JSHTMLObjectElement::getCallData):
+        * bindings/js/JSHistoryCustom.cpp:
+        (WebCore::JSHistory::deleteProperty):
+        (WebCore::JSHistory::getOwnPropertyNames):
+        * bindings/js/JSJavaScriptAudioNodeCustom.cpp:
+        (WebCore::JSJavaScriptAudioNode::visitChildren):
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::JSLocation::deleteProperty):
+        (WebCore::JSLocation::getOwnPropertyNames):
+        * bindings/js/JSMessageChannelCustom.cpp:
+        (WebCore::JSMessageChannel::visitChildren):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::JSMessagePort::visitChildren):
+        * bindings/js/JSNamedNodeMapCustom.cpp:
+        (WebCore::JSNamedNodeMap::visitChildren):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::JSNode::visitChildren):
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::JSNodeFilter::visitChildren):
+        * bindings/js/JSNodeIteratorCustom.cpp:
+        (WebCore::JSNodeIterator::visitChildren):
+        * bindings/js/JSSVGElementInstanceCustom.cpp:
+        (WebCore::JSSVGElementInstance::visitChildren):
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorker::visitChildren):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::deleteProperty):
+        (WebCore::JSStorage::getOwnPropertyNames):
+        * bindings/js/JSStyleSheetCustom.cpp:
+        (WebCore::JSStyleSheet::visitChildren):
+        * bindings/js/JSTreeWalkerCustom.cpp:
+        (WebCore::JSTreeWalker::visitChildren):
+        * bindings/js/JSWebGLRenderingContextCustom.cpp:
+        (WebCore::JSWebGLRenderingContext::visitChildren):
+        * bindings/js/JSWorkerContextCustom.cpp:
+        (WebCore::JSWorkerContext::visitChildren):
+        * bindings/js/JSXMLHttpRequestCustom.cpp:
+        (WebCore::JSXMLHttpRequest::visitChildren):
+        * bindings/js/JSXPathResultCustom.cpp:
+        (WebCore::JSXPathResult::visitChildren):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterface::getOwnPropertySlot):
+        (WebCore::JSTestInterface::getOwnPropertyDescriptor):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertySlot):
+        (WebCore::JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor):
+        (WebCore::JSTestMediaQueryListListener::getOwnPropertySlot):
+        (WebCore::JSTestMediaQueryListListener::getOwnPropertyDescriptor):
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructor::getOwnPropertySlot):
+        (WebCore::JSTestNamedConstructor::getOwnPropertyDescriptor):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObjPrototype::getOwnPropertySlot):
+        (WebCore::JSTestObjPrototype::getOwnPropertyDescriptor):
+        (WebCore::JSTestObj::getOwnPropertySlot):
+        (WebCore::JSTestObj::getOwnPropertyDescriptor):
+        (WebCore::JSTestObj::put):
+        (WebCore::JSTestObj::visitChildren):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertySlot):
+        (WebCore::JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor):
+        * bridge/objc/objc_runtime.mm:
+        (JSC::Bindings::ObjcFallbackObjectImp::getCallData):
+        (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
+        * bridge/qt/qt_instance.cpp:
+        (JSC::Bindings::QtRuntimeObject::visitChildren):
+        * bridge/qt/qt_runtime.cpp:
+        (JSC::Bindings::QtRuntimeMetaMethod::visitChildren):
+        (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
+        (JSC::Bindings::QtRuntimeMetaMethod::getOwnPropertyDescriptor):
+        (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
+        (JSC::Bindings::QtRuntimeConnectionMethod::getOwnPropertyDescriptor):
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::getOwnPropertyNames):
+        (JSC::RuntimeArray::getOwnPropertySlot):
+        (JSC::RuntimeArray::getOwnPropertyDescriptor):
+        (JSC::RuntimeArray::getOwnPropertySlotByIndex):
+        (JSC::RuntimeArray::put):
+        (JSC::RuntimeArray::putByIndex):
+        * bridge/runtime_method.cpp:
+        (JSC::RuntimeMethod::getOwnPropertySlot):
+        (JSC::RuntimeMethod::getOwnPropertyDescriptor):
+        * bridge/runtime_object.cpp:
+        (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
+        (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
+        (JSC::Bindings::RuntimeObject::put):
+        (JSC::Bindings::RuntimeObject::defaultValue):
+        (JSC::Bindings::RuntimeObject::getCallData):
+        (JSC::Bindings::RuntimeObject::getConstructData):
+        (JSC::Bindings::RuntimeObject::getOwnPropertyNames):
+
 2011-11-11  Vincent Scheib  <scheib@chromium.org>
 
         Unreviewed, rolling out r99994.
index ac1ae60..640edf1 100644 (file)
@@ -41,7 +41,7 @@ using namespace HTMLNames;
 
 void JSAttr::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSAttr* thisObject = static_cast<JSAttr*>(cell);
+    JSAttr* thisObject = jsCast<JSAttr*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 5bfa35f..ca1db34 100644 (file)
@@ -41,7 +41,7 @@ namespace WebCore {
 
 void JSAudioContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSAudioContext* thisObject = static_cast<JSAudioContext*>(cell);
+    JSAudioContext* thisObject = jsCast<JSAudioContext*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 4ecaa52..905b036 100644 (file)
@@ -50,7 +50,7 @@ namespace WebCore {
 
 void JSCSSRule::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSCSSRule* thisObject = static_cast<JSCSSRule*>(cell);
+    JSCSSRule* thisObject = jsCast<JSCSSRule*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index e0d6b7f..86dc64f 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
 void JSCSSStyleDeclaration::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSCSSStyleDeclaration* thisObject = static_cast<JSCSSStyleDeclaration*>(cell);
+    JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index e78e2b8..178b130 100644 (file)
@@ -53,9 +53,9 @@ static PassRefPtr<CanvasStyle> toHTMLCanvasStyle(ExecState*, JSValue value)
         return 0;
     JSObject* object = asObject(value);
     if (object->inherits(&JSCanvasGradient::s_info))
-        return CanvasStyle::createFromGradient(static_cast<JSCanvasGradient*>(object)->impl());
+        return CanvasStyle::createFromGradient(jsCast<JSCanvasGradient*>(object)->impl());
     if (object->inherits(&JSCanvasPattern::s_info))
-        return CanvasStyle::createFromPattern(static_cast<JSCanvasPattern*>(object)->impl());
+        return CanvasStyle::createFromPattern(jsCast<JSCanvasPattern*>(object)->impl());
     return 0;
 }
 
index 19379ad..40d5222 100644 (file)
@@ -41,7 +41,7 @@ namespace WebCore {
 
 void JSCanvasRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSCanvasRenderingContext* thisObject = static_cast<JSCanvasRenderingContext*>(cell);
+    JSCanvasRenderingContext* thisObject = jsCast<JSCanvasRenderingContext*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index ee3c3f4..8c574d9 100644 (file)
@@ -67,7 +67,7 @@ void JSDOMGlobalObject::finishCreation(JSGlobalData& globalData, JSGlobalThis* t
 
 void JSDOMGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSDOMGlobalObject* thisObject = static_cast<JSDOMGlobalObject*>(cell);
+    JSDOMGlobalObject* thisObject = jsCast<JSDOMGlobalObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index cb573db..cbe6d94 100644 (file)
@@ -48,7 +48,7 @@ JSValue JSDOMStringMap::nameGetter(ExecState* exec, JSValue slotBase, const Iden
 
 void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSDOMStringMap* thisObject = static_cast<JSDOMStringMap*>(object);
+    JSDOMStringMap* thisObject = jsCast<JSDOMStringMap*>(object);
     Vector<String> names;
     thisObject->m_impl->getNames(names);
     size_t length = names.size();
@@ -60,7 +60,7 @@ void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* exec, Prop
 
 bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSDOMStringMap* thisObject = static_cast<JSDOMStringMap*>(cell);
+    JSDOMStringMap* thisObject = jsCast<JSDOMStringMap*>(cell);
     AtomicString stringName = identifierToAtomicString(propertyName);
     if (!thisObject->m_impl->contains(stringName))
         return false;
index ebbde0a..e68bca1 100644 (file)
@@ -152,7 +152,7 @@ void JSDOMWindowBase::willRemoveFromWindowShell()
 
 JSObject* JSDOMWindowBase::toThisObject(JSCell* cell, ExecState*)
 {
-    return static_cast<JSDOMWindowBase*>(cell)->shell();
+    return jsCast<JSDOMWindowBase*>(cell)->shell();
 }
 
 JSDOMWindowShell* JSDOMWindowBase::shell() const
index 2e1a92f..babd21f 100644 (file)
@@ -79,7 +79,7 @@ namespace WebCore {
 
 void JSDOMWindow::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
@@ -123,7 +123,7 @@ static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, const Identifi
 
 bool JSDOMWindow::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     // When accessing a Window cross-domain, functions are always the native built-in ones, and they
     // are not affected by properties changed on the Window or anything in its prototype chain.
     // This is consistent with the behavior of Firefox.
@@ -269,7 +269,7 @@ bool JSDOMWindow::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identi
 
 bool JSDOMWindow::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Never allow cross-domain getOwnPropertyDescriptor
     if (!thisObject->allowsAccessFrom(exec))
         return false;
@@ -342,7 +342,7 @@ bool JSDOMWindow::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, co
 
 void JSDOMWindow::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     if (!thisObject->impl()->frame())
         return;
 
@@ -362,7 +362,7 @@ void JSDOMWindow::put(JSCell* cell, ExecState* exec, const Identifier& propertyN
 
 bool JSDOMWindow::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(cell);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);
     // Only allow deleting properties by frames in the same origin.
     if (!thisObject->allowsAccessFrom(exec))
         return false;
@@ -371,7 +371,7 @@ bool JSDOMWindow::deleteProperty(JSCell* cell, ExecState* exec, const Identifier
 
 void JSDOMWindow::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Only allow the window to enumerated by frames in the same origin.
     if (!thisObject->allowsAccessFrom(exec))
         return;
@@ -380,7 +380,7 @@ void JSDOMWindow::getPropertyNames(JSObject* object, ExecState* exec, PropertyNa
 
 void JSDOMWindow::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Only allow the window to enumerated by frames in the same origin.
     if (!thisObject->allowsAccessFrom(exec))
         return;
@@ -389,7 +389,7 @@ void JSDOMWindow::getOwnPropertyNames(JSObject* object, ExecState* exec, Propert
 
 void JSDOMWindow::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Only allow defining getters by frames in the same origin.
     if (!thisObject->allowsAccessFrom(exec))
         return;
@@ -403,7 +403,7 @@ void JSDOMWindow::defineGetter(JSObject* object, ExecState* exec, const Identifi
 
 void JSDOMWindow::defineSetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Only allow defining setters by frames in the same origin.
     if (!thisObject->allowsAccessFrom(exec))
         return;
@@ -412,7 +412,7 @@ void JSDOMWindow::defineSetter(JSObject* object, ExecState* exec, const Identifi
 
 bool JSDOMWindow::defineOwnProperty(JSC::JSObject* object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor, bool shouldThrow)
 {
-    JSDOMWindow* thisObject = static_cast<JSDOMWindow*>(object);
+    JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
     // Only allow defining properties in this way by frames in the same origin, as it allows setters to be introduced.
     if (!thisObject->allowsAccessFrom(exec))
         return false;
index ffa9e7c..25d384a 100644 (file)
@@ -86,67 +86,67 @@ void JSDOMWindowShell::setWindow(PassRefPtr<DOMWindow> domWindow)
 
 UString JSDOMWindowShell::className(const JSObject* object)
 {
-    const JSDOMWindowShell* thisObject = static_cast<const JSDOMWindowShell*>(object);
+    const JSDOMWindowShell* thisObject = jsCast<const JSDOMWindowShell*>(object);
     return thisObject->window()->methodTable()->className(thisObject->window());
 }
 
 bool JSDOMWindowShell::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(cell);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(cell);
     return thisObject->window()->methodTable()->getOwnPropertySlot(thisObject->window(), exec, propertyName, slot);
 }
 
 bool JSDOMWindowShell::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     return thisObject->window()->methodTable()->getOwnPropertyDescriptor(thisObject->window(), exec, propertyName, descriptor);
 }
 
 void JSDOMWindowShell::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(cell);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(cell);
     thisObject->window()->methodTable()->put(thisObject->window(), exec, propertyName, value, slot);
 }
 
 void JSDOMWindowShell::putWithAttributes(JSObject* object, ExecState* exec, const Identifier& propertyName, JSValue value, unsigned attributes)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     thisObject->window()->putWithAttributes(thisObject->window(), exec, propertyName, value, attributes);
 }
 
 bool JSDOMWindowShell::defineOwnProperty(JSC::JSObject* object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor, bool shouldThrow)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     return thisObject->window()->methodTable()->defineOwnProperty(thisObject->window(), exec, propertyName, descriptor, shouldThrow);
 }
 
 bool JSDOMWindowShell::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(cell);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(cell);
     return thisObject->window()->methodTable()->deleteProperty(thisObject->window(), exec, propertyName);
 }
 
 void JSDOMWindowShell::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     thisObject->window()->methodTable()->getPropertyNames(thisObject->window(), exec, propertyNames, mode);
 }
 
 void JSDOMWindowShell::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     thisObject->window()->methodTable()->getOwnPropertyNames(thisObject->window(), exec, propertyNames, mode);
 }
 
 void JSDOMWindowShell::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     thisObject->window()->methodTable()->defineGetter(thisObject->window(), exec, propertyName, getterFunction, attributes);
 }
 
 void JSDOMWindowShell::defineSetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes)
 {
-    JSDOMWindowShell* thisObject = static_cast<JSDOMWindowShell*>(object);
+    JSDOMWindowShell* thisObject = jsCast<JSDOMWindowShell*>(object);
     thisObject->window()->methodTable()->defineSetter(thisObject->window(), exec, propertyName, setterFunction, attributes);
 }
 
index 30e1578..8ca2c87 100644 (file)
@@ -50,7 +50,7 @@ bool JSHTMLAppletElement::putDelegate(ExecState* exec, const Identifier& propert
 
 CallType JSHTMLAppletElement::getCallData(JSCell* cell, CallData& callData)
 {
-    return runtimeObjectGetCallData(static_cast<JSHTMLAppletElement*>(cell), callData);
+    return runtimeObjectGetCallData(jsCast<JSHTMLAppletElement*>(cell), callData);
 }
 
 } // namespace WebCore
index 5b5c411..9c2c2d2 100644 (file)
@@ -50,7 +50,7 @@ bool JSHTMLEmbedElement::putDelegate(ExecState* exec, const Identifier& property
 
 CallType JSHTMLEmbedElement::getCallData(JSCell* cell, CallData& callData)
 {
-    return runtimeObjectGetCallData(static_cast<JSHTMLEmbedElement*>(cell), callData);
+    return runtimeObjectGetCallData(jsCast<JSHTMLEmbedElement*>(cell), callData);
 }
 
 } // namespace WebCore
index afbee0e..062eddd 100644 (file)
@@ -50,7 +50,7 @@ bool JSHTMLObjectElement::putDelegate(ExecState* exec, const Identifier& propert
 
 CallType JSHTMLObjectElement::getCallData(JSCell* cell, CallData& callData)
 {
-    return runtimeObjectGetCallData(static_cast<JSHTMLObjectElement*>(cell), callData);
+    return runtimeObjectGetCallData(jsCast<JSHTMLObjectElement*>(cell), callData);
 }
 
 } // namespace WebCore
index c7e6a85..64729b2 100644 (file)
@@ -148,7 +148,7 @@ bool JSHistory::putDelegate(ExecState* exec, const Identifier&, JSValue, PutProp
 
 bool JSHistory::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSHistory* thisObject = static_cast<JSHistory*>(cell);
+    JSHistory* thisObject = jsCast<JSHistory*>(cell);
     // Only allow deleting by frames in the same origin.
     if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return false;
@@ -157,7 +157,7 @@ bool JSHistory::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
 
 void JSHistory::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSHistory* thisObject = static_cast<JSHistory*>(object);
+    JSHistory* thisObject = jsCast<JSHistory*>(object);
     // Only allow the history object to enumerated by frames in the same origin.
     if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return;
index 4ad4d4d..99f1988 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 void JSJavaScriptAudioNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSJavaScriptAudioNode* thisObject = static_cast<JSJavaScriptAudioNode*>(cell);
+    JSJavaScriptAudioNode* thisObject = jsCast<JSJavaScriptAudioNode*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 7ff7090..a18831c 100644 (file)
@@ -154,7 +154,7 @@ bool JSLocation::putDelegate(ExecState* exec, const Identifier& propertyName, JS
 
 bool JSLocation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSLocation* thisObject = static_cast<JSLocation*>(cell);
+    JSLocation* thisObject = jsCast<JSLocation*>(cell);
     // Only allow deleting by frames in the same origin.
     if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return false;
@@ -163,7 +163,7 @@ bool JSLocation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
 
 void JSLocation::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSLocation* thisObject = static_cast<JSLocation*>(object);
+    JSLocation* thisObject = jsCast<JSLocation*>(object);
     // Only allow the location object to enumerated by frames in the same origin.
     if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
         return;
index beea32e..24311af 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 void JSMessageChannel::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSMessageChannel* thisObject = static_cast<JSMessageChannel*>(cell);
+    JSMessageChannel* thisObject = jsCast<JSMessageChannel*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 51ebf88..711166b 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
 
 void JSMessagePort::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSMessagePort* thisObject = static_cast<JSMessagePort*>(cell);
+    JSMessagePort* thisObject = jsCast<JSMessagePort*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 45a9ac0..871f06a 100644 (file)
@@ -48,7 +48,7 @@ JSValue JSNamedNodeMap::nameGetter(ExecState* exec, JSValue slotBase, const Iden
 
 void JSNamedNodeMap::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSNamedNodeMap* thisObject = static_cast<JSNamedNodeMap*>(cell);
+    JSNamedNodeMap* thisObject = jsCast<JSNamedNodeMap*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 3f2f159..cd8df9a 100644 (file)
@@ -194,7 +194,7 @@ ScopeChainNode* JSNode::pushEventHandlerScope(ExecState*, ScopeChainNode* node)
 
 void JSNode::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSNode* thisObject = static_cast<JSNode*>(cell);
+    JSNode* thisObject = jsCast<JSNode*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index e94098b..f402342 100644 (file)
@@ -38,7 +38,7 @@ namespace WebCore {
 
 void JSNodeFilter::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSNodeFilter* thisObject = static_cast<JSNodeFilter*>(cell);
+    JSNodeFilter* thisObject = jsCast<JSNodeFilter*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 813e000..b208a6e 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 void JSNodeIterator::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSNodeIterator* thisObject = static_cast<JSNodeIterator*>(cell);
+    JSNodeIterator* thisObject = jsCast<JSNodeIterator*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index beb99a8..2353264 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 void JSSVGElementInstance::visitChildren(JSC::JSCell* cell, JSC::SlotVisitor& visitor)
 {
-    JSSVGElementInstance* thisObject = static_cast<JSSVGElementInstance*>(cell);
+    JSSVGElementInstance* thisObject = JSC::jsCast<JSSVGElementInstance*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & JSC::OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 920ebd5..4720787 100644 (file)
@@ -45,7 +45,7 @@ namespace WebCore {
 
 void JSSharedWorker::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSSharedWorker* thisObject = static_cast<JSSharedWorker*>(cell);
+    JSSharedWorker* thisObject = jsCast<JSSharedWorker*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index b321b9b..dad77c6 100644 (file)
@@ -47,7 +47,7 @@ JSValue JSStorage::nameGetter(ExecState* exec, JSValue slotBase, const Identifie
 
 bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    JSStorage* thisObject = static_cast<JSStorage*>(cell);
+    JSStorage* thisObject = jsCast<JSStorage*>(cell);
     // Only perform the custom delete if the object doesn't have a native property by this name.
     // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
     // the native property slots manually.
@@ -65,7 +65,7 @@ bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
 
 void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    JSStorage* thisObject = static_cast<JSStorage*>(object);
+    JSStorage* thisObject = jsCast<JSStorage*>(object);
     unsigned length = thisObject->m_impl->length();
     for (unsigned i = 0; i < length; ++i)
         propertyNames.add(Identifier(exec, stringToUString(thisObject->m_impl->key(i))));
index 5defbcc..48e3d0d 100644 (file)
@@ -37,7 +37,7 @@ namespace WebCore {
 
 void JSStyleSheet::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSStyleSheet* thisObject = static_cast<JSStyleSheet*>(cell);
+    JSStyleSheet* thisObject = jsCast<JSStyleSheet*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 57f23b0..df16c88 100644 (file)
@@ -31,7 +31,7 @@ namespace WebCore {
 
 void JSTreeWalker::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSTreeWalker* thisObject = static_cast<JSTreeWalker*>(cell);
+    JSTreeWalker* thisObject = jsCast<JSTreeWalker*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 8b5b11c..037610a 100644 (file)
@@ -200,7 +200,7 @@ static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExten
 
 void JSWebGLRenderingContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSWebGLRenderingContext* thisObject = static_cast<JSWebGLRenderingContext*>(cell);
+    JSWebGLRenderingContext* thisObject = jsCast<JSWebGLRenderingContext*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 8d9eabe..7612686 100644 (file)
@@ -55,7 +55,7 @@ namespace WebCore {
 
 void JSWorkerContext::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSWorkerContext* thisObject = static_cast<JSWorkerContext*>(cell);
+    JSWorkerContext* thisObject = jsCast<JSWorkerContext*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 078b4b5..7736dba 100644 (file)
@@ -56,7 +56,7 @@ namespace WebCore {
 
 void JSXMLHttpRequest::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSXMLHttpRequest* thisObject = static_cast<JSXMLHttpRequest*>(cell);
+    JSXMLHttpRequest* thisObject = jsCast<JSXMLHttpRequest*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 028e4d8..bdaf195 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 void JSXPathResult::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSXPathResult* thisObject = static_cast<JSXPathResult*>(cell);
+    JSXPathResult* thisObject = jsCast<JSXPathResult*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index 476f983..e8f9034 100644 (file)
@@ -967,13 +967,13 @@ sub GenerateHeader
     if ($dataNode->extendedAttributes->{"InlineGetOwnPropertySlot"} && !$dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
         push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertySlot(JSC::JSCell* cell, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertySlot& slot)\n");
         push(@headerContent, "{\n");
-        push(@headerContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+        push(@headerContent, "    ${className}* thisObject = JSC::jsCast<${className}*>(cell);\n");
         push(@headerContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
         push(@headerContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1));
         push(@headerContent, "}\n\n");
         push(@headerContent, "ALWAYS_INLINE bool ${className}::getOwnPropertyDescriptor(JSC::JSObject* object, JSC::ExecState* exec, const JSC::Identifier& propertyName, JSC::PropertyDescriptor& descriptor)\n");
         push(@headerContent, "{\n");
-        push(@headerContent, "    ${className}* thisObject = static_cast<${className}*>(object);\n");
+        push(@headerContent, "    ${className}* thisObject = JSC::jsCast<${className}*>(object);\n");
         push(@headerContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
         push(@headerContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 1));
         push(@headerContent, "}\n\n");
@@ -1435,7 +1435,7 @@ sub GenerateImplementation
     if ($numConstants > 0 || $numFunctions > 0 || $dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) {
         push(@implContent, "bool ${className}Prototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}Prototype* thisObject = static_cast<${className}Prototype*>(cell);\n");
+        push(@implContent, "    ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n");
 
         if ($dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) {
             push(@implContent, "    if (thisObject->getOwnPropertySlotDelegate(exec, propertyName, slot))\n");
@@ -1455,7 +1455,7 @@ sub GenerateImplementation
 
         push(@implContent, "bool ${className}Prototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}Prototype* thisObject = static_cast<${className}Prototype*>(object);\n");
+        push(@implContent, "    ${className}Prototype* thisObject = jsCast<${className}Prototype*>(object);\n");
 
         if ($dataNode->extendedAttributes->{"DelegatingPrototypeGetOwnPropertySlot"}) {
             push(@implContent, "    if (thisObject->getOwnPropertyDescriptorDelegate(exec, propertyName, descriptor))\n");
@@ -1477,7 +1477,7 @@ sub GenerateImplementation
     if ($dataNode->extendedAttributes->{"DelegatingPrototypePutFunction"}) {
         push(@implContent, "void ${className}Prototype::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}Prototype* thisObject = static_cast<${className}Prototype*>(cell);\n");
+        push(@implContent, "    ${className}Prototype* thisObject = jsCast<${className}Prototype*>(cell);\n");
         push(@implContent, "    if (thisObject->putDelegate(exec, propertyName, value, slot))\n");
         push(@implContent, "        return;\n");
         push(@implContent, "    Base::put(thisObject, exec, propertyName, value, slot);\n");
@@ -1571,13 +1571,13 @@ sub GenerateImplementation
         if (!$dataNode->extendedAttributes->{"InlineGetOwnPropertySlot"} && !$dataNode->extendedAttributes->{"CustomGetOwnPropertySlot"}) {
             push(@implContent, "bool ${className}::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
             push(@implContent, GenerateGetOwnPropertySlotBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0));
             push(@implContent, "}\n\n");
             push(@implContent, "bool ${className}::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(object);\n");
+            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(object);\n");
             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
             push(@implContent, GenerateGetOwnPropertyDescriptorBody($dataNode, $interfaceName, $className, $implClassName, $numAttributes > 0, 0));
             push(@implContent, "}\n\n");
@@ -1587,7 +1587,7 @@ sub GenerateImplementation
                 && !$dataNode->extendedAttributes->{"HasOverridingNameGetter"}) {
             push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
             push(@implContent, "    if (propertyName < static_cast<$implClassName*>(thisObject->impl())->length()) {\n");
             if ($dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
@@ -1744,7 +1744,7 @@ sub GenerateImplementation
             if (!$dataNode->extendedAttributes->{"CustomPutFunction"}) {
                 push(@implContent, "void ${className}::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+                push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
                 push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
                 if ($dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
                     push(@implContent, "    bool ok;\n");
@@ -1770,7 +1770,7 @@ sub GenerateImplementation
             if ($dataNode->extendedAttributes->{"HasCustomIndexSetter"}) {
                 push(@implContent, "void ${className}::putByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, JSValue value)\n");
                 push(@implContent, "{\n");
-                push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+                push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
                 push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
                 push(@implContent, "    thisObject->indexSetter(exec, propertyName, value);\n");
                 push(@implContent, "    return;\n");
@@ -1931,7 +1931,7 @@ sub GenerateImplementation
     if (($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"CustomGetPropertyNames"}) {
         push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)\n");
         push(@implContent, "{\n");
-        push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(object);\n");
+        push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(object);\n");
         push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
         if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) {
             push(@implContent, "    for (unsigned i = 0; i < static_cast<${implClassName}*>(thisObject->impl())->length(); ++i)\n");
@@ -2052,7 +2052,7 @@ sub GenerateImplementation
         if ($needsMarkChildren && !$dataNode->extendedAttributes->{"CustomMarkFunction"}) {
             push(@implContent, "void ${className}::visitChildren(JSCell* cell, SlotVisitor& visitor)\n");
             push(@implContent, "{\n");
-            push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
+            push(@implContent, "    ${className}* thisObject = jsCast<${className}*>(cell);\n");
             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);\n");
             push(@implContent, "    COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);\n");
             push(@implContent, "    ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());\n");
index 1b6698d..9cc821d 100644 (file)
@@ -175,14 +175,14 @@ JSObject* JSTestInterface::createPrototype(ExecState* exec, JSGlobalObject* glob
 
 bool JSTestInterface::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestInterface* thisObject = static_cast<JSTestInterface*>(cell);
+    JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueSlot<JSTestInterface, Base>(exec, &JSTestInterfaceTable, thisObject, propertyName, slot);
 }
 
 bool JSTestInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestInterface* thisObject = static_cast<JSTestInterface*>(object);
+    JSTestInterface* thisObject = jsCast<JSTestInterface*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueDescriptor<JSTestInterface, Base>(exec, &JSTestInterfaceTable, thisObject, propertyName, descriptor);
 }
index 6868ea7..e9722a2 100644 (file)
@@ -126,13 +126,13 @@ JSObject* JSTestMediaQueryListListenerPrototype::self(ExecState* exec, JSGlobalO
 
 bool JSTestMediaQueryListListenerPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestMediaQueryListListenerPrototype* thisObject = static_cast<JSTestMediaQueryListListenerPrototype*>(cell);
+    JSTestMediaQueryListListenerPrototype* thisObject = jsCast<JSTestMediaQueryListListenerPrototype*>(cell);
     return getStaticFunctionSlot<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, thisObject, propertyName, slot);
 }
 
 bool JSTestMediaQueryListListenerPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestMediaQueryListListenerPrototype* thisObject = static_cast<JSTestMediaQueryListListenerPrototype*>(object);
+    JSTestMediaQueryListListenerPrototype* thisObject = jsCast<JSTestMediaQueryListListenerPrototype*>(object);
     return getStaticFunctionDescriptor<JSObject>(exec, &JSTestMediaQueryListListenerPrototypeTable, thisObject, propertyName, descriptor);
 }
 
@@ -157,14 +157,14 @@ JSObject* JSTestMediaQueryListListener::createPrototype(ExecState* exec, JSGloba
 
 bool JSTestMediaQueryListListener::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestMediaQueryListListener* thisObject = static_cast<JSTestMediaQueryListListener*>(cell);
+    JSTestMediaQueryListListener* thisObject = jsCast<JSTestMediaQueryListListener*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueSlot<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, thisObject, propertyName, slot);
 }
 
 bool JSTestMediaQueryListListener::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestMediaQueryListListener* thisObject = static_cast<JSTestMediaQueryListListener*>(object);
+    JSTestMediaQueryListListener* thisObject = jsCast<JSTestMediaQueryListListener*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueDescriptor<JSTestMediaQueryListListener, Base>(exec, &JSTestMediaQueryListListenerTable, thisObject, propertyName, descriptor);
 }
index 9fe711a..ab0c854 100644 (file)
@@ -140,14 +140,14 @@ JSObject* JSTestNamedConstructor::createPrototype(ExecState* exec, JSGlobalObjec
 
 bool JSTestNamedConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestNamedConstructor* thisObject = static_cast<JSTestNamedConstructor*>(cell);
+    JSTestNamedConstructor* thisObject = jsCast<JSTestNamedConstructor*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueSlot<JSTestNamedConstructor, Base>(exec, &JSTestNamedConstructorTable, thisObject, propertyName, slot);
 }
 
 bool JSTestNamedConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestNamedConstructor* thisObject = static_cast<JSTestNamedConstructor*>(object);
+    JSTestNamedConstructor* thisObject = jsCast<JSTestNamedConstructor*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueDescriptor<JSTestNamedConstructor, Base>(exec, &JSTestNamedConstructorTable, thisObject, propertyName, descriptor);
 }
index fec3fa2..8620700 100644 (file)
@@ -300,13 +300,13 @@ JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject
 
 bool JSTestObjPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestObjPrototype* thisObject = static_cast<JSTestObjPrototype*>(cell);
+    JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(cell);
     return getStaticPropertySlot<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, slot);
 }
 
 bool JSTestObjPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestObjPrototype* thisObject = static_cast<JSTestObjPrototype*>(object);
+    JSTestObjPrototype* thisObject = jsCast<JSTestObjPrototype*>(object);
     return getStaticPropertyDescriptor<JSTestObjPrototype, JSObject>(exec, &JSTestObjPrototypeTable, thisObject, propertyName, descriptor);
 }
 
@@ -331,14 +331,14 @@ JSObject* JSTestObj::createPrototype(ExecState* exec, JSGlobalObject* globalObje
 
 bool JSTestObj::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
+    JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueSlot<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, slot);
 }
 
 bool JSTestObj::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestObj* thisObject = static_cast<JSTestObj*>(object);
+    JSTestObj* thisObject = jsCast<JSTestObj*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueDescriptor<JSTestObj, Base>(exec, &JSTestObjTable, thisObject, propertyName, descriptor);
 }
@@ -759,7 +759,7 @@ JSValue jsTestObjConstructor(ExecState* exec, JSValue slotBase, const Identifier
 
 void JSTestObj::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
+    JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     lookupPut<JSTestObj, Base>(exec, propertyName, value, &JSTestObjTable, thisObject, slot);
 }
@@ -1917,7 +1917,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionClassMethodWithOptional(E
 
 void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    JSTestObj* thisObject = static_cast<JSTestObj*>(cell);
+    JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
     ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
index a037900..9d4adb0 100644 (file)
@@ -145,14 +145,14 @@ JSObject* JSTestSerializedScriptValueInterface::createPrototype(ExecState* exec,
 
 bool JSTestSerializedScriptValueInterface::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(cell);
+    JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueSlot<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, slot);
 }
 
 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSTestSerializedScriptValueInterface* thisObject = static_cast<JSTestSerializedScriptValueInterface*>(object);
+    JSTestSerializedScriptValueInterface* thisObject = jsCast<JSTestSerializedScriptValueInterface*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, thisObject, propertyName, descriptor);
 }
index fdbfe6a..559b902 100644 (file)
@@ -257,7 +257,7 @@ static EncodedJSValue JSC_HOST_CALL callObjCFallbackObject(ExecState* exec)
 
 CallType ObjcFallbackObjectImp::getCallData(JSCell* cell, CallData& callData)
 {
-    ObjcFallbackObjectImp* thisObject = static_cast<ObjcFallbackObjectImp*>(cell);
+    ObjcFallbackObjectImp* thisObject = jsCast<ObjcFallbackObjectImp*>(cell);
     id targetObject = thisObject->_instance->getObject();
     if (![targetObject respondsToSelector:@selector(invokeUndefinedMethodFromWebScript:withArguments:)])
         return CallTypeNone;
@@ -272,7 +272,7 @@ bool ObjcFallbackObjectImp::deleteProperty(JSCell*, ExecState*, const Identifier
 
 JSValue ObjcFallbackObjectImp::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType)
 {
-    const ObjcFallbackObjectImp* thisObject = static_cast<const ObjcFallbackObjectImp*>(object);
+    const ObjcFallbackObjectImp* thisObject = jsCast<const ObjcFallbackObjectImp*>(object);
     return thisObject->_instance->getValueOfUndefinedField(exec, thisObject->_item);
 }
 
index 0dd80fd..5411d49 100644 (file)
@@ -64,7 +64,7 @@ public:
 
     static void visitChildren(JSCell* cell, SlotVisitor& visitor)
     {
-        QtRuntimeObject* thisObject = static_cast<QtRuntimeObject*>(cell);
+        QtRuntimeObject* thisObject = jsCast<QtRuntimeObject*>(cell);
         RuntimeObject::visitChildren(thisObject, visitor);
         QtInstance* instance = static_cast<QtInstance*>(thisObject->getInternalInstance());
         if (instance)
index c9e6acf..6eb4a28 100644 (file)
@@ -1443,7 +1443,7 @@ void QtRuntimeMetaMethod::finishCreation(ExecState* exec, const Identifier& iden
 
 void QtRuntimeMetaMethod::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
-    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(cell);
+    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
     QtRuntimeMethod::visitChildren(thisObject, visitor);
     QtRuntimeMetaMethodData* d = thisObject->d_func();
     if (d->m_connect)
@@ -1496,7 +1496,7 @@ CallType QtRuntimeMetaMethod::getCallData(JSCell*, CallData& callData)
 
 bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(cell);
+    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(cell);
     if (propertyName == "connect") {
         slot.setCustom(thisObject, thisObject->connectGetter);
         return true;
@@ -1513,7 +1513,7 @@ bool QtRuntimeMetaMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, cons
 
 bool QtRuntimeMetaMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    QtRuntimeMetaMethod* thisObject = static_cast<QtRuntimeMetaMethod*>(object);
+    QtRuntimeMetaMethod* thisObject = jsCast<QtRuntimeMetaMethod*>(object);
     if (propertyName == "connect") {
         PropertySlot slot;
         slot.setCustom(thisObject, connectGetter);
@@ -1739,7 +1739,7 @@ CallType QtRuntimeConnectionMethod::getCallData(JSCell*, CallData& callData)
 
 bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(cell);
+    QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(cell);
     if (propertyName == exec->propertyNames().length) {
         slot.setCustom(thisObject, thisObject->lengthGetter);
         return true;
@@ -1750,7 +1750,7 @@ bool QtRuntimeConnectionMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec
 
 bool QtRuntimeConnectionMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    QtRuntimeConnectionMethod* thisObject = static_cast<QtRuntimeConnectionMethod*>(object);
+    QtRuntimeConnectionMethod* thisObject = jsCast<QtRuntimeConnectionMethod*>(object);
     if (propertyName == exec->propertyNames().length) {
         PropertySlot slot;
         slot.setCustom(thisObject, lengthGetter);
index 51e63f0..de3ac0b 100644 (file)
@@ -68,7 +68,7 @@ JSValue RuntimeArray::indexGetter(ExecState* exec, JSValue slotBase, unsigned in
 
 void RuntimeArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(object);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(object);
     unsigned length = thisObject->getLength();
     for (unsigned i = 0; i < length; ++i)
         propertyNames.add(Identifier::from(exec, i));
@@ -81,7 +81,7 @@ void RuntimeArray::getOwnPropertyNames(JSObject* object, ExecState* exec, Proper
 
 bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     if (propertyName == exec->propertyNames().length) {
         slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
         return true;
@@ -101,7 +101,7 @@ bool RuntimeArray::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Ident
 
 bool RuntimeArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(object);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(object);
     if (propertyName == exec->propertyNames().length) {
         PropertySlot slot;
         slot.setCustom(thisObject, lengthGetter);
@@ -125,7 +125,7 @@ bool RuntimeArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, c
 
 bool RuntimeArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState *exec, unsigned index, PropertySlot& slot)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     if (index < thisObject->getLength()) {
         slot.setCustomIndex(thisObject, index, thisObject->indexGetter);
         return true;
@@ -136,7 +136,7 @@ bool RuntimeArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState *exec, unsi
 
 void RuntimeArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     if (propertyName == exec->propertyNames().length) {
         throwError(exec, createRangeError(exec, "Range error"));
         return;
@@ -154,7 +154,7 @@ void RuntimeArray::put(JSCell* cell, ExecState* exec, const Identifier& property
 
 void RuntimeArray::putByIndex(JSCell* cell, ExecState* exec, unsigned index, JSValue value)
 {
-    RuntimeArray* thisObject = static_cast<RuntimeArray*>(cell);
+    RuntimeArray* thisObject = jsCast<RuntimeArray*>(cell);
     if (index >= thisObject->getLength()) {
         throwError(exec, createRangeError(exec, "Range error"));
         return;
index ddd2a75..9aa3e4f 100644 (file)
@@ -75,7 +75,7 @@ JSValue RuntimeMethod::lengthGetter(ExecState*, JSValue slotBase, const Identifi
 
 bool RuntimeMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot &slot)
 {
-    RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(cell);
+    RuntimeMethod* thisObject = jsCast<RuntimeMethod*>(cell);
     if (propertyName == exec->propertyNames().length) {
         slot.setCacheableCustom(thisObject, thisObject->lengthGetter);
         return true;
@@ -86,7 +86,7 @@ bool RuntimeMethod::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Iden
 
 bool RuntimeMethod::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor &descriptor)
 {
-    RuntimeMethod* thisObject = static_cast<RuntimeMethod*>(object);
+    RuntimeMethod* thisObject = jsCast<RuntimeMethod*>(object);
     if (propertyName == exec->propertyNames().length) {
         PropertySlot slot;
         slot.setCustom(thisObject, lengthGetter);
index 983402a..4abbc8e 100644 (file)
@@ -118,7 +118,7 @@ JSValue RuntimeObject::methodGetter(ExecState* exec, JSValue slotBase, const Ide
 
 bool RuntimeObject::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(cell);
     if (!thisObject->m_instance) {
         throwInvalidAccessError(exec);
         return false;
@@ -164,7 +164,7 @@ bool RuntimeObject::getOwnPropertySlot(JSCell* cell, ExecState *exec, const Iden
 
 bool RuntimeObject::getOwnPropertyDescriptor(JSObject* object, ExecState *exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(object);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(object);
     if (!thisObject->m_instance) {
         throwInvalidAccessError(exec);
         return false;
@@ -214,7 +214,7 @@ bool RuntimeObject::getOwnPropertyDescriptor(JSObject* object, ExecState *exec,
 
 void RuntimeObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(cell);
     if (!thisObject->m_instance) {
         throwInvalidAccessError(exec);
         return;
@@ -241,7 +241,7 @@ bool RuntimeObject::deleteProperty(JSCell*, ExecState*, const Identifier&)
 
 JSValue RuntimeObject::defaultValue(const JSObject* object, ExecState* exec, PreferredPrimitiveType hint)
 {
-    const RuntimeObject* thisObject = static_cast<const RuntimeObject*>(object);
+    const RuntimeObject* thisObject = jsCast<const RuntimeObject*>(object);
     if (!thisObject->m_instance)
         return throwInvalidAccessError(exec);
     
@@ -265,7 +265,7 @@ static EncodedJSValue JSC_HOST_CALL callRuntimeObject(ExecState* exec)
 
 CallType RuntimeObject::getCallData(JSCell* cell, CallData& callData)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(cell);
     if (!thisObject->m_instance)
         return CallTypeNone;
     
@@ -293,7 +293,7 @@ static EncodedJSValue JSC_HOST_CALL callRuntimeConstructor(ExecState* exec)
 
 ConstructType RuntimeObject::getConstructData(JSCell* cell, ConstructData& constructData)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(cell);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(cell);
     if (!thisObject->m_instance)
         return ConstructTypeNone;
     
@@ -307,7 +307,7 @@ ConstructType RuntimeObject::getConstructData(JSCell* cell, ConstructData& const
 
 void RuntimeObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode)
 {
-    RuntimeObject* thisObject = static_cast<RuntimeObject*>(object);
+    RuntimeObject* thisObject = jsCast<RuntimeObject*>(object);
     if (!thisObject->m_instance) {
         throwInvalidAccessError(exec);
         return;
index 50e4e1d..dd8ee8f 100644 (file)
@@ -1,3 +1,23 @@
+2011-11-11  Mark Hahnenberg  <mhahnenberg@apple.com>
+
+        Add jsCast to replace static_cast
+        https://bugs.webkit.org/show_bug.cgi?id=72071
+
+        Reviewed by Geoffrey Garen.
+
+        Added new jsCast and changed all of the static_cast sites in functions that 
+        are in the MethodTable to use jsCast instead.
+
+        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
+        (WebKit::JSNPObject::getCallData):
+        (WebKit::JSNPObject::getConstructData):
+        (WebKit::JSNPObject::getOwnPropertySlot):
+        (WebKit::JSNPObject::getOwnPropertyDescriptor):
+        (WebKit::JSNPObject::put):
+        (WebKit::JSNPObject::deleteProperty):
+        (WebKit::JSNPObject::deletePropertyByIndex):
+        (WebKit::JSNPObject::getOwnPropertyNames):
+
 2011-11-11  Timothy Hatcher  <timothy@apple.com>
 
         Only use the textured window style mask when there is no override inspector page.
index 51354fa..a2fd226 100644 (file)
@@ -219,7 +219,7 @@ static EncodedJSValue JSC_HOST_CALL callNPJSObject(ExecState* exec)
 
 JSC::CallType JSNPObject::getCallData(JSC::JSCell* cell, JSC::CallData& callData)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(cell);
+    JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject || !thisObject->m_npObject->_class->invokeDefault)
         return CallTypeNone;
@@ -238,7 +238,7 @@ static EncodedJSValue JSC_HOST_CALL constructWithConstructor(ExecState* exec)
 
 ConstructType JSNPObject::getConstructData(JSCell* cell, ConstructData& constructData)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(cell);
+    JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject || !thisObject->m_npObject->_class->construct)
         return ConstructTypeNone;
@@ -249,7 +249,7 @@ ConstructType JSNPObject::getConstructData(JSCell* cell, ConstructData& construc
 
 bool JSNPObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(cell);
+    JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject) {
         throwInvalidAccessError(exec);
@@ -275,7 +275,7 @@ bool JSNPObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identif
 
 bool JSNPObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(object);
+    JSNPObject* thisObject = jsCast<JSNPObject*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject) {
         throwInvalidAccessError(exec);
@@ -305,7 +305,7 @@ bool JSNPObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, con
 
 void JSNPObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot&)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(cell);
+    JSNPObject* thisObject = JSC::jsCast<JSNPObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject) {
         throwInvalidAccessError(exec);
@@ -344,12 +344,12 @@ void JSNPObject::put(JSCell* cell, ExecState* exec, const Identifier& propertyNa
 
 bool JSNPObject::deleteProperty(JSCell* cell, ExecState* exec, const Identifier& propertyName)
 {
-    return static_cast<JSNPObject*>(cell)->deleteProperty(exec, npIdentifierFromIdentifier(propertyName));
+    return jsCast<JSNPObject*>(cell)->deleteProperty(exec, npIdentifierFromIdentifier(propertyName));
 }
 
 bool JSNPObject::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned propertyName)
 {
-    return static_cast<JSNPObject*>(cell)->deleteProperty(exec, static_cast<NPIdentifier>(IdentifierRep::get(propertyName)));
+    return jsCast<JSNPObject*>(cell)->deleteProperty(exec, static_cast<NPIdentifier>(IdentifierRep::get(propertyName)));
 }
 
 bool JSNPObject::deleteProperty(ExecState* exec, NPIdentifier propertyName)
@@ -385,7 +385,7 @@ bool JSNPObject::deleteProperty(ExecState* exec, NPIdentifier propertyName)
 
 void JSNPObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNameArray, EnumerationMode mode)
 {
-    JSNPObject* thisObject = static_cast<JSNPObject*>(object);
+    JSNPObject* thisObject = jsCast<JSNPObject*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
     if (!thisObject->m_npObject) {
         throwInvalidAccessError(exec);