Commit bb8da910 authored by oliver@apple.com's avatar oliver@apple.com

2011-04-13 Oliver Hunt <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Additional structures are allocated beyond the expected threshold
        so we preflight the test to get them allocated.

        * fast/dom/gc-10.html:
2011-04-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Turn Structure into a GC allocated object.  Most of this patch
        is the mechanical change of replacing variations on RefPtr<Structure>
        with either Structure* (for arguments and locals), WriteBarrier<Structure>
        for the few cases where Structures are held by GC allocated objects
        and Strong<Structure> for the root structure objects in GlobalData.

        * API/JSCallbackConstructor.cpp:
        (JSC::JSCallbackConstructor::JSCallbackConstructor):
        * API/JSCallbackConstructor.h:
        (JSC::JSCallbackConstructor::createStructure):
        * API/JSCallbackFunction.h:
        (JSC::JSCallbackFunction::createStructure):
        * API/JSCallbackObject.h:
        (JSC::JSCallbackObject::createStructure):
        * API/JSCallbackObjectFunctions.h:
        (JSC::::JSCallbackObject):
        * API/JSContextRef.cpp:
        * JavaScriptCore.JSVALUE32_64only.exp:
        * JavaScriptCore.JSVALUE64only.exp:
        * JavaScriptCore.exp:
        * bytecode/CodeBlock.cpp:
        (JSC::CodeBlock::~CodeBlock):
        (JSC::CodeBlock::markStructures):
        (JSC::CodeBlock::markAggregate):
        * bytecode/CodeBlock.h:
        (JSC::MethodCallLinkInfo::setSeen):
        (JSC::GlobalResolveInfo::GlobalResolveInfo):
        * bytecode/Instruction.h:
        (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
        (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
        (JSC::PolymorphicAccessStructureList::markAggregate):
        (JSC::Instruction::Instruction):
        * bytecode/StructureStubInfo.cpp:
        (JSC::StructureStubInfo::deref):
        (JSC::StructureStubInfo::markAggregate):
        * bytecode/StructureStubInfo.h:
        (JSC::StructureStubInfo::initGetByIdSelf):
        (JSC::StructureStubInfo::initGetByIdProto):
        (JSC::StructureStubInfo::initGetByIdChain):
        (JSC::StructureStubInfo::initPutByIdTransition):
        (JSC::StructureStubInfo::initPutByIdReplace):
        * debugger/DebuggerActivation.cpp:
        (JSC::DebuggerActivation::DebuggerActivation):
        * debugger/DebuggerActivation.h:
        (JSC::DebuggerActivation::createStructure):
        * heap/Handle.h:
        * heap/MarkStack.cpp:
        (JSC::MarkStack::markChildren):
        (JSC::MarkStack::drain):
        * heap/MarkedBlock.cpp:
        (JSC::MarkedBlock::MarkedBlock):
        (JSC::MarkedBlock::sweep):
        * heap/Strong.h:
        (JSC::Strong::Strong):
        (JSC::Strong::set):
        * interpreter/Interpreter.cpp:
        (JSC::Interpreter::resolveGlobal):
        (JSC::Interpreter::resolveGlobalDynamic):
        (JSC::Interpreter::tryCachePutByID):
        (JSC::Interpreter::uncachePutByID):
        (JSC::Interpreter::tryCacheGetByID):
        (JSC::Interpreter::uncacheGetByID):
        (JSC::Interpreter::privateExecute):
        * jit/JIT.h:
        * jit/JITPropertyAccess.cpp:
        (JSC::JIT::privateCompilePutByIdTransition):
        (JSC::JIT::patchMethodCallProto):
        (JSC::JIT::privateCompileGetByIdProto):
        (JSC::JIT::privateCompileGetByIdSelfList):
        (JSC::JIT::privateCompileGetByIdProtoList):
        (JSC::JIT::privateCompileGetByIdChainList):
        (JSC::JIT::privateCompileGetByIdChain):
        * jit/JITPropertyAccess32_64.cpp:
        (JSC::JIT::privateCompilePutByIdTransition):
        (JSC::JIT::patchMethodCallProto):
        (JSC::JIT::privateCompileGetByIdProto):
        (JSC::JIT::privateCompileGetByIdSelfList):
        (JSC::JIT::privateCompileGetByIdProtoList):
        (JSC::JIT::privateCompileGetByIdChainList):
        (JSC::JIT::privateCompileGetByIdChain):
        * jit/JITStubs.cpp:
        (JSC::JITThunks::tryCachePutByID):
        (JSC::JITThunks::tryCacheGetByID):
        (JSC::DEFINE_STUB_FUNCTION):
        (JSC::getPolymorphicAccessStructureListSlot):
        * jit/JSInterfaceJIT.h:
        (JSC::JSInterfaceJIT::storePtrWithWriteBarrier):
        * jsc.cpp:
        (cleanupGlobalData):
        * runtime/Arguments.h:
        (JSC::Arguments::createStructure):
        (JSC::Arguments::Arguments):
        (JSC::JSActivation::copyRegisters):
        * runtime/ArrayConstructor.cpp:
        (JSC::ArrayConstructor::ArrayConstructor):
        (JSC::constructArrayWithSizeQuirk):
        * runtime/ArrayConstructor.h:
        * runtime/ArrayPrototype.cpp:
        (JSC::ArrayPrototype::ArrayPrototype):
        (JSC::arrayProtoFuncSplice):
        * runtime/ArrayPrototype.h:
        (JSC::ArrayPrototype::createStructure):
        * runtime/BatchedTransitionOptimizer.h:
        (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
        * runtime/BooleanConstructor.cpp:
        (JSC::BooleanConstructor::BooleanConstructor):
        * runtime/BooleanConstructor.h:
        * runtime/BooleanObject.cpp:
        (JSC::BooleanObject::BooleanObject):
        * runtime/BooleanObject.h:
        (JSC::BooleanObject::createStructure):
        * runtime/BooleanPrototype.cpp:
        (JSC::BooleanPrototype::BooleanPrototype):
        * runtime/BooleanPrototype.h:
        * runtime/DateConstructor.cpp:
        (JSC::DateConstructor::DateConstructor):
        * runtime/DateConstructor.h:
        * runtime/DateInstance.cpp:
        (JSC::DateInstance::DateInstance):
        * runtime/DateInstance.h:
        (JSC::DateInstance::createStructure):
        * runtime/DatePrototype.cpp:
        (JSC::DatePrototype::DatePrototype):
        * runtime/DatePrototype.h:
        (JSC::DatePrototype::createStructure):
        * runtime/Error.cpp:
        (JSC::StrictModeTypeErrorFunction::StrictModeTypeErrorFunction):
        * runtime/ErrorConstructor.cpp:
        (JSC::ErrorConstructor::ErrorConstructor):
        * runtime/ErrorConstructor.h:
        * runtime/ErrorInstance.cpp:
        (JSC::ErrorInstance::ErrorInstance):
        (JSC::ErrorInstance::create):
        * runtime/ErrorInstance.h:
        (JSC::ErrorInstance::createStructure):
        * runtime/ErrorPrototype.cpp:
        (JSC::ErrorPrototype::ErrorPrototype):
        * runtime/ErrorPrototype.h:
        * runtime/ExceptionHelpers.cpp:
        (JSC::InterruptedExecutionError::InterruptedExecutionError):
        (JSC::TerminatedExecutionError::TerminatedExecutionError):
        * runtime/Executable.cpp:
        * runtime/Executable.h:
        (JSC::ExecutableBase::ExecutableBase):
        (JSC::ExecutableBase::createStructure):
        (JSC::NativeExecutable::createStructure):
        (JSC::NativeExecutable::NativeExecutable):
        (JSC::ScriptExecutable::ScriptExecutable):
        (JSC::EvalExecutable::createStructure):
        (JSC::ProgramExecutable::createStructure):
        (JSC::FunctionExecutable::createStructure):
        * runtime/FunctionConstructor.cpp:
        (JSC::FunctionConstructor::FunctionConstructor):
        * runtime/FunctionConstructor.h:
        * runtime/FunctionPrototype.cpp:
        (JSC::FunctionPrototype::FunctionPrototype):
        * runtime/FunctionPrototype.h:
        (JSC::FunctionPrototype::createStructure):
        * runtime/GetterSetter.h:
        (JSC::GetterSetter::GetterSetter):
        (JSC::GetterSetter::createStructure):
        * runtime/InitializeThreading.cpp:
        (JSC::initializeThreadingOnce):
        * runtime/InternalFunction.cpp:
        (JSC::InternalFunction::InternalFunction):
        * runtime/InternalFunction.h:
        (JSC::InternalFunction::createStructure):
        * runtime/JSAPIValueWrapper.h:
        (JSC::JSAPIValueWrapper::createStructure):
        (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
        * runtime/JSActivation.cpp:
        (JSC::JSActivation::JSActivation):
        * runtime/JSActivation.h:
        (JSC::JSActivation::createStructure):
        * runtime/JSArray.cpp:
        (JSC::JSArray::JSArray):
        * runtime/JSArray.h:
        (JSC::JSArray::createStructure):
        * runtime/JSByteArray.cpp:
        (JSC::JSByteArray::JSByteArray):
        (JSC::JSByteArray::createStructure):
        * runtime/JSByteArray.h:
        (JSC::JSByteArray::JSByteArray):
        * runtime/JSCell.cpp:
        (JSC::isZombie):
        * runtime/JSCell.h:
        (JSC::JSCell::JSCell::JSCell):
        (JSC::JSCell::JSCell::addressOfStructure):
        (JSC::JSCell::JSCell::structure):
        (JSC::JSCell::JSCell::markChildren):
        (JSC::JSCell::JSValue::isZombie):
        * runtime/JSFunction.cpp:
        (JSC::JSFunction::JSFunction):
        * runtime/JSFunction.h:
        (JSC::JSFunction::createStructure):
        * runtime/JSGlobalData.cpp:
        (JSC::JSGlobalData::storeVPtrs):
        (JSC::JSGlobalData::JSGlobalData):
        (JSC::JSGlobalData::clearBuiltinStructures):
        (JSC::JSGlobalData::createLeaked):
        * runtime/JSGlobalData.h:
        (JSC::allocateGlobalHandle):
        * runtime/JSGlobalObject.cpp:
        (JSC::JSGlobalObject::reset):
        (JSC::JSGlobalObject::markChildren):
        (JSC::JSGlobalObject::copyGlobalsFrom):
        * runtime/JSGlobalObject.h:
        (JSC::JSGlobalObject::JSGlobalObject):
        (JSC::JSGlobalObject::createStructure):
        (JSC::Structure::prototypeChain):
        (JSC::Structure::isValid):
        (JSC::constructEmptyArray):
        * runtime/JSNotAnObject.h:
        (JSC::JSNotAnObject::JSNotAnObject):
        (JSC::JSNotAnObject::createStructure):
        * runtime/JSONObject.cpp:
        (JSC::JSONObject::JSONObject):
        * runtime/JSONObject.h:
        (JSC::JSONObject::createStructure):
        * runtime/JSObject.cpp:
        (JSC::JSObject::defineGetter):
        (JSC::JSObject::defineSetter):
        (JSC::JSObject::seal):
        (JSC::JSObject::freeze):
        (JSC::JSObject::preventExtensions):
        (JSC::JSObject::removeDirect):
        (JSC::JSObject::createInheritorID):
        * runtime/JSObject.h:
        (JSC::JSObject::createStructure):
        (JSC::JSObject::JSObject):
        (JSC::JSNonFinalObject::createStructure):
        (JSC::JSNonFinalObject::JSNonFinalObject):
        (JSC::JSFinalObject::create):
        (JSC::JSFinalObject::createStructure):
        (JSC::JSFinalObject::JSFinalObject):
        (JSC::constructEmptyObject):
        (JSC::createEmptyObjectStructure):
        (JSC::JSObject::~JSObject):
        (JSC::JSObject::setPrototype):
        (JSC::JSObject::setStructure):
        (JSC::JSObject::inheritorID):
        (JSC::JSObject::putDirectInternal):
        (JSC::JSObject::transitionTo):
        (JSC::JSObject::markChildrenDirect):
        * runtime/JSObjectWithGlobalObject.cpp:
        (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
        * runtime/JSObjectWithGlobalObject.h:
        (JSC::JSObjectWithGlobalObject::createStructure):
        (JSC::JSObjectWithGlobalObject::JSObjectWithGlobalObject):
        * runtime/JSPropertyNameIterator.cpp:
        (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
        (JSC::JSPropertyNameIterator::create):
        (JSC::JSPropertyNameIterator::get):
        * runtime/JSPropertyNameIterator.h:
        (JSC::JSPropertyNameIterator::createStructure):
        (JSC::JSPropertyNameIterator::setCachedStructure):
        (JSC::Structure::setEnumerationCache):
        * runtime/JSStaticScopeObject.h:
        (JSC::JSStaticScopeObject::JSStaticScopeObject):
        (JSC::JSStaticScopeObject::createStructure):
        * runtime/JSString.h:
        (JSC::RopeBuilder::JSString):
        (JSC::RopeBuilder::createStructure):
        * runtime/JSType.h:
        * runtime/JSTypeInfo.h:
        (JSC::TypeInfo::TypeInfo):
        * runtime/JSValue.h:
        * runtime/JSVariableObject.h:
        (JSC::JSVariableObject::createStructure):
        (JSC::JSVariableObject::JSVariableObject):
        (JSC::JSVariableObject::copyRegisterArray):
        * runtime/JSWrapperObject.h:
        (JSC::JSWrapperObject::createStructure):
        (JSC::JSWrapperObject::JSWrapperObject):
        * runtime/JSZombie.cpp:
        * runtime/JSZombie.h:
        (JSC::JSZombie::JSZombie):
        (JSC::JSZombie::createStructure):
        * runtime/MathObject.cpp:
        (JSC::MathObject::MathObject):
        * runtime/MathObject.h:
        (JSC::MathObject::createStructure):
        * runtime/NativeErrorConstructor.cpp:
        (JSC::NativeErrorConstructor::NativeErrorConstructor):
        (JSC::NativeErrorConstructor::markChildren):
        * runtime/NativeErrorConstructor.h:
        (JSC::NativeErrorConstructor::createStructure):
        * runtime/NativeErrorPrototype.cpp:
        (JSC::NativeErrorPrototype::NativeErrorPrototype):
        * runtime/NativeErrorPrototype.h:
        * runtime/NumberConstructor.cpp:
        (JSC::NumberConstructor::NumberConstructor):
        * runtime/NumberConstructor.h:
        (JSC::NumberConstructor::createStructure):
        * runtime/NumberObject.cpp:
        (JSC::NumberObject::NumberObject):
        * runtime/NumberObject.h:
        (JSC::NumberObject::createStructure):
        * runtime/NumberPrototype.cpp:
        (JSC::NumberPrototype::NumberPrototype):
        * runtime/NumberPrototype.h:
        * runtime/ObjectConstructor.cpp:
        (JSC::ObjectConstructor::ObjectConstructor):
        * runtime/ObjectConstructor.h:
        (JSC::ObjectConstructor::createStructure):
        * runtime/ObjectPrototype.cpp:
        (JSC::ObjectPrototype::ObjectPrototype):
        * runtime/ObjectPrototype.h:
        * runtime/PropertyMapHashTable.h:
        (JSC::PropertyTable::PropertyTable):
        * runtime/RegExpConstructor.cpp:
        (JSC::RegExpConstructor::RegExpConstructor):
        (JSC::RegExpMatchesArray::RegExpMatchesArray):
        * runtime/RegExpConstructor.h:
        (JSC::RegExpConstructor::createStructure):
        * runtime/RegExpObject.cpp:
        (JSC::RegExpObject::RegExpObject):
        * runtime/RegExpObject.h:
        (JSC::RegExpObject::createStructure):
        * runtime/RegExpPrototype.cpp:
        (JSC::RegExpPrototype::RegExpPrototype):
        * runtime/RegExpPrototype.h:
        * runtime/ScopeChain.h:
        (JSC::ScopeChainNode::ScopeChainNode):
        (JSC::ScopeChainNode::createStructure):
        * runtime/StrictEvalActivation.cpp:
        (JSC::StrictEvalActivation::StrictEvalActivation):
        * runtime/StringConstructor.cpp:
        (JSC::StringConstructor::StringConstructor):
        * runtime/StringConstructor.h:
        * runtime/StringObject.cpp:
        (JSC::StringObject::StringObject):
        * runtime/StringObject.h:
        (JSC::StringObject::createStructure):
        * runtime/StringObjectThatMasqueradesAsUndefined.h:
        (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
        (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
        * runtime/StringPrototype.cpp:
        (JSC::StringPrototype::StringPrototype):
        * runtime/StringPrototype.h:
        (JSC::StringPrototype::createStructure):
        * runtime/Structure.cpp:
        (JSC::StructureTransitionTable::remove):
        (JSC::StructureTransitionTable::add):
        (JSC::Structure::Structure):
        (JSC::Structure::~Structure):
        (JSC::Structure::materializePropertyMap):
        (JSC::Structure::addPropertyTransitionToExistingStructure):
        (JSC::Structure::addPropertyTransition):
        (JSC::Structure::removePropertyTransition):
        (JSC::Structure::changePrototypeTransition):
        (JSC::Structure::despecifyFunctionTransition):
        (JSC::Structure::getterSetterTransition):
        (JSC::Structure::toDictionaryTransition):
        (JSC::Structure::toCacheableDictionaryTransition):
        (JSC::Structure::toUncacheableDictionaryTransition):
        (JSC::Structure::sealTransition):
        (JSC::Structure::freezeTransition):
        (JSC::Structure::preventExtensionsTransition):
        (JSC::Structure::flattenDictionaryStructure):
        (JSC::Structure::copyPropertyTable):
        (JSC::Structure::put):
        (JSC::Structure::markChildren):
        * runtime/Structure.h:
        (JSC::Structure::create):
        (JSC::Structure::setPrototypeWithoutTransition):
        (JSC::Structure::createStructure):
        (JSC::JSCell::createDummyStructure):
        (JSC::StructureTransitionTable::WeakGCMapFinalizerCallback::keyForFinalizer):
        * runtime/StructureChain.cpp:
        (JSC::StructureChain::StructureChain):
        (JSC::StructureChain::markChildren):
        * runtime/StructureChain.h:
        (JSC::StructureChain::create):
        (JSC::StructureChain::head):
        (JSC::StructureChain::createStructure):
        * runtime/StructureTransitionTable.h:
        (JSC::StructureTransitionTable::WeakGCMapFinalizerCallback::finalizerContextFor):
        (JSC::StructureTransitionTable::~StructureTransitionTable):
        (JSC::StructureTransitionTable::slot):
        (JSC::StructureTransitionTable::setMap):
        (JSC::StructureTransitionTable::singleTransition):
        (JSC::StructureTransitionTable::clearSingleTransition):
        (JSC::StructureTransitionTable::setSingleTransition):
        * runtime/WeakGCMap.h:
        (JSC::DefaultWeakGCMapFinalizerCallback::finalizerContextFor):
        (JSC::DefaultWeakGCMapFinalizerCallback::keyForFinalizer):
        (JSC::WeakGCMap::contains):
        (JSC::WeakGCMap::find):
        (JSC::WeakGCMap::remove):
        (JSC::WeakGCMap::add):
        (JSC::WeakGCMap::set):
        (JSC::WeakGCMap::finalize):
        * runtime/WriteBarrier.h:
        (JSC::writeBarrier):
        (JSC::WriteBarrierBase::set):
        (JSC::WriteBarrierBase::operator*):
        (JSC::WriteBarrierBase::operator->):
        (JSC::WriteBarrierBase::setWithoutWriteBarrier):
2011-04-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Fix up JSG to correctly mark Structure, et al.

        * JSRun.cpp:
        (JSGlueGlobalObject::JSGlueGlobalObject):
        * JSRun.h:
        * JSUtils.cpp:
        (JSObjectKJSValue):
        * UserObjectImp.cpp:
        (UserObjectImp::UserObjectImp):
        * UserObjectImp.h:
        (UserObjectImp::createStructure):
2011-04-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Update WebCore for Structure being a GC allocated object

        * WebCore.exp.in:
        * bindings/js/JSAudioConstructor.h:
        (WebCore::JSAudioConstructor::createStructure):
        * bindings/js/JSDOMBinding.cpp:
        (WebCore::cacheDOMStructure):
        * bindings/js/JSDOMBinding.h:
        (WebCore::DOMObjectWithGlobalPointer::createStructure):
        (WebCore::DOMObjectWithGlobalPointer::DOMObjectWithGlobalPointer):
        (WebCore::DOMConstructorObject::createStructure):
        (WebCore::DOMConstructorObject::DOMConstructorObject):
        (WebCore::DOMConstructorWithDocument::DOMConstructorWithDocument):
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
        (WebCore::JSDOMGlobalObject::markChildren):
        * bindings/js/JSDOMGlobalObject.h:
        (WebCore::JSDOMGlobalObject::createStructure):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
        * bindings/js/JSDOMWindowBase.h:
        (WebCore::JSDOMWindowBase::createStructure):
        * bindings/js/JSDOMWindowShell.cpp:
        (WebCore::JSDOMWindowShell::JSDOMWindowShell):
        (WebCore::JSDOMWindowShell::setWindow):
        * bindings/js/JSDOMWindowShell.h:
        (WebCore::JSDOMWindowShell::createStructure):
        * bindings/js/JSDOMWrapper.h:
        (WebCore::DOMObject::DOMObject):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::JSEventListener):
        * bindings/js/JSImageConstructor.h:
        (WebCore::JSImageConstructor::createStructure):
        * bindings/js/JSImageDataCustom.cpp:
        (WebCore::toJS):
        * bindings/js/JSOptionConstructor.h:
        (WebCore::JSOptionConstructor::createStructure):
        * bindings/js/JSWorkerContextBase.cpp:
        (WebCore::JSWorkerContextBase::JSWorkerContextBase):
        * bindings/js/JSWorkerContextBase.h:
        (WebCore::JSWorkerContextBase::createStructure):
        * bindings/js/ScriptCachedFrameData.h:
        * bindings/js/SerializedScriptValue.h:
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::initScript):
        * bindings/scripts/CodeGeneratorJS.pm:
        * bridge/c/CRuntimeObject.h:
        (JSC::Bindings::CRuntimeObject::createStructure):
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CRuntimeMethod::createStructure):
        * bridge/jni/jsc/JavaInstanceJSC.cpp:
        (JavaRuntimeMethod::createStructure):
        * bridge/jni/jsc/JavaRuntimeObject.h:
        (JSC::Bindings::JavaRuntimeObject::createStructure):
        * bridge/objc/ObjCRuntimeObject.h:
        (JSC::Bindings::ObjCRuntimeObject::createStructure):
        * bridge/objc/objc_instance.mm:
        (ObjCRuntimeMethod::createStructure):
        * bridge/objc/objc_runtime.h:
        (JSC::Bindings::ObjcFallbackObjectImp::createStructure):
        * bridge/runtime_array.cpp:
        (JSC::RuntimeArray::RuntimeArray):
        * bridge/runtime_array.h:
        (JSC::RuntimeArray::createStructure):
        * bridge/runtime_method.cpp:
        (JSC::RuntimeMethod::RuntimeMethod):
        * bridge/runtime_method.h:
        (JSC::RuntimeMethod::createStructure):
        * bridge/runtime_object.cpp:
        (JSC::Bindings::RuntimeObject::RuntimeObject):
        * bridge/runtime_object.h:
        (JSC::Bindings::RuntimeObject::createStructure):
        * history/HistoryItem.h:
2011-04-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Update WebKit for the world of GC allocated Structure

        * Plugins/Hosted/NetscapePluginInstanceProxy.h:
        * Plugins/Hosted/ProxyInstance.mm:
        (WebKit::ProxyRuntimeMethod::createStructure):
        * Plugins/Hosted/ProxyRuntimeObject.h:
        (WebKit::ProxyRuntimeObject::createStructure):
2011-04-13  Oliver Hunt  <oliver@apple.com>

        Reviewed by Geoff Garen.

        GC allocate Structure
        https://bugs.webkit.org/show_bug.cgi?id=58483

        Update WK2 for the world of GC allocated Structure

        * WebProcess/Plugins/Netscape/JSNPMethod.h:
        (WebKit::JSNPMethod::createStructure):
        * WebProcess/Plugins/Netscape/JSNPObject.h:
        (WebKit::JSNPObject::createStructure):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8c419025
2011-04-13 Oliver Hunt <oliver@apple.com>
Reviewed by Geoff Garen.
GC allocate Structure
https://bugs.webkit.org/show_bug.cgi?id=58483
Additional structures are allocated beyond the expected threshold
so we preflight the test to get them allocated.
* fast/dom/gc-10.html:
2011-04-13 Abhishek Arya <inferno@chromium.org>
Reviewed by James Robinson.
......@@ -20,6 +20,7 @@ function test()
if (window.GCController)
{
GCController.collect();
window.frames.myframe.location.reload(true);
before = GCController.getJSObjectCount();
window.frames.myframe.location.reload(true);
......
......@@ -38,7 +38,7 @@ namespace JSC {
const ClassInfo JSCallbackConstructor::s_info = { "CallbackConstructor", &JSObjectWithGlobalObject::s_info, 0, 0 };
JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)
JSCallbackConstructor::JSCallbackConstructor(JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)
: JSObjectWithGlobalObject(globalObject, structure)
, m_class(jsClass)
, m_callback(callback)
......
......@@ -33,13 +33,13 @@ namespace JSC {
class JSCallbackConstructor : public JSObjectWithGlobalObject {
public:
JSCallbackConstructor(JSGlobalObject*, NonNullPassRefPtr<Structure>, JSClassRef, JSObjectCallAsConstructorCallback);
JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
virtual ~JSCallbackConstructor();
JSClassRef classRef() const { return m_class; }
JSObjectCallAsConstructorCallback callback() const { return m_callback; }
static const ClassInfo s_info;
static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto)
static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
{
return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
......
......@@ -39,7 +39,7 @@ public:
// InternalFunction mish-mashes constructor and function behavior -- we should
// refactor the code so this override isn't necessary
static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto)
static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
{
return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
}
......
......@@ -117,8 +117,8 @@ struct JSCallbackObjectData : WeakHandleOwner {
template <class Base>
class JSCallbackObject : public Base {
public:
JSCallbackObject(ExecState*, JSGlobalObject*, NonNullPassRefPtr<Structure>, JSClassRef, void* data);
JSCallbackObject(JSClassRef, NonNullPassRefPtr<Structure>);
JSCallbackObject(ExecState*, JSGlobalObject*, Structure*, JSClassRef, void* data);
JSCallbackObject(JSGlobalData&, JSClassRef, Structure*);
void setPrivate(void* data);
void* getPrivate();
......@@ -128,7 +128,7 @@ public:
JSClassRef classRef() const { return m_callbackObjectData->jsClass; }
bool inherits(JSClassRef) const;
static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto)
static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
{
return Structure::create(globalData, proto, TypeInfo(ObjectType, StructureFlags), Base::AnonymousSlotCount, &s_info);
}
......
......@@ -50,7 +50,7 @@ inline JSCallbackObject<Base>* JSCallbackObject<Base>::asCallbackObject(JSValue
}
template <class Base>
JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, NonNullPassRefPtr<Structure> structure, JSClassRef jsClass, void* data)
JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef jsClass, void* data)
: Base(globalObject, structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(data, jsClass)))
{
......@@ -61,8 +61,8 @@ JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSGlobalObject* global
// Global object constructor.
// FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one.
template <class Base>
JSCallbackObject<Base>::JSCallbackObject(JSClassRef jsClass, NonNullPassRefPtr<Structure> structure)
: Base(structure)
JSCallbackObject<Base>::JSCallbackObject(JSGlobalData& globalData, JSClassRef jsClass, Structure* structure)
: Base(globalData, structure)
, m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass)))
{
ASSERT(Base::inherits(&s_info));
......
......@@ -97,7 +97,7 @@ JSGlobalContextRef JSGlobalContextCreateInGroup(JSContextGroupRef group, JSClass
return JSGlobalContextRetain(toGlobalRef(globalObject->globalExec()));
}
JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(*globalData, globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
ExecState* exec = globalObject->globalExec();
JSValue prototype = globalObjectClass->prototype(exec);
if (!prototype)
......@@ -141,9 +141,10 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx)
// it may release a lot of GC memory - run the garbage collector now.
// * If there are more references remaining the the global object, then do nothing
// (specifically that is more protects, which we assume come from other JSGlobalContextRefs).
if (releasingContextGroup)
if (releasingContextGroup) {
globalData.clearBuiltinStructures();
globalData.heap.destroy();
else if (releasingGlobalObject)
} else if (releasingGlobalObject)
globalData.heap.collectAllGarbage();
globalData.deref();
......
This diff is collapsed.
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFxS2_E
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureEiRKNS_10IdentifierEPFxS2_E
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFPvS2_E
__ZN3JSC10JSFunctionC1EPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_9StructureEiRKNS_10IdentifierEPFPvS2_E
......@@ -114,14 +114,14 @@ __ZN3JSC10throwErrorEPNS_9ExecStateENS_7JSValueE
__ZN3JSC10throwErrorEPNS_9ExecStateEPNS_8JSObjectE
__ZN3JSC11JSByteArray13s_defaultInfoE
__ZN3JSC11JSByteArray15createStructureERNS_12JSGlobalDataENS_7JSValueEPKNS_9ClassInfoE
__ZN3JSC11JSByteArrayC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEPNS3_9ByteArrayE
__ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE
__ZN3JSC11MarkedSpace21allocateFromSizeClassERNS0_9SizeClassE
__ZN3JSC11ParserArena5resetEv
__ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeE
__ZN3JSC11createErrorEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC11regExpFlagsERKNS_7UStringE
__ZN3JSC12DateInstance6s_infoE
__ZN3JSC12DateInstanceC1EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEEd
__ZN3JSC12DateInstanceC1EPNS_9ExecStateEPNS_9StructureEd
__ZN3JSC12JSGlobalData10ClientDataD2Ev
__ZN3JSC12JSGlobalData11jsArrayVPtrE
__ZN3JSC12JSGlobalData12createLeakedENS_15ThreadStackTypeE
......@@ -132,10 +132,11 @@ __ZN3JSC12JSGlobalData14dumpSampleDataEPNS_9ExecStateE
__ZN3JSC12JSGlobalData14resetDateCacheEv
__ZN3JSC12JSGlobalData14sharedInstanceEv
__ZN3JSC12JSGlobalData15dumpRegExpTraceEv
__ZN3JSC12JSGlobalData22clearBuiltinStructuresEv
__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeE
__ZN3JSC12JSGlobalDataD1Ev
__ZN3JSC12RegExpObject6s_infoE
__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEENS4_INS_6RegExpEEE
__ZN3JSC12RegExpObjectC1EPNS_14JSGlobalObjectEPNS_9StructureEN3WTF17NonNullPassRefPtrINS_6RegExpEEE
__ZN3JSC12SamplingTool5setupEv
__ZN3JSC12SmallStrings17createEmptyStringEPNS_12JSGlobalDataE
__ZN3JSC12SmallStrings27createSingleCharacterStringEPNS_12JSGlobalDataEh
......@@ -146,7 +147,7 @@ __ZN3JSC12StringObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArr
__ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
__ZN3JSC12StringObject6s_infoE
__ZN3JSC12StringObjectC2EPNS_9ExecStateEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7UStringE
__ZN3JSC12StringObjectC2EPNS_9ExecStateEPNS_9StructureERKNS_7UStringE
__ZN3JSC12nonInlineNaNEv
__ZN3JSC13SamplingFlags4stopEv
__ZN3JSC13SamplingFlags5startEv
......@@ -174,7 +175,7 @@ __ZN3JSC15createTypeErrorEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC16InternalFunction12vtableAnchorEv
__ZN3JSC16InternalFunction4nameEPNS_9ExecStateE
__ZN3JSC16InternalFunction6s_infoE
__ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_10IdentifierE
__ZN3JSC16InternalFunctionC2EPNS_12JSGlobalDataEPNS_14JSGlobalObjectEPNS_9StructureERKNS_10IdentifierE
__ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE
__ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE
__ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
......@@ -205,7 +206,8 @@ __ZN3JSC23AbstractSamplingCounter4dumpEv
__ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
__ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
__ZN3JSC24DynamicGlobalObjectScopeC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectE
__ZN3JSC24JSObjectWithGlobalObjectC2EPNS_14JSGlobalObjectEN3WTF17NonNullPassRefPtrINS_9StructureEEE
__ZN3JSC24JSObjectWithGlobalObjectC2EPNS_14JSGlobalObjectEPNS_9StructureE
__ZN3JSC24JSObjectWithGlobalObjectC2ERNS_12JSGlobalDataEPNS_14JSGlobalObjectEPNS_9StructureE
__ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
__ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
__ZN3JSC35createInterruptedExecutionExceptionEPNS_12JSGlobalDataE
......@@ -254,9 +256,9 @@ __ZN3JSC7JSArray15setSubclassDataEPv
__ZN3JSC7JSArray18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC7JSArray6s_infoE
__ZN3JSC7JSArray9setLengthEj
__ZN3JSC7JSArrayC1EN3WTF17NonNullPassRefPtrINS_9StructureEEE
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEN3WTF17NonNullPassRefPtrINS_9StructureEEERKNS_7ArgListE
__ZN3JSC7JSArrayC2EN3WTF17NonNullPassRefPtrINS_9StructureEEE
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureE
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureERKNS_7ArgListE
__ZN3JSC7JSArrayC2ERNS_12JSGlobalDataEPNS_9StructureE
__ZN3JSC7JSArrayD2Ev
__ZN3JSC7JSValue13isValidCalleeEv
__ZN3JSC7Profile10restoreAllEv
......@@ -309,12 +311,11 @@ __ZN3JSC8Profiler13stopProfilingEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC8Profiler14startProfilingEPNS_9ExecStateERKNS_7UStringE
__ZN3JSC8Profiler8profilerEv
__ZN3JSC8evaluateEPNS_9ExecStateEPNS_14ScopeChainNodeERKNS_10SourceCodeENS_7JSValueE
__ZN3JSC8isZombieEPKNS_6JSCellE
__ZN3JSC9CodeBlockD1Ev
__ZN3JSC9CodeBlockD2Ev
__ZN3JSC9MarkStack10s_pageSizeE
__ZN3JSC9MarkStack18initializePagesizeEv
__ZN3JSC9Structure17stopIgnoringLeaksEv
__ZN3JSC9Structure18startIgnoringLeaksEv
__ZN3JSC9Structure21addPropertyTransitionERNS_12JSGlobalDataEPS0_RKNS_10IdentifierEjPNS_6JSCellERm
__ZN3JSC9Structure22materializePropertyMapERNS_12JSGlobalDataE
__ZN3JSC9Structure25changePrototypeTransitionERNS_12JSGlobalDataEPS0_NS_7JSValueE
......@@ -323,7 +324,7 @@ __ZN3JSC9Structure27despecifyFunctionTransitionERNS_12JSGlobalDataEPS0_RKNS_10Id
__ZN3JSC9Structure28addPropertyWithoutTransitionERNS_12JSGlobalDataERKNS_10IdentifierEjPNS_6JSCellE
__ZN3JSC9Structure3getERNS_12JSGlobalDataEPN3WTF10StringImplERjRPNS_6JSCellE
__ZN3JSC9Structure40addPropertyTransitionToExistingStructureEPS0_RKNS_10IdentifierEjPNS_6JSCellERm
__ZN3JSC9StructureC1ENS_7JSValueERKNS_8TypeInfoEjPKNS_9ClassInfoE
__ZN3JSC9StructureC1ERNS_12JSGlobalDataENS_7JSValueERKNS_8TypeInfoEjPKNS_9ClassInfoE
__ZN3JSC9StructureD1Ev
__ZN3JSC9constructEPNS_9ExecStateENS_7JSValueENS_13ConstructTypeERKNS_13ConstructDataERKNS_7ArgListE
__ZN3JSCeqERKNS_7UStringEPKc
......
......@@ -3,24 +3,25 @@ EXPORTS
??0CString@WTF@@QAE@PBD@Z
??0CString@WTF@@QAE@PBDI@Z
??0Collator@WTF@@QAE@PBD@Z
??0DateInstance@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@N@Z
??0DateInstance@JSC@@QAE@PAVExecState@1@PAVStructure@1@N@Z
??0DefaultGCActivityCallback@JSC@@QAE@PAVHeap@1@@Z
??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z
??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z
??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVIdentifier@1@@Z
??0JSArray@JSC@@QAE@AAVJSGlobalData@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVArgList@1@@Z
??0JSArray@JSC@@QAE@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@@Z
??0JSByteArray@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@PAVByteArray@4@@Z
??0JSFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@HABVIdentifier@1@P6I_J0@Z@Z
??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z
??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@PAVStructure@1@ABVIdentifier@1@@Z
??0JSArray@JSC@@QAE@AAVJSGlobalData@1@PAVStructure@1@@Z
??0JSArray@JSC@@QAE@AAVJSGlobalData@1@PAVStructure@1@ABVArgList@1@@Z
??0JSByteArray@JSC@@QAE@PAVExecState@1@PAVStructure@1@PAVByteArray@WTF@@@Z
??0JSFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@PAVStructure@1@HABVIdentifier@1@P6I_J0@Z@Z
??0JSLock@JSC@@QAE@PAVExecState@1@@Z
??0JSObjectWithGlobalObject@JSC@@IAE@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@@Z
??0JSObjectWithGlobalObject@JSC@@IAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@PAVStructure@1@@Z
??0JSObjectWithGlobalObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@@Z
??0MD5@WTF@@QAE@XZ
??0Mutex@WTF@@QAE@XZ
??0RefCountedLeakCounter@WTF@@QAE@PBD@Z
??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@V?$NonNullPassRefPtr@VRegExp@JSC@@@4@@Z
??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@PAVStructure@1@V?$NonNullPassRefPtr@VRegExp@JSC@@@WTF@@@Z
??0SHA1@WTF@@QAE@XZ
??0StringObject@JSC@@QAE@PAVExecState@1@V?$NonNullPassRefPtr@VStructure@JSC@@@WTF@@ABVUString@1@@Z
??0Structure@JSC@@AAE@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z
??0StringObject@JSC@@QAE@PAVExecState@1@PAVStructure@1@ABVUString@1@@Z
??0Structure@JSC@@AAE@AAVJSGlobalData@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z
??0ThreadCondition@WTF@@QAE@XZ
??0UString@JSC@@QAE@PBD@Z
??0UString@JSC@@QAE@PBDI@Z
......@@ -37,7 +38,6 @@ EXPORTS
??1RefCountedLeakCounter@WTF@@QAE@XZ
??1RegExp@JSC@@QAE@XZ
??1SourceProviderCache@JSC@@QAE@XZ
??1Structure@JSC@@QAE@XZ
??1ThreadCondition@WTF@@QAE@XZ
??1WTFThreadData@WTF@@QAE@XZ
??1WeakHandleOwner@JSC@@UAE@XZ
......@@ -52,8 +52,8 @@ EXPORTS
?addBytes@MD5@WTF@@QAEXPBEI@Z
?addBytes@SHA1@WTF@@QAEXPBEI@Z
?addCurrentThread@MachineThreads@JSC@@QAEXXZ
?addPropertyTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@AAVJSGlobalData@2@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
?addPropertyTransitionToExistingStructure@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
?addPropertyTransition@Structure@JSC@@SAPAV12@AAVJSGlobalData@2@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
?addPropertyTransitionToExistingStructure@Structure@JSC@@SAPAV12@PAV12@ABVIdentifier@2@IPAVJSCell@2@AAI@Z
?addPropertyWithoutTransition@Structure@JSC@@QAEIAAVJSGlobalData@2@ABVIdentifier@2@IPAVJSCell@2@@Z
?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z
?allocate@Heap@JSC@@QAEPAXI@Z
......@@ -78,13 +78,14 @@ EXPORTS
?callOnMainThreadAndWait@WTF@@YAXP6AXPAX@Z0@Z
?cancelCallOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
?capacity@Heap@JSC@@QBEIXZ
?changePrototypeTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@AAVJSGlobalData@2@PAV12@VJSValue@2@@Z
?changePrototypeTransition@Structure@JSC@@SAPAV12@AAVJSGlobalData@2@PAV12@VJSValue@2@@Z
?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@@Z
?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z
?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z
?checksum@MD5@WTF@@QAEXAAV?$Vector@E$0BA@@2@@Z
?className@JSObject@JSC@@UBE?AVUString@2@XZ
?clear@SourceProviderCache@JSC@@QAEXXZ
?clearBuiltinStructures@JSGlobalData@JSC@@QAEXXZ
?collate@Collator@WTF@@QBE?AW4Result@12@PB_WI0I@Z
?collectAllGarbage@Heap@JSC@@QAEXXZ
?computeHash@SHA1@WTF@@QAEXAAV?$Vector@E$0BE@@2@@Z
......@@ -108,7 +109,7 @@ EXPORTS
?createReferenceError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
?createSingleCharacterString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@E@Z
?createStackOverflowError@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z
?createStructure@JSByteArray@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@AAVJSGlobalData@2@VJSValue@2@PBUClassInfo@2@@Z
?createStructure@JSByteArray@JSC@@SAPAVStructure@2@AAVJSGlobalData@2@VJSValue@2@PBUClassInfo@2@@Z
?createSyntaxError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
?createTable@HashTable@JSC@@ABEXPAVJSGlobalData@2@@Z
?createThread@WTF@@YAIP6APAXPAX@Z0@Z
......@@ -144,7 +145,7 @@ EXPORTS
?deleteProperty@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@@Z
?deleteTable@HashTable@JSC@@QBEXXZ
?despecifyDictionaryFunction@Structure@JSC@@QAEXAAVJSGlobalData@2@ABVIdentifier@2@@Z
?despecifyFunctionTransition@Structure@JSC@@SA?AV?$PassRefPtr@VStructure@JSC@@@WTF@@AAVJSGlobalData@2@PAV12@ABVIdentifier@2@@Z
?despecifyFunctionTransition@Structure@JSC@@SAPAV12@AAVJSGlobalData@2@PAV12@ABVIdentifier@2@@Z
?destroy@Heap@JSC@@QAEXXZ
?detach@Debugger@JSC@@UAEXPAVJSGlobalObject@2@@Z
?detachThread@WTF@@YAXI@Z
......@@ -313,10 +314,8 @@ EXPORTS
?signal@ThreadCondition@WTF@@QAEXXZ
?size@Heap@JSC@@QBEIXZ
?slowAppend@MarkedArgumentBuffer@JSC@@AAEXVJSValue@2@@Z
?startIgnoringLeaks@Structure@JSC@@SAXXZ
?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVUString@2@@Z
?startSampling@JSGlobalData@JSC@@QAEXXZ
?stopIgnoringLeaks@Structure@JSC@@SAXXZ
?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVUString@2@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
?strtod@WTF@@YANPBDPAPAD@Z
......
......@@ -1390,31 +1390,9 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, JSGlo
CodeBlock::~CodeBlock()
{
#if ENABLE(INTERPRETER)
for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i)
derefStructures(&m_instructions[m_globalResolveInstructions[i]]);
for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i)
derefStructures(&m_instructions[m_propertyAccessInstructions[i]]);
#endif
#if ENABLE(JIT)
for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) {
if (m_globalResolveInfos[i].structure)
m_globalResolveInfos[i].structure->deref();
}
for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i)
m_structureStubInfos[i].deref();
for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
if (Structure* structure = m_methodCallLinkInfos[i].cachedStructure) {
structure->deref();
// Both members must be filled at the same time
ASSERT(!!m_methodCallLinkInfos[i].cachedPrototypeStructure);
m_methodCallLinkInfos[i].cachedPrototypeStructure->deref();
}
}
#endif // ENABLE(JIT)
#if DUMP_CODE_BLOCK_STATISTICS
......@@ -1422,35 +1400,37 @@ CodeBlock::~CodeBlock()
#endif
}
void CodeBlock::derefStructures(Instruction* vPC) const
void CodeBlock::markStructures(MarkStack& markStack, Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
vPC[4].u.structure->deref();
markStack.append(&vPC[4].u.structure);
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto)) {
vPC[4].u.structure->deref();
vPC[5].u.structure->deref();
markStack.append(&vPC[4].u.structure);
markStack.append(&vPC[5].u.structure);
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
vPC[4].u.structure->deref();
markStack.append(&vPC[4].u.structure);
markStack.append(&vPC[5].u.structureChain);
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
vPC[4].u.structure->deref();
vPC[5].u.structure->deref();
markStack.append(&vPC[4].u.structure);
markStack.append(&vPC[5].u.structure);
markStack.append(&vPC[6].u.structureChain);
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
vPC[4].u.structure->deref();
markStack.append(&vPC[4].u.structure);
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global) || vPC[0].u.opcode == interpreter->getOpcode(op_resolve_global_dynamic)) {
if (vPC[3].u.structure)
vPC[3].u.structure->deref();
markStack.append(&vPC[3].u.structure);
return;
}
if ((vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto_list))
......@@ -1460,7 +1440,7 @@ void CodeBlock::derefStructures(Instruction* vPC) const
|| (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto_list))
|| (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self_list))) {
PolymorphicAccessStructureList* polymorphicStructures = vPC[4].u.polymorphicStructures;
polymorphicStructures->derefStructures(vPC[5].u.operand);
polymorphicStructures->markAggregate(markStack, vPC[5].u.operand);
delete polymorphicStructures;
return;
}
......@@ -1469,37 +1449,6 @@ void CodeBlock::derefStructures(Instruction* vPC) const
ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));
}
void CodeBlock::refStructures(Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self)) {
vPC[4].u.structure->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto)) {
vPC[4].u.structure->ref();
vPC[5].u.structure->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
vPC[4].u.structure->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition)) {
vPC[4].u.structure->ref();
vPC[5].u.structure->ref();
return;
}
if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_replace)) {
vPC[4].u.structure->ref();
return;
}
// These instructions don't ref their Structures.
ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic));
}
void EvalCodeCache::markAggregate(MarkStack& markStack)
{
EvalCacheMap::iterator end = m_cacheMap.end();
......@@ -1524,30 +1473,24 @@ void CodeBlock::markAggregate(MarkStack& markStack)
markStack.append(&callLinkInfo(i).callee);
#endif
#if ENABLE(INTERPRETER)
Interpreter* interpreter = m_globalData->interpreter;
for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i) {
Instruction* vPC = &m_instructions[m_propertyAccessInstructions[i]];
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain))
markStack.append(&vPC[5].u.structureChain);
else if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition))
markStack.append(&vPC[6].u.structureChain);
}
for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i)
markStructures(markStack, &m_instructions[m_propertyAccessInstructions[i]]);
#endif
#if ENABLE(JIT)
for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) {
if (Structure* structure = m_globalResolveInfos[i].structure)
structure->markAggregate(markStack);
if (m_globalResolveInfos[i].structure)
markStack.append(&m_globalResolveInfos[i].structure);
}
for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i)
m_structureStubInfos[i].markAggregate(markStack);
for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
if (Structure* structure = m_methodCallLinkInfos[i].cachedStructure) {
if (m_methodCallLinkInfos[i].cachedStructure) {
// Both members must be filled at the same time
structure->markAggregate(markStack);
markStack.append(&m_methodCallLinkInfos[i].cachedStructure);
ASSERT(!!m_methodCallLinkInfos[i].cachedPrototypeStructure);
m_methodCallLinkInfos[i].cachedPrototypeStructure->markAggregate(markStack);
markStack.append(&m_methodCallLinkInfos[i].cachedPrototypeStructure);
}
}
#endif
......
......@@ -122,8 +122,6 @@ namespace JSC {
struct MethodCallLinkInfo {
MethodCallLinkInfo()
: cachedStructure(0)
, cachedPrototypeStructure(0)
{
}
......@@ -142,24 +140,23 @@ namespace JSC {
// - Once this transition has been taken once, cachedStructure is
// null and cachedPrototypeStructure is set to a nun-null value.
// - Once the call is linked both structures are set to non-null values.
cachedPrototypeStructure = (Structure*)1;
cachedPrototypeStructure.setWithoutWriteBarrier((Structure*)1);
}
CodeLocationCall callReturnLocation;
CodeLocationDataLabelPtr structureLabel;
Structure* cachedStructure;
Structure* cachedPrototypeStructure;
WriteBarrier<Structure> cachedStructure;
WriteBarrier<Structure> cachedPrototypeStructure;
};
struct GlobalResolveInfo {
GlobalResolveInfo(unsigned bytecodeOffset)
: structure(0)
, offset(0)
: offset(0)
, bytecodeOffset(bytecodeOffset)
{
}
Structure* structure;
WriteBarrier<Structure> structure;
unsigned offset;
unsigned bytecodeOffset;
};
......@@ -215,8 +212,6 @@ namespace JSC {
virtual ~CodeBlock();
void markAggregate(MarkStack&);
void refStructures(Instruction* vPC) const;
void derefStructures(Instruction* vPC) const;
static void dumpStatistics();
......@@ -486,6 +481,7 @@ namespace JSC {
void printGetByIdOp(ExecState*, int location, Vector<Instruction>::const_iterator&, const char* op) const;
void printPutByIdOp(ExecState*, int location, Vector<Instruction>::const_iterator&, const char* op) const;
#endif
void markStructures(MarkStack&, Instruction* vPC) const;
void createRareDataIfNecessary()
{
......
......@@ -61,45 +61,45 @@ namespace JSC {
struct PolymorphicStubInfo {
bool isChain;
PolymorphicAccessStructureListStubRoutineType stubRoutine;
Structure* base;
WriteBarrier<Structure> base;
union {
Structure* proto