Ignore:
Timestamp:
Jan 17, 2017, 12:25:36 PM (8 years ago)
Author:
[email protected]
Message:

Unreviewed, roll out http://trac.webkit.org/changeset/210821
It was causing crashes.

Source/JavaScriptCore:

  • API/JSAPIWrapperObject.mm:

(JSAPIWrapperObjectHandleOwner::finalize):

  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:

(JSC::JSCallbackObject<Parent>::~JSCallbackObject):
(JSC::JSCallbackObject<Parent>::init):

  • API/JSObjectRef.cpp:

(JSObjectGetPrivate):
(JSObjectSetPrivate):
(classInfoPrivate): Deleted.

  • bytecode/EvalCodeBlock.cpp:

(JSC::EvalCodeBlock::destroy):

  • bytecode/FunctionCodeBlock.cpp:

(JSC::FunctionCodeBlock::destroy):

  • bytecode/ModuleProgramCodeBlock.cpp:

(JSC::ModuleProgramCodeBlock::destroy):

  • bytecode/ProgramCodeBlock.cpp:

(JSC::ProgramCodeBlock::destroy):

  • bytecode/UnlinkedEvalCodeBlock.cpp:

(JSC::UnlinkedEvalCodeBlock::destroy):

  • bytecode/UnlinkedFunctionCodeBlock.cpp:

(JSC::UnlinkedFunctionCodeBlock::destroy):

  • bytecode/UnlinkedFunctionExecutable.cpp:

(JSC::UnlinkedFunctionExecutable::destroy):

  • bytecode/UnlinkedModuleProgramCodeBlock.cpp:

(JSC::UnlinkedModuleProgramCodeBlock::destroy):

  • bytecode/UnlinkedProgramCodeBlock.cpp:

(JSC::UnlinkedProgramCodeBlock::destroy):

  • heap/CodeBlockSet.cpp:

(JSC::CodeBlockSet::lastChanceToFinalize):
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):

  • heap/MarkedAllocator.cpp:

(JSC::MarkedAllocator::allocateSlowCaseImpl):

  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::Handle::sweep):

  • jit/JITThunks.cpp:

(JSC::JITThunks::finalize):

  • runtime/AbstractModuleRecord.cpp:

(JSC::AbstractModuleRecord::destroy):

  • runtime/ExecutableBase.cpp:

(JSC::ExecutableBase::clearCode):

  • runtime/JSCellInlines.h:

(JSC::JSCell::classInfo):
(JSC::JSCell::callDestructor):

  • runtime/JSLock.h:

(JSC::JSLock::exclusiveThread):
(JSC::JSLock::ownerThread): Deleted.

  • runtime/JSModuleNamespaceObject.cpp:

(JSC::JSModuleNamespaceObject::destroy):

  • runtime/JSModuleRecord.cpp:

(JSC::JSModuleRecord::destroy):

  • runtime/JSPropertyNameEnumerator.cpp:

(JSC::JSPropertyNameEnumerator::destroy):

  • runtime/JSSegmentedVariableObject.h:
  • runtime/SymbolTable.cpp:

(JSC::SymbolTable::destroy):

  • runtime/VM.h:
  • wasm/js/JSWebAssemblyCallee.cpp:

(JSC::JSWebAssemblyCallee::destroy):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::destroy):

  • wasm/js/WebAssemblyToJSCallee.cpp:

(JSC::WebAssemblyToJSCallee::WebAssemblyToJSCallee):
(JSC::WebAssemblyToJSCallee::destroy):

Source/WebCore:

  • bindings/js/JSCSSValueCustom.cpp:

(WebCore::JSDeprecatedCSSOMValueOwner::finalize):

  • bindings/js/JSDOMIterator.h:

(WebCore::IteratorTraits>::destroy):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateImplementation):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r210821 r210824  
    381381}
    382382
    383 // API objects have private properties, which may get accessed during destruction. This
    384 // helper lets us get the ClassInfo of an API object from a function that may get called
    385 // during destruction.
    386 static const ClassInfo* classInfoPrivate(JSObject* jsObject)
    387 {
    388     VM* vm = jsObject->vm();
    389    
    390     if (vm->currentlyDestructingCallbackObject != jsObject)
    391         return jsObject->classInfo();
    392 
    393     return vm->currentlyDestructingCallbackObjectClassInfo;
    394 }
    395 
    396383void* JSObjectGetPrivate(JSObjectRef object)
    397384{
    398385    JSObject* jsObject = uncheckedToJS(object);
    399386
    400     const ClassInfo* classInfo = classInfoPrivate(jsObject);
    401    
    402387    // Get wrapped object if proxied
    403     if (classInfo->isSubClassOf(JSProxy::info())) {
    404         jsObject = static_cast<JSProxy*>(jsObject)->target();
    405         classInfo = jsObject->classInfo();
    406     }
    407 
    408     if (classInfo->isSubClassOf(JSCallbackObject<JSGlobalObject>::info()))
    409         return static_cast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivate();
    410     if (classInfo->isSubClassOf(JSCallbackObject<JSDestructibleObject>::info()))
    411         return static_cast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->getPrivate();
     388    if (jsObject->inherits(JSProxy::info()))
     389        jsObject = jsCast<JSProxy*>(jsObject)->target();
     390
     391    if (jsObject->inherits(JSCallbackObject<JSGlobalObject>::info()))
     392        return jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->getPrivate();
     393    if (jsObject->inherits(JSCallbackObject<JSDestructibleObject>::info()))
     394        return jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->getPrivate();
    412395#if JSC_OBJC_API_ENABLED
    413     if (classInfo->isSubClassOf(JSCallbackObject<JSAPIWrapperObject>::info()))
    414         return static_cast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->getPrivate();
     396    if (jsObject->inherits(JSCallbackObject<JSAPIWrapperObject>::info()))
     397        return jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->getPrivate();
    415398#endif
    416399   
     
    422405    JSObject* jsObject = uncheckedToJS(object);
    423406
    424     const ClassInfo* classInfo = classInfoPrivate(jsObject);
    425    
    426407    // Get wrapped object if proxied
    427     if (classInfo->isSubClassOf(JSProxy::info())) {
     408    if (jsObject->inherits(JSProxy::info()))
    428409        jsObject = jsCast<JSProxy*>(jsObject)->target();
    429         classInfo = jsObject->classInfo();
    430     }
    431 
    432     if (classInfo->isSubClassOf(JSCallbackObject<JSGlobalObject>::info())) {
     410
     411    if (jsObject->inherits(JSCallbackObject<JSGlobalObject>::info())) {
    433412        jsCast<JSCallbackObject<JSGlobalObject>*>(jsObject)->setPrivate(data);
    434413        return true;
    435414    }
    436     if (classInfo->isSubClassOf(JSCallbackObject<JSDestructibleObject>::info())) {
     415    if (jsObject->inherits(JSCallbackObject<JSDestructibleObject>::info())) {
    437416        jsCast<JSCallbackObject<JSDestructibleObject>*>(jsObject)->setPrivate(data);
    438417        return true;
    439418    }
    440419#if JSC_OBJC_API_ENABLED
    441     if (classInfo->isSubClassOf(JSCallbackObject<JSAPIWrapperObject>::info())) {
     420    if (jsObject->inherits(JSCallbackObject<JSAPIWrapperObject>::info())) {
    442421        jsCast<JSCallbackObject<JSAPIWrapperObject>*>(jsObject)->setPrivate(data);
    443422        return true;
Note: See TracChangeset for help on using the changeset viewer.