Commit 135f0517 authored by mhahnenberg@apple.com's avatar mhahnenberg@apple.com

Add jsCast to replace static_cast

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
parent 5f1ccd6c
......@@ -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;
}
......
......@@ -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());
......
......@@ -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);
......
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.
......@@ -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);
}
......
......@@ -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) {
......
......@@ -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 ---------------------------
......
......@@ -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 ----------------------------
......
......@@ -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 ---------------------------
......
......@@ -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
......
......@@ -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
......
......@@ -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 ---------------------------
......
......@@ -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);