Skip to content
  • oliver@apple.com's avatar
    Replace static_cast with jsCast when casting JSCell subclasses in JSC · 0c59caf6
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=83307
    
    Reviewed by Gavin Barraclough.
    
    Replace all usage of static_cast<JSCell subtype*> with jsCast<> in JavaScriptCore.
    This results in assertions when unsafe casts are performed, but simply leaves
    a static_cast<> in release builds.
    
    * API/APICast.h:
    (toJS):
    * API/JSCallbackConstructor.cpp:
    (JSC::constructJSCallback):
    * API/JSCallbackFunction.cpp:
    (JSC::JSCallbackFunction::call):
    * API/JSCallbackObjectFunctions.h:
    (JSC::::asCallbackObject):
    (JSC::::finishCreation):
    (JSC::::construct):
    (JSC::::call):
    * API/JSObjectRef.cpp:
    (JSObjectGetPrivate):
    (JSObjectSetPrivate):
    (JSObjectGetPrivateProperty):
    (JSObjectSetPrivateProperty):
    (JSObjectDeletePrivateProperty):
    * API/JSValueRef.cpp:
    (JSValueIsObjectOfClass):
    * API/JSWeakObjectMapRefPrivate.cpp:
    * bytecompiler/BytecodeGenerator.cpp:
    (JSC::BytecodeGenerator::resolve):
    (JSC::BytecodeGenerator::resolveConstDecl):
    * debugger/DebuggerActivation.cpp:
    (JSC::DebuggerActivation::finishCreation):
    * dfg/DFGOperations.cpp:
    * interpreter/Interpreter.cpp:
    (JSC::Interpreter::execute):
    (JSC::Interpreter::privateExecute):
    * jit/JITStubs.cpp:
    (JSC::DEFINE_STUB_FUNCTION):
    * runtime/Executable.h:
    (JSC::isHostFunction):
    * runtime/JSActivation.h:
    (JSC::asActivation):
    * runtime/JSArray.cpp:
    (JSC::JSArray::defineOwnProperty):
    * runtime/JSArray.h:
    (JSC::asArray):
    * runtime/JSBoundFunction.cpp:
    (JSC::boundFunctionCall):
    (JSC::boundFunctionConstruct):
    * runtime/JSByteArray.h:
    (JSC::asByteArray):
    * runtime/JSCell.cpp:
    (JSC::JSCell::toObject):
    * runtime/JSCell.h:
    (JSC::jsCast):
    * runtime/JSGlobalObject.h:
    (JSC::asGlobalObject):
    * runtime/JSGlobalObjectFunctions.cpp:
    (JSC::globalFuncEval):
    * runtime/JSObject.cpp:
    (JSC::JSObject::setPrototypeWithCycleCheck):
    (JSC::JSObject::allowsAccessFrom):
    (JSC::JSObject::toThisObject):
    (JSC::JSObject::unwrappedObject):
    * runtime/JSObject.h:
    (JSC::asObject):
    * runtime/JSPropertyNameIterator.h:
    (JSC::Register::propertyNameIterator):
    * runtime/JSString.h:
    (JSC::asString):
    (JSC::JSValue::toString):
    * runtime/StringPrototype.cpp:
    (JSC::stringProtoFuncSubstr):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0c59caf6