Ignore:
Timestamp:
Jan 28, 2011, 3:39:54 PM (14 years ago)
Author:
[email protected]
Message:

2011-01-27 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Convert markstack to a slot visitor API
https://bugs.webkit.org/show_bug.cgi?id=53219

Move the MarkStack over to a slot based marking API.

In order to avoiding aliasing concerns there are two new types
that need to be used when holding on to JSValues and JSCell that
need to be marked: WriteBarrier and DeprecatedPtr. WriteBarrier
is expected to be used for any JSValue or Cell that's lifetime and
marking is controlled by another GC object. DeprecatedPtr is used
for any value that we need to rework ownership for.

The change over to this model has produced a large amount of
code changes, but they are mostly mechanical (forwarding JSGlobalData,
etc).

  • API/JSCallbackObject.h: (JSC::JSCallbackObjectData::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty): (JSC::JSCallbackObjectData::JSPrivatePropertyMap::markChildren): (JSC::JSCallbackObject::setPrivateProperty):
  • API/JSCallbackObjectFunctions.h: (JSC::::put): (JSC::::staticFunctionGetter):
  • API/JSObjectRef.cpp: (JSObjectMakeConstructor): (JSObjectSetPrivateProperty):
  • API/JSWeakObjectMapRefInternal.h:
  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::markAggregate):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::globalObject):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall): (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply): (JSC::BytecodeGenerator::findScopedProperty):
  • debugger/DebuggerActivation.cpp: (JSC::DebuggerActivation::DebuggerActivation): (JSC::DebuggerActivation::markChildren):
  • debugger/DebuggerActivation.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::resolve): (JSC::Interpreter::resolveSkip): (JSC::Interpreter::resolveGlobalDynamic): (JSC::Interpreter::resolveBaseAndProperty): (JSC::Interpreter::unwindCallFrame): (JSC::appendSourceToError): (JSC::Interpreter::execute): (JSC::Interpreter::privateExecute):
  • interpreter/Register.h: (JSC::Register::jsValueSlot):
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCacheGetByID): (JSC::DEFINE_STUB_FUNCTION):
  • jsc.cpp: (GlobalObject::GlobalObject):
  • runtime/Arguments.cpp: (JSC::Arguments::markChildren): (JSC::Arguments::getOwnPropertySlot): (JSC::Arguments::getOwnPropertyDescriptor): (JSC::Arguments::put):
  • runtime/Arguments.h: (JSC::Arguments::setActivation): (JSC::Arguments::Arguments):
  • runtime/ArrayConstructor.cpp: (JSC::ArrayConstructor::ArrayConstructor): (JSC::constructArrayWithSizeQuirk):
  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice):
  • runtime/BatchedTransitionOptimizer.h: (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer): (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
  • runtime/BooleanConstructor.cpp: (JSC::BooleanConstructor::BooleanConstructor): (JSC::constructBoolean): (JSC::constructBooleanFromImmediateBoolean):
  • runtime/BooleanPrototype.cpp: (JSC::BooleanPrototype::BooleanPrototype):
  • runtime/ConservativeSet.h: (JSC::ConservativeSet::mark):
  • runtime/DateConstructor.cpp: (JSC::DateConstructor::DateConstructor):
  • runtime/DateInstance.cpp: (JSC::DateInstance::DateInstance):
  • runtime/DatePrototype.cpp: (JSC::dateProtoFuncSetTime): (JSC::setNewValueFromTimeArgs): (JSC::setNewValueFromDateArgs): (JSC::dateProtoFuncSetYear):
  • runtime/ErrorConstructor.cpp: (JSC::ErrorConstructor::ErrorConstructor):
  • runtime/ErrorInstance.cpp: (JSC::ErrorInstance::ErrorInstance):
  • runtime/ErrorPrototype.cpp: (JSC::ErrorPrototype::ErrorPrototype):
  • runtime/FunctionConstructor.cpp: (JSC::FunctionConstructor::FunctionConstructor):
  • runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::FunctionPrototype):
  • runtime/GetterSetter.cpp: (JSC::GetterSetter::markChildren):
  • runtime/GetterSetter.h: (JSC::GetterSetter::GetterSetter): (JSC::GetterSetter::getter): (JSC::GetterSetter::setGetter): (JSC::GetterSetter::setter): (JSC::GetterSetter::setSetter):
  • runtime/GlobalEvalFunction.cpp: (JSC::GlobalEvalFunction::GlobalEvalFunction): (JSC::GlobalEvalFunction::markChildren):
  • runtime/GlobalEvalFunction.h: (JSC::GlobalEvalFunction::cachedGlobalObject):
  • runtime/Heap.cpp: (JSC::Heap::markProtectedObjects): (JSC::Heap::markTempSortVectors): (JSC::Heap::markRoots):
  • runtime/InternalFunction.cpp: (JSC::InternalFunction::InternalFunction):
  • runtime/JSAPIValueWrapper.h: (JSC::JSAPIValueWrapper::value): (JSC::JSAPIValueWrapper::JSAPIValueWrapper):
  • runtime/JSActivation.cpp: (JSC::JSActivation::put):
  • runtime/JSArray.cpp: (JSC::JSArray::JSArray): (JSC::JSArray::getOwnPropertySlot): (JSC::JSArray::getOwnPropertyDescriptor): (JSC::JSArray::put): (JSC::JSArray::putSlowCase): (JSC::JSArray::deleteProperty): (JSC::JSArray::increaseVectorLength): (JSC::JSArray::setLength): (JSC::JSArray::pop): (JSC::JSArray::push): (JSC::JSArray::unshiftCount): (JSC::JSArray::sort): (JSC::JSArray::fillArgList): (JSC::JSArray::copyToRegisters): (JSC::JSArray::compactForSorting):
  • runtime/JSArray.h: (JSC::JSArray::getIndex): (JSC::JSArray::setIndex): (JSC::JSArray::uncheckedSetIndex): (JSC::JSArray::markChildrenDirect):
  • runtime/JSByteArray.cpp: (JSC::JSByteArray::JSByteArray):
  • runtime/JSCell.h: (JSC::JSCell::MarkStack::append): (JSC::JSCell::MarkStack::appendCell):
  • runtime/JSFunction.cpp: (JSC::JSFunction::JSFunction): (JSC::JSFunction::getOwnPropertySlot):
  • runtime/JSGlobalObject.cpp: (JSC::markIfNeeded): (JSC::JSGlobalObject::reset): (JSC::JSGlobalObject::resetPrototype): (JSC::JSGlobalObject::markChildren):
  • runtime/JSGlobalObject.h: (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): (JSC::JSGlobalObject::regExpConstructor): (JSC::JSGlobalObject::errorConstructor): (JSC::JSGlobalObject::evalErrorConstructor): (JSC::JSGlobalObject::rangeErrorConstructor): (JSC::JSGlobalObject::referenceErrorConstructor): (JSC::JSGlobalObject::syntaxErrorConstructor): (JSC::JSGlobalObject::typeErrorConstructor): (JSC::JSGlobalObject::URIErrorConstructor): (JSC::JSGlobalObject::evalFunction): (JSC::JSGlobalObject::objectPrototype): (JSC::JSGlobalObject::functionPrototype): (JSC::JSGlobalObject::arrayPrototype): (JSC::JSGlobalObject::booleanPrototype): (JSC::JSGlobalObject::stringPrototype): (JSC::JSGlobalObject::numberPrototype): (JSC::JSGlobalObject::datePrototype): (JSC::JSGlobalObject::regExpPrototype): (JSC::JSGlobalObject::methodCallDummy): (JSC::constructArray):
  • runtime/JSONObject.cpp: (JSC::Stringifier::Holder::object): (JSC::Stringifier::Holder::objectSlot): (JSC::Stringifier::markAggregate): (JSC::Stringifier::stringify): (JSC::Stringifier::Holder::appendNextProperty): (JSC::Walker::callReviver): (JSC::Walker::walk):
  • runtime/JSObject.cpp: (JSC::JSObject::defineGetter): (JSC::JSObject::defineSetter): (JSC::JSObject::removeDirect): (JSC::JSObject::putDirectFunction): (JSC::JSObject::putDirectFunctionWithoutTransition): (JSC::putDescriptor): (JSC::JSObject::defineOwnProperty):
  • runtime/JSObject.h: (JSC::JSObject::putDirectOffset): (JSC::JSObject::putUndefinedAtDirectOffset): (JSC::JSObject::flattenDictionaryObject): (JSC::JSObject::putDirectInternal): (JSC::JSObject::putDirect): (JSC::JSObject::putDirectFunction): (JSC::JSObject::putDirectWithoutTransition): (JSC::JSObject::putDirectFunctionWithoutTransition): (JSC::JSValue::putDirect): (JSC::JSObject::allocatePropertyStorageInline): (JSC::JSObject::markChildrenDirect):
  • runtime/JSStaticScopeObject.cpp: (JSC::JSStaticScopeObject::markChildren):
  • runtime/JSString.cpp: (JSC::StringObject::create):
  • runtime/JSValue.h:
  • runtime/JSWrapperObject.cpp: (JSC::JSWrapperObject::markChildren):
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::internalValue): (JSC::JSWrapperObject::setInternalValue):
  • runtime/LiteralParser.cpp: (JSC::LiteralParser::parse):
  • runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot):
  • runtime/Lookup.h: (JSC::lookupPut):
  • runtime/MarkStack.h:
  • runtime/MathObject.cpp: (JSC::MathObject::MathObject):
  • runtime/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::NativeErrorConstructor):
  • runtime/NativeErrorPrototype.cpp: (JSC::NativeErrorPrototype::NativeErrorPrototype):
  • runtime/NumberConstructor.cpp: (JSC::NumberConstructor::NumberConstructor): (JSC::constructWithNumberConstructor):
  • runtime/NumberObject.cpp: (JSC::constructNumber):
  • runtime/NumberPrototype.cpp: (JSC::NumberPrototype::NumberPrototype):
  • runtime/ObjectConstructor.cpp: (JSC::ObjectConstructor::ObjectConstructor): (JSC::objectConstructorGetOwnPropertyDescriptor):
  • runtime/Operations.h: (JSC::normalizePrototypeChain): (JSC::resolveBase):
  • runtime/PrototypeFunction.cpp: (JSC::PrototypeFunction::PrototypeFunction):
  • runtime/PutPropertySlot.h: (JSC::PutPropertySlot::setExistingProperty): (JSC::PutPropertySlot::setNewProperty): (JSC::PutPropertySlot::base):
  • runtime/RegExpConstructor.cpp: (JSC::RegExpConstructor::RegExpConstructor):
  • runtime/ScopeChain.cpp: (JSC::ScopeChainNode::print):
  • runtime/ScopeChain.h: (JSC::ScopeChainNode::~ScopeChainNode): (JSC::ScopeChainIterator::operator*): (JSC::ScopeChainIterator::operator->): (JSC::ScopeChain::top):
  • runtime/ScopeChainMark.h: (JSC::ScopeChain::markAggregate):
  • runtime/SmallStrings.cpp: (JSC::isMarked): (JSC::SmallStrings::markChildren):
  • runtime/SmallStrings.h: (JSC::SmallStrings::emptyString): (JSC::SmallStrings::singleCharacterString): (JSC::SmallStrings::singleCharacterStrings):
  • runtime/StringConstructor.cpp: (JSC::StringConstructor::StringConstructor):
  • runtime/StringObject.cpp: (JSC::StringObject::StringObject):
  • runtime/StringObject.h:
  • runtime/StringPrototype.cpp: (JSC::StringPrototype::StringPrototype):
  • runtime/Structure.cpp: (JSC::Structure::flattenDictionaryStructure):
  • runtime/Structure.h: (JSC::Structure::storedPrototypeSlot):
  • runtime/WeakGCMap.h: (JSC::WeakGCMap::uncheckedGet): (JSC::WeakGCMap::uncheckedGetSlot): (JSC::::get): (JSC::::take): (JSC::::set): (JSC::::uncheckedRemove):
  • runtime/WriteBarrier.h: Added. (JSC::DeprecatedPtr::DeprecatedPtr): (JSC::DeprecatedPtr::get): (JSC::DeprecatedPtr::operator*): (JSC::DeprecatedPtr::operator->): (JSC::DeprecatedPtr::slot): (JSC::DeprecatedPtr::operator UnspecifiedBoolType*): (JSC::DeprecatedPtr::operator!): (JSC::WriteBarrierBase::set): (JSC::WriteBarrierBase::get): (JSC::WriteBarrierBase::operator*): (JSC::WriteBarrierBase::operator->): (JSC::WriteBarrierBase::slot): (JSC::WriteBarrierBase::operator UnspecifiedBoolType*): (JSC::WriteBarrierBase::operator!): (JSC::WriteBarrier::WriteBarrier): (JSC::operator==):

2011-01-27 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Convert markstack to a slot visitor API
https://bugs.webkit.org/show_bug.cgi?id=53219

There's no reason to recurse here, the value we
were marking was protected.

  • JSValueWrapper.cpp: (JSValueWrapper::JSObjectMark):

2011-01-27 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Convert markstack to a slot visitor API
https://bugs.webkit.org/show_bug.cgi?id=53219

Update WebCore to the new marking apis, correct bindings
codegen.

  • ForwardingHeaders/runtime/WriteBarrier.h: Added.
  • WebCore.exp.in:
  • bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::globalData):
  • bindings/js/JSAudioConstructor.cpp: (WebCore::JSAudioConstructor::JSAudioConstructor):
  • bindings/js/JSDOMBinding.cpp: (WebCore::markDOMNodesForDocument): (WebCore::markDOMObjectWrapper): (WebCore::markDOMNodeWrapper):
  • bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::markChildren): (WebCore::JSDOMGlobalObject::setInjectedScript): (WebCore::JSDOMGlobalObject::injectedScript):
  • bindings/js/JSDOMGlobalObject.h: (WebCore::JSDOMGlobalObject::JSDOMGlobalObjectData::JSDOMGlobalObjectData): (WebCore::getDOMConstructor):
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::setLocation): (WebCore::DialogHandler::dialogCreated):
  • bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::JSDOMWindowShell): (WebCore::JSDOMWindowShell::setWindow): (WebCore::JSDOMWindowShell::markChildren): (WebCore::JSDOMWindowShell::unwrappedObject):
  • bindings/js/JSDOMWindowShell.h: (WebCore::JSDOMWindowShell::window): (WebCore::JSDOMWindowShell::setWindow):
  • bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::JSEventListener): (WebCore::JSEventListener::markJSFunction):
  • bindings/js/JSEventListener.h: (WebCore::JSEventListener::jsFunction):
  • bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::setAll):
  • bindings/js/JSImageConstructor.cpp: (WebCore::JSImageConstructor::JSImageConstructor):
  • bindings/js/JSImageDataCustom.cpp: (WebCore::toJS):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::scopeChain): (WebCore::JSJavaScriptCallFrame::scopeType):
  • bindings/js/JSNodeFilterCondition.cpp: (WebCore::JSNodeFilterCondition::markAggregate): (WebCore::JSNodeFilterCondition::acceptNode):
  • bindings/js/JSNodeFilterCondition.h:
  • bindings/js/JSNodeFilterCustom.cpp:
  • bindings/js/JSOptionConstructor.cpp: (WebCore::JSOptionConstructor::JSOptionConstructor):
  • bindings/js/JSSQLResultSetRowListCustom.cpp: (WebCore::JSSQLResultSetRowList::item):
  • bindings/js/ScriptCachedFrameData.cpp: (WebCore::ScriptCachedFrameData::restore):
  • bindings/js/ScriptObject.cpp: (WebCore::ScriptGlobalObject::set):
  • bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::putProperty):
  • bindings/scripts/CodeGeneratorJS.pm:
  • dom/Document.h:

2011-01-27 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Convert markstack to a slot visitor API
https://bugs.webkit.org/show_bug.cgi?id=53219

Update to new marking api

  • WebView/WebScriptDebugDelegate.mm: (-[WebScriptCallFrame scopeChain]):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r76193 r77006  
    8181static const int preferredScriptCheckTimeInterval = 1000;
    8282
    83 static inline void markIfNeeded(MarkStack& markStack, JSValue v)
    84 {
    85     if (v)
     83template <typename T> static inline void markIfNeeded(MarkStack& markStack, WriteBarrier<T>* v)
     84{
     85    if (*v)
    8686        markStack.append(v);
    8787}
     
    8989static inline void markIfNeeded(MarkStack& markStack, const RefPtr<Structure>& s)
    9090{
    91     if (s)
    92         markIfNeeded(markStack, s->storedPrototype());
     91    if (s && s->storedPrototype())
     92        markStack.append(s->storedPrototypeSlot());
    9393}
    9494
     
    203203    // Prototypes
    204204
    205     d()->functionPrototype = new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(jsNull())); // The real prototype will be set once ObjectPrototype is created.
    206     d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype);
    207     d()->internalFunctionStructure = InternalFunction::createStructure(d()->functionPrototype);
     205    d()->functionPrototype.set(exec->globalData(), this, new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(jsNull()))); // The real prototype will be set once ObjectPrototype is created.
     206    d()->prototypeFunctionStructure = PrototypeFunction::createStructure(d()->functionPrototype.get());
     207    d()->internalFunctionStructure = InternalFunction::createStructure(d()->functionPrototype.get());
    208208    NativeFunctionWrapper* callFunction = 0;
    209209    NativeFunctionWrapper* applyFunction = 0;
    210210    d()->functionPrototype->addFunctionProperties(exec, this, d()->prototypeFunctionStructure.get(), &callFunction, &applyFunction);
    211     d()->callFunction = callFunction;
    212     d()->applyFunction = applyFunction;
    213     d()->objectPrototype = new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get());
    214     d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype);
     211    d()->callFunction.set(exec->globalData(), this, callFunction);
     212    d()->applyFunction.set(exec->globalData(), this, applyFunction);
     213    d()->objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get()));
     214    d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype.get());
    215215
    216216    d()->emptyObjectStructure = d()->objectPrototype->inheritorID();
    217217
    218     d()->functionStructure = JSFunction::createStructure(d()->functionPrototype);
    219     d()->callbackFunctionStructure = JSCallbackFunction::createStructure(d()->functionPrototype);
    220     d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype);
    221     d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype);
    222     d()->callbackObjectStructure = JSCallbackObject<JSObjectWithGlobalObject>::createStructure(d()->objectPrototype);
    223 
    224     d()->arrayPrototype = new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(d()->objectPrototype));
    225     d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype);
    226     d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype);
    227 
    228     d()->stringPrototype = new (exec) StringPrototype(exec, this, StringPrototype::createStructure(d()->objectPrototype));
    229     d()->stringObjectStructure = StringObject::createStructure(d()->stringPrototype);
    230 
    231     d()->booleanPrototype = new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());
    232     d()->booleanObjectStructure = BooleanObject::createStructure(d()->booleanPrototype);
    233 
    234     d()->numberPrototype = new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());
    235     d()->numberObjectStructure = NumberObject::createStructure(d()->numberPrototype);
    236 
    237     d()->datePrototype = new (exec) DatePrototype(exec, this, DatePrototype::createStructure(d()->objectPrototype));
    238     d()->dateStructure = DateInstance::createStructure(d()->datePrototype);
    239 
    240     d()->regExpPrototype = new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());
    241     d()->regExpStructure = RegExpObject::createStructure(d()->regExpPrototype);
    242 
    243     d()->methodCallDummy = constructEmptyObject(exec);
    244 
    245     ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(d()->objectPrototype), d()->prototypeFunctionStructure.get());
     218    d()->functionStructure = JSFunction::createStructure(d()->functionPrototype.get());
     219    d()->callbackFunctionStructure = JSCallbackFunction::createStructure(d()->functionPrototype.get());
     220    d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype.get());
     221    d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype.get());
     222    d()->callbackObjectStructure = JSCallbackObject<JSObjectWithGlobalObject>::createStructure(d()->objectPrototype.get());
     223
     224    d()->arrayPrototype.set(exec->globalData(), this, new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(d()->objectPrototype.get())));
     225    d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype.get());
     226    d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype.get());
     227
     228    d()->stringPrototype.set(exec->globalData(), this, new (exec) StringPrototype(exec, this, StringPrototype::createStructure(d()->objectPrototype.get())));
     229    d()->stringObjectStructure = StringObject::createStructure(d()->stringPrototype.get());
     230
     231    d()->booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get()));
     232    d()->booleanObjectStructure = BooleanObject::createStructure(d()->booleanPrototype.get());
     233
     234    d()->numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get()));
     235    d()->numberObjectStructure = NumberObject::createStructure(d()->numberPrototype.get());
     236
     237    d()->datePrototype.set(exec->globalData(), this, new (exec) DatePrototype(exec, this, DatePrototype::createStructure(d()->objectPrototype.get())));
     238    d()->dateStructure = DateInstance::createStructure(d()->datePrototype.get());
     239
     240    d()->regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get()));
     241    d()->regExpStructure = RegExpObject::createStructure(d()->regExpPrototype.get());
     242
     243    d()->methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec));
     244
     245    ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(d()->objectPrototype.get()), d()->prototypeFunctionStructure.get());
    246246    d()->errorStructure = ErrorInstance::createStructure(errorPrototype);
    247247
    248248    // Constructors
    249249
    250     JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get());
    251     JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(d()->functionPrototype), d()->functionPrototype);
    252     JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype, d()->prototypeFunctionStructure.get());
    253     JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->stringPrototype);
    254     JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(d()->functionPrototype), d()->booleanPrototype);
    255     JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(d()->functionPrototype), d()->numberPrototype);
    256     JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->datePrototype);
    257 
    258     d()->regExpConstructor = new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(d()->functionPrototype), d()->regExpPrototype);
    259 
    260     d()->errorConstructor = new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(d()->functionPrototype), errorPrototype);
     250    JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(d()->functionPrototype.get()), d()->objectPrototype.get(), d()->prototypeFunctionStructure.get());
     251    JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(d()->functionPrototype.get()), d()->functionPrototype.get());
     252    JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(d()->functionPrototype.get()), d()->arrayPrototype.get(), d()->prototypeFunctionStructure.get());
     253    JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(d()->functionPrototype.get()), d()->prototypeFunctionStructure.get(), d()->stringPrototype.get());
     254    JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(d()->functionPrototype.get()), d()->booleanPrototype.get());
     255    JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(d()->functionPrototype.get()), d()->numberPrototype.get());
     256    JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(d()->functionPrototype.get()), d()->prototypeFunctionStructure.get(), d()->datePrototype.get());
     257
     258    d()->regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(d()->functionPrototype.get()), d()->regExpPrototype.get()));
     259
     260    d()->errorConstructor.set(exec->globalData(), this, new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(d()->functionPrototype.get()), errorPrototype));
    261261
    262262    RefPtr<Structure> nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(errorPrototype);
    263     RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype);
    264     d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError");
    265     d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError");
    266     d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError");
    267     d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError");
    268     d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError");
    269     d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError");
    270 
    271     d()->objectPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, objectConstructor, DontEnum);
    272     d()->functionPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, functionConstructor, DontEnum);
    273     d()->arrayPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, arrayConstructor, DontEnum);
    274     d()->booleanPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, booleanConstructor, DontEnum);
    275     d()->stringPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, stringConstructor, DontEnum);
    276     d()->numberPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, numberConstructor, DontEnum);
    277     d()->datePrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, dateConstructor, DontEnum);
    278     d()->regExpPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, d()->regExpConstructor, DontEnum);
    279     errorPrototype->putDirectFunctionWithoutTransition(exec->propertyNames().constructor, d()->errorConstructor, DontEnum);
     263    RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype.get());
     264    d()->evalErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError"));
     265    d()->rangeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError"));
     266    d()->referenceErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError"));
     267    d()->syntaxErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError"));
     268    d()->typeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError"));
     269    d()->URIErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError"));
     270
     271    d()->objectPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, objectConstructor, DontEnum);
     272    d()->functionPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, functionConstructor, DontEnum);
     273    d()->arrayPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, arrayConstructor, DontEnum);
     274    d()->booleanPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, booleanConstructor, DontEnum);
     275    d()->stringPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, stringConstructor, DontEnum);
     276    d()->numberPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, numberConstructor, DontEnum);
     277    d()->datePrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, dateConstructor, DontEnum);
     278    d()->regExpPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, d()->regExpConstructor.get(), DontEnum);
     279    errorPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, d()->errorConstructor.get(), DontEnum);
    280280
    281281    // Set global constructors
     
    283283    // FIXME: These properties could be handled by a static hash table.
    284284
    285     putDirectFunctionWithoutTransition(Identifier(exec, "Object"), objectConstructor, DontEnum);
    286     putDirectFunctionWithoutTransition(Identifier(exec, "Function"), functionConstructor, DontEnum);
    287     putDirectFunctionWithoutTransition(Identifier(exec, "Array"), arrayConstructor, DontEnum);
    288     putDirectFunctionWithoutTransition(Identifier(exec, "Boolean"), booleanConstructor, DontEnum);
    289     putDirectFunctionWithoutTransition(Identifier(exec, "String"), stringConstructor, DontEnum);
    290     putDirectFunctionWithoutTransition(Identifier(exec, "Number"), numberConstructor, DontEnum);
    291     putDirectFunctionWithoutTransition(Identifier(exec, "Date"), dateConstructor, DontEnum);
    292     putDirectFunctionWithoutTransition(Identifier(exec, "RegExp"), d()->regExpConstructor, DontEnum);
    293     putDirectFunctionWithoutTransition(Identifier(exec, "Error"), d()->errorConstructor, DontEnum);
    294     putDirectFunctionWithoutTransition(Identifier(exec, "EvalError"), d()->evalErrorConstructor, DontEnum);
    295     putDirectFunctionWithoutTransition(Identifier(exec, "RangeError"), d()->rangeErrorConstructor, DontEnum);
    296     putDirectFunctionWithoutTransition(Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor, DontEnum);
    297     putDirectFunctionWithoutTransition(Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor, DontEnum);
    298     putDirectFunctionWithoutTransition(Identifier(exec, "TypeError"), d()->typeErrorConstructor, DontEnum);
    299     putDirectFunctionWithoutTransition(Identifier(exec, "URIError"), d()->URIErrorConstructor, DontEnum);
     285    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Object"), objectConstructor, DontEnum);
     286    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Function"), functionConstructor, DontEnum);
     287    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Array"), arrayConstructor, DontEnum);
     288    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Boolean"), booleanConstructor, DontEnum);
     289    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "String"), stringConstructor, DontEnum);
     290    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Number"), numberConstructor, DontEnum);
     291    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Date"), dateConstructor, DontEnum);
     292    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "RegExp"), d()->regExpConstructor.get(), DontEnum);
     293    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "Error"), d()->errorConstructor.get(), DontEnum);
     294    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "EvalError"), d()->evalErrorConstructor.get(), DontEnum);
     295    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "RangeError"), d()->rangeErrorConstructor.get(), DontEnum);
     296    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "ReferenceError"), d()->referenceErrorConstructor.get(), DontEnum);
     297    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "SyntaxError"), d()->syntaxErrorConstructor.get(), DontEnum);
     298    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "TypeError"), d()->typeErrorConstructor.get(), DontEnum);
     299    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), d()->URIErrorConstructor.get(), DontEnum);
    300300
    301301    // Set global values.
    302302    GlobalPropertyInfo staticGlobals[] = {
    303         GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete),
     303        GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(d()->objectPrototype.get())), DontEnum | DontDelete),
    304304        GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(), DontEnum | DontDelete | ReadOnly),
    305305        GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(Inf), DontEnum | DontDelete | ReadOnly),
    306306        GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly),
    307         GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype)), DontEnum | DontDelete)
     307        GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(d()->objectPrototype.get())), DontEnum | DontDelete)
    308308    };
    309309
     
    312312    // Set global functions.
    313313
    314     d()->evalFunction = new (exec) GlobalEvalFunction(exec, this, GlobalEvalFunction::createStructure(d()->functionPrototype), 1, exec->propertyNames().eval, globalFuncEval, this);
    315     putDirectFunctionWithoutTransition(exec, d()->evalFunction, DontEnum);
     314    d()->evalFunction.set(exec->globalData(), this, new (exec) GlobalEvalFunction(exec, this, GlobalEvalFunction::createStructure(d()->functionPrototype.get()), 1, exec->propertyNames().eval, globalFuncEval, this));
     315    putDirectFunctionWithoutTransition(exec, d()->evalFunction.get(), DontEnum);
    316316    putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);
    317317    putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, this, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);
     
    337337
    338338    JSObject* oldLastInPrototypeChain = lastInPrototypeChain(this);
    339     JSObject* objectPrototype = d()->objectPrototype;
     339    JSObject* objectPrototype = d()->objectPrototype.get();
    340340    if (oldLastInPrototypeChain != objectPrototype)
    341341        oldLastInPrototypeChain->setPrototype(objectPrototype);
     
    350350        (*it)->markAggregate(markStack);
    351351
    352     markIfNeeded(markStack, d()->regExpConstructor);
    353     markIfNeeded(markStack, d()->errorConstructor);
    354     markIfNeeded(markStack, d()->evalErrorConstructor);
    355     markIfNeeded(markStack, d()->rangeErrorConstructor);
    356     markIfNeeded(markStack, d()->referenceErrorConstructor);
    357     markIfNeeded(markStack, d()->syntaxErrorConstructor);
    358     markIfNeeded(markStack, d()->typeErrorConstructor);
    359     markIfNeeded(markStack, d()->URIErrorConstructor);
    360 
    361     markIfNeeded(markStack, d()->evalFunction);
    362     markIfNeeded(markStack, d()->callFunction);
    363     markIfNeeded(markStack, d()->applyFunction);
    364 
    365     markIfNeeded(markStack, d()->objectPrototype);
    366     markIfNeeded(markStack, d()->functionPrototype);
    367     markIfNeeded(markStack, d()->arrayPrototype);
    368     markIfNeeded(markStack, d()->booleanPrototype);
    369     markIfNeeded(markStack, d()->stringPrototype);
    370     markIfNeeded(markStack, d()->numberPrototype);
    371     markIfNeeded(markStack, d()->datePrototype);
    372     markIfNeeded(markStack, d()->regExpPrototype);
    373 
    374     markIfNeeded(markStack, d()->methodCallDummy);
     352    markIfNeeded(markStack, &d()->regExpConstructor);
     353    markIfNeeded(markStack, &d()->errorConstructor);
     354    markIfNeeded(markStack, &d()->evalErrorConstructor);
     355    markIfNeeded(markStack, &d()->rangeErrorConstructor);
     356    markIfNeeded(markStack, &d()->referenceErrorConstructor);
     357    markIfNeeded(markStack, &d()->syntaxErrorConstructor);
     358    markIfNeeded(markStack, &d()->typeErrorConstructor);
     359    markIfNeeded(markStack, &d()->URIErrorConstructor);
     360
     361    markIfNeeded(markStack, &d()->evalFunction);
     362    markIfNeeded(markStack, &d()->callFunction);
     363    markIfNeeded(markStack, &d()->applyFunction);
     364
     365    markIfNeeded(markStack, &d()->objectPrototype);
     366    markIfNeeded(markStack, &d()->functionPrototype);
     367    markIfNeeded(markStack, &d()->arrayPrototype);
     368    markIfNeeded(markStack, &d()->booleanPrototype);
     369    markIfNeeded(markStack, &d()->stringPrototype);
     370    markIfNeeded(markStack, &d()->numberPrototype);
     371    markIfNeeded(markStack, &d()->datePrototype);
     372    markIfNeeded(markStack, &d()->regExpPrototype);
     373
     374    markIfNeeded(markStack, &d()->methodCallDummy);
    375375
    376376    markIfNeeded(markStack, d()->errorStructure);
     
    397397        // Outside the execution of global code, when our variables are torn off,
    398398        // we can mark the torn-off array.
    399         markStack.appendValues(d()->registerArray.get(), d()->registerArraySize);
     399        markStack.deprecatedAppendValues(d()->registerArray.get(), d()->registerArraySize);
    400400    } else if (d()->registers) {
    401401        // During execution of global code, when our variables are in the register file,
    402402        // the symbol table tells us how many variables there are, and registers
    403403        // points to where they end, and the registers used for execution begin.
    404         markStack.appendValues(d()->registers - symbolTable().size(), symbolTable().size());
     404        markStack.deprecatedAppendValues(d()->registers - symbolTable().size(), symbolTable().size());
    405405    }
    406406}
Note: See TracChangeset for help on using the changeset viewer.