Ignore:
Timestamp:
Sep 20, 2008, 7:29:12 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-09-20 Darin Adler <Darin Adler>

Reviewed by Maciej Stachowiak.

This also includes some optimizations that make the change an overall
small speedup. Without those it was a bit of a slowdown.

  • API/JSCallbackConstructor.cpp: (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
  • API/JSCallbackConstructor.h: Ditto.
  • API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
  • API/JSCallbackObject.h: Take a structure.
  • API/JSCallbackObjectFunctions.h: (JSC::JSCallbackObject::JSCallbackObject): Ditto.
  • API/JSClassRef.cpp: (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype if there's a custom prototype involved.
  • API/JSObjectRef.cpp: (JSObjectMake): Ditto. (JSObjectMakeConstructor): Pass in a structure.
  • VM/Machine.cpp: (JSC::jsLess): Added a special case for when both arguments are strings. This avoids converting both strings to with UString::toDouble. (JSC::jsLessEq): Ditto. (JSC::Machine::privateExecute): Pass in a structure. (JSC::Machine::cti_op_construct_JSConstruct): Ditto. (JSC::Machine::cti_op_new_regexp): Ditto. (JSC::Machine::cti_op_is_string): Ditto.
  • VM/Machine.h: Made isJSString public so it can be used in the CTI.
  • kjs/Arguments.cpp: (JSC::Arguments::Arguments): Pass in a structure.
  • kjs/JSCell.h: Mark constructor explicit.
  • kjs/JSGlobalObject.cpp: (JSC::markIfNeeded): Added an overload for marking structures. (JSC::JSGlobalObject::reset): Eliminate code to set data members to zero. We now do that in the constructor, and we no longer use this anywhere except in the constructor. Added code to create structures. Pass structures rather than prototypes when creating objects. (JSC::JSGlobalObject::mark): Mark the structures.
  • kjs/JSGlobalObject.h: Removed unneeded class declarations. Added initializers for raw pointers in JSGlobalObjectData so everything starts with a 0. Added structure data and accessor functions.
  • kjs/JSImmediate.cpp: (JSC::JSImmediate::nonInlineNaN): Added.
  • kjs/JSImmediate.h: (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
  • kjs/JSNumberCell.cpp: (JSC::jsNumberCell): Made non-inline to avoid PIC branches in functions that call this one. (JSC::jsNaN): Ditto.
  • kjs/JSNumberCell.h: Ditto.
  • kjs/JSObject.h: Removed constructor that takes a prototype. All callers now pass structures.
  • kjs/ArrayConstructor.cpp: (JSC::ArrayConstructor::ArrayConstructor): (JSC::constructArrayWithSizeQuirk):
  • kjs/ArrayConstructor.h:
  • kjs/ArrayPrototype.cpp: (JSC::ArrayPrototype::ArrayPrototype):
  • kjs/ArrayPrototype.h:
  • kjs/BooleanConstructor.cpp: (JSC::BooleanConstructor::BooleanConstructor): (JSC::constructBoolean): (JSC::constructBooleanFromImmediateBoolean):
  • kjs/BooleanConstructor.h:
  • kjs/BooleanObject.cpp: (JSC::BooleanObject::BooleanObject):
  • kjs/BooleanObject.h:
  • kjs/BooleanPrototype.cpp: (JSC::BooleanPrototype::BooleanPrototype):
  • kjs/BooleanPrototype.h:
  • kjs/DateConstructor.cpp: (JSC::DateConstructor::DateConstructor): (JSC::constructDate):
  • kjs/DateConstructor.h:
  • kjs/DateInstance.cpp: (JSC::DateInstance::DateInstance):
  • kjs/DateInstance.h:
  • kjs/DatePrototype.cpp: (JSC::DatePrototype::DatePrototype):
  • kjs/DatePrototype.h:
  • kjs/ErrorConstructor.cpp: (JSC::ErrorConstructor::ErrorConstructor): (JSC::constructError):
  • kjs/ErrorConstructor.h:
  • kjs/ErrorInstance.cpp: (JSC::ErrorInstance::ErrorInstance):
  • kjs/ErrorInstance.h:
  • kjs/ErrorPrototype.cpp: (JSC::ErrorPrototype::ErrorPrototype):
  • kjs/ErrorPrototype.h:
  • kjs/FunctionConstructor.cpp: (JSC::FunctionConstructor::FunctionConstructor):
  • kjs/FunctionConstructor.h:
  • kjs/FunctionPrototype.cpp: (JSC::FunctionPrototype::FunctionPrototype): (JSC::FunctionPrototype::addFunctionProperties):
  • kjs/FunctionPrototype.h:
  • kjs/GlobalEvalFunction.cpp: (JSC::GlobalEvalFunction::GlobalEvalFunction):
  • kjs/GlobalEvalFunction.h:
  • kjs/InternalFunction.cpp: (JSC::InternalFunction::InternalFunction):
  • kjs/InternalFunction.h: (JSC::InternalFunction::InternalFunction):
  • kjs/JSArray.cpp: (JSC::JSArray::JSArray): (JSC::constructEmptyArray): (JSC::constructArray):
  • kjs/JSArray.h:
  • kjs/JSFunction.cpp: (JSC::JSFunction::JSFunction): (JSC::JSFunction::construct):
  • kjs/JSObject.cpp: (JSC::constructEmptyObject):
  • kjs/JSString.cpp: (JSC::StringObject::create):
  • kjs/JSWrapperObject.h:
  • kjs/MathObject.cpp: (JSC::MathObject::MathObject):
  • kjs/MathObject.h:
  • kjs/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::NativeErrorConstructor): (JSC::NativeErrorConstructor::construct):
  • kjs/NativeErrorConstructor.h:
  • kjs/NativeErrorPrototype.cpp: (JSC::NativeErrorPrototype::NativeErrorPrototype):
  • kjs/NativeErrorPrototype.h:
  • kjs/NumberConstructor.cpp: (JSC::NumberConstructor::NumberConstructor): (JSC::constructWithNumberConstructor):
  • kjs/NumberConstructor.h:
  • kjs/NumberObject.cpp: (JSC::NumberObject::NumberObject): (JSC::constructNumber): (JSC::constructNumberFromImmediateNumber):
  • kjs/NumberObject.h:
  • kjs/NumberPrototype.cpp: (JSC::NumberPrototype::NumberPrototype):
  • kjs/NumberPrototype.h:
  • kjs/ObjectConstructor.cpp: (JSC::ObjectConstructor::ObjectConstructor): (JSC::constructObject):
  • kjs/ObjectConstructor.h:
  • kjs/ObjectPrototype.cpp: (JSC::ObjectPrototype::ObjectPrototype):
  • kjs/ObjectPrototype.h:
  • kjs/PrototypeFunction.cpp: (JSC::PrototypeFunction::PrototypeFunction):
  • kjs/PrototypeFunction.h:
  • kjs/RegExpConstructor.cpp: (JSC::RegExpConstructor::RegExpConstructor): (JSC::RegExpMatchesArray::RegExpMatchesArray): (JSC::constructRegExp):
  • kjs/RegExpConstructor.h:
  • kjs/RegExpObject.cpp: (JSC::RegExpObject::RegExpObject):
  • kjs/RegExpObject.h:
  • kjs/RegExpPrototype.cpp: (JSC::RegExpPrototype::RegExpPrototype):
  • kjs/RegExpPrototype.h:
  • kjs/Shell.cpp: (GlobalObject::GlobalObject):
  • kjs/StringConstructor.cpp: (JSC::StringConstructor::StringConstructor): (JSC::constructWithStringConstructor):
  • kjs/StringConstructor.h:
  • kjs/StringObject.cpp: (JSC::StringObject::StringObject):
  • kjs/StringObject.h:
  • kjs/StringObjectThatMasqueradesAsUndefined.h: (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
  • kjs/StringPrototype.cpp: (JSC::StringPrototype::StringPrototype):
  • kjs/StringPrototype.h: Take and pass structures.

WebCore:

2008-09-20 Darin Adler <Darin Adler>

Reviewed by Maciej Stachowiak.

  • bindings/js/JSCSSStyleDeclarationCustom.cpp: (WebCore::JSCSSStyleDeclaration::nameGetter): Pass in a structure ID. Note that this makes a new structure every time -- we could optimize this slightly be caching and reusing a single one.
  • bridge/runtime_method.cpp: (JSC::RuntimeMethod::RuntimeMethod): Create a unique structure using getDOMStructure.
  • bridge/runtime_method.h: (JSC::RuntimeMethod::createPrototype): Added createPrototype so getDOMStructure will work.
  • bindings/js/JSDOMWindowShell.cpp: (WebCore::JSDOMWindowShell::JSDOMWindowShell): Initialize m_window to 0; needed in case garbage collection happens while creating the JSDOMWindow.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSGlobalObject.cpp

    r36263 r36726  
    7878}
    7979
     80static inline void markIfNeeded(const RefPtr<StructureID>& s)
     81{
     82    if (s)
     83        s->mark();
     84}
     85
    8086JSGlobalObject::~JSGlobalObject()
    8187{
     
    192198    setRegisterArray(0, 0);
    193199
     200    ExecState* exec = d()->globalExec.get();
     201
    194202    // Prototypes
    195     d()->functionPrototype = 0;
    196     d()->objectPrototype = 0;
    197 
    198     d()->arrayPrototype = 0;
    199     d()->stringPrototype = 0;
    200     d()->booleanPrototype = 0;
    201     d()->numberPrototype = 0;
    202     d()->datePrototype = 0;
    203     d()->regExpPrototype = 0;
    204     d()->errorPrototype = 0;
    205    
    206     d()->evalErrorPrototype = 0;
    207     d()->rangeErrorPrototype = 0;
    208     d()->referenceErrorPrototype = 0;
    209     d()->syntaxErrorPrototype = 0;
    210     d()->typeErrorPrototype = 0;
    211     d()->URIErrorPrototype = 0;
     203
     204    d()->functionPrototype = new (exec) FunctionPrototype(exec);
     205    d()->functionStructure = StructureID::create(d()->functionPrototype);
     206    d()->callbackFunctionStructure = StructureID::create(d()->functionPrototype);
     207    d()->prototypeFunctionStructure = StructureID::create(d()->functionPrototype);
     208    d()->callbackFunctionStructure = StructureID::create(d()->functionPrototype);
     209    d()->functionPrototype->addFunctionProperties(exec, d()->prototypeFunctionStructure.get());
     210    d()->objectPrototype = new (exec) ObjectPrototype(exec, d()->prototypeFunctionStructure.get());
     211    d()->emptyObjectStructure = d()->objectPrototype->inheritorID();
     212    d()->functionPrototype->setPrototype(d()->objectPrototype);
     213    d()->argumentsStructure = StructureID::create(d()->objectPrototype);
     214    d()->callbackConstructorStructure = StructureID::create(d()->objectPrototype);
     215    d()->callbackObjectStructure = StructureID::create(d()->objectPrototype);
     216    d()->arrayPrototype = new (exec) ArrayPrototype(StructureID::create(d()->objectPrototype));
     217    d()->arrayStructure = StructureID::create(d()->arrayPrototype);
     218    d()->regExpMatchesArrayStructure = StructureID::create(d()->arrayPrototype);
     219    d()->stringPrototype = new (exec) StringPrototype(exec, StructureID::create(d()->objectPrototype));
     220    d()->stringObjectStructure = StructureID::create(d()->stringPrototype);
     221    d()->booleanPrototype = new (exec) BooleanPrototype(exec, StructureID::create(d()->objectPrototype), d()->prototypeFunctionStructure.get());
     222    d()->booleanObjectStructure = StructureID::create(d()->booleanPrototype);
     223    d()->numberPrototype = new (exec) NumberPrototype(exec, StructureID::create(d()->objectPrototype), d()->prototypeFunctionStructure.get());
     224    d()->numberObjectStructure = StructureID::create(d()->numberPrototype);
     225    d()->datePrototype = new (exec) DatePrototype(exec, StructureID::create(d()->objectPrototype));
     226    d()->dateStructure = StructureID::create(d()->datePrototype);
     227    d()->regExpPrototype = new (exec) RegExpPrototype(exec, StructureID::create(d()->objectPrototype), d()->prototypeFunctionStructure.get());
     228    d()->regExpStructure = StructureID::create(d()->regExpPrototype);
     229    ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, StructureID::create(d()->objectPrototype), d()->prototypeFunctionStructure.get());
     230    d()->errorStructure = StructureID::create(errorPrototype);
     231
     232    RefPtr<StructureID> nativeErrorPrototypeStructure = StructureID::create(errorPrototype);
     233
     234    NativeErrorPrototype* evalErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "EvalError", "EvalError");
     235    NativeErrorPrototype* rangeErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "RangeError", "RangeError");
     236    NativeErrorPrototype* referenceErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "ReferenceError", "ReferenceError");
     237    NativeErrorPrototype* syntaxErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "SyntaxError", "SyntaxError");
     238    NativeErrorPrototype* typeErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "TypeError", "TypeError");
     239    NativeErrorPrototype* URIErrorPrototype = new (exec) NativeErrorPrototype(exec, nativeErrorPrototypeStructure, "URIError", "URIError");
    212240
    213241    // Constructors
    214     d()->regExpConstructor = 0;
    215     d()->errorConstructor = 0;
    216    
    217     d()->evalErrorConstructor = 0;
    218     d()->rangeErrorConstructor = 0;
    219     d()->referenceErrorConstructor = 0;
    220     d()->syntaxErrorConstructor = 0;
    221     d()->typeErrorConstructor = 0;
    222     d()->URIErrorConstructor = 0;
    223 
    224     d()->evalFunction = 0;
    225 
    226     ExecState* exec = d()->globalExec.get();
    227 
    228     // Prototypes
    229 
    230     d()->functionPrototype = new (exec) FunctionPrototype(exec);
    231     d()->objectPrototype = new (exec) ObjectPrototype(exec, d()->functionPrototype);
    232     d()->functionPrototype->setPrototype(d()->objectPrototype);
    233 
    234     d()->arrayPrototype = new (exec) ArrayPrototype(exec, d()->objectPrototype);
    235     d()->stringPrototype = new (exec) StringPrototype(exec, d()->objectPrototype);
    236     d()->booleanPrototype = new (exec) BooleanPrototype(exec, d()->objectPrototype, d()->functionPrototype);
    237     d()->numberPrototype = new (exec) NumberPrototype(exec, d()->objectPrototype, d()->functionPrototype);
    238     d()->datePrototype = new (exec) DatePrototype(exec, d()->objectPrototype);
    239     d()->regExpPrototype = new (exec) RegExpPrototype(exec, d()->objectPrototype, d()->functionPrototype);
    240     d()->errorPrototype = new (exec) ErrorPrototype(exec, d()->objectPrototype, d()->functionPrototype);
    241    
    242     d()->evalErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "EvalError", "EvalError");
    243     d()->rangeErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "RangeError", "RangeError");
    244     d()->referenceErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "ReferenceError", "ReferenceError");
    245     d()->syntaxErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "SyntaxError", "SyntaxError");
    246     d()->typeErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "TypeError", "TypeError");
    247     d()->URIErrorPrototype = new (exec) NativeErrorPrototype(exec, d()->errorPrototype, "URIError", "URIError");
    248 
    249     // Constructors
    250 
    251     JSValue* objectConstructor = new (exec) ObjectConstructor(exec, d()->objectPrototype, d()->functionPrototype);
    252     JSValue* functionConstructor = new (exec) FunctionConstructor(exec, d()->functionPrototype);
    253     JSValue* arrayConstructor = new (exec) ArrayConstructor(exec, d()->functionPrototype, d()->arrayPrototype);
    254     JSValue* stringConstructor = new (exec) StringConstructor(exec, d()->functionPrototype, d()->stringPrototype);
    255     JSValue* booleanConstructor = new (exec) BooleanConstructor(exec, d()->functionPrototype, d()->booleanPrototype);
    256     JSValue* numberConstructor = new (exec) NumberConstructor(exec, d()->functionPrototype, d()->numberPrototype);
    257     JSValue* dateConstructor = new (exec) DateConstructor(exec, d()->functionPrototype, d()->datePrototype);
    258 
    259     d()->regExpConstructor = new (exec) RegExpConstructor(exec, d()->functionPrototype, d()->regExpPrototype);
    260 
    261     d()->errorConstructor = new (exec) ErrorConstructor(exec, d()->functionPrototype, d()->errorPrototype);
    262    
    263     d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->evalErrorPrototype);
    264     d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->rangeErrorPrototype);
    265     d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->referenceErrorPrototype);
    266     d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->syntaxErrorPrototype);
    267     d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->typeErrorPrototype);
    268     d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, d()->functionPrototype, d()->URIErrorPrototype);
     242
     243    JSValue* objectConstructor = new (exec) ObjectConstructor(exec, StructureID::create(d()->functionPrototype), d()->objectPrototype);
     244    JSValue* functionConstructor = new (exec) FunctionConstructor(exec, StructureID::create(d()->functionPrototype), d()->functionPrototype);
     245    JSValue* arrayConstructor = new (exec) ArrayConstructor(exec, StructureID::create(d()->functionPrototype), d()->arrayPrototype);
     246    JSValue* stringConstructor = new (exec) StringConstructor(exec, StructureID::create(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->stringPrototype);
     247    JSValue* booleanConstructor = new (exec) BooleanConstructor(exec, StructureID::create(d()->functionPrototype), d()->booleanPrototype);
     248    JSValue* numberConstructor = new (exec) NumberConstructor(exec, StructureID::create(d()->functionPrototype), d()->numberPrototype);
     249    JSValue* dateConstructor = new (exec) DateConstructor(exec, StructureID::create(d()->functionPrototype), d()->prototypeFunctionStructure.get(), d()->datePrototype);
     250
     251    d()->regExpConstructor = new (exec) RegExpConstructor(exec, StructureID::create(d()->functionPrototype), d()->regExpPrototype);
     252
     253    d()->errorConstructor = new (exec) ErrorConstructor(exec, StructureID::create(d()->functionPrototype), errorPrototype);
     254
     255    RefPtr<StructureID> nativeErrorStructure = StructureID::create(d()->functionPrototype);
     256
     257    d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, evalErrorPrototype);
     258    d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, rangeErrorPrototype);
     259    d()->referenceErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, referenceErrorPrototype);
     260    d()->syntaxErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, syntaxErrorPrototype);
     261    d()->typeErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, typeErrorPrototype);
     262    d()->URIErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, URIErrorPrototype);
    269263   
    270264    d()->functionPrototype->putDirect(exec->propertyNames().constructor, functionConstructor, DontEnum);
     
    278272    d()->datePrototype->putDirect(exec->propertyNames().constructor, dateConstructor, DontEnum);
    279273    d()->regExpPrototype->putDirect(exec->propertyNames().constructor, d()->regExpConstructor, DontEnum);
    280     d()->errorPrototype->putDirect(exec->propertyNames().constructor, d()->errorConstructor, DontEnum);
    281     d()->evalErrorPrototype->putDirect(exec->propertyNames().constructor, d()->evalErrorConstructor, DontEnum);
    282     d()->rangeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->rangeErrorConstructor, DontEnum);
    283     d()->referenceErrorPrototype->putDirect(exec->propertyNames().constructor, d()->referenceErrorConstructor, DontEnum);
    284     d()->syntaxErrorPrototype->putDirect(exec->propertyNames().constructor, d()->syntaxErrorConstructor, DontEnum);
    285     d()->typeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->typeErrorConstructor, DontEnum);
    286     d()->URIErrorPrototype->putDirect(exec->propertyNames().constructor, d()->URIErrorConstructor, DontEnum);
     274    errorPrototype->putDirect(exec->propertyNames().constructor, d()->errorConstructor, DontEnum);
     275    evalErrorPrototype->putDirect(exec->propertyNames().constructor, d()->evalErrorConstructor, DontEnum);
     276    rangeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->rangeErrorConstructor, DontEnum);
     277    referenceErrorPrototype->putDirect(exec->propertyNames().constructor, d()->referenceErrorConstructor, DontEnum);
     278    syntaxErrorPrototype->putDirect(exec->propertyNames().constructor, d()->syntaxErrorConstructor, DontEnum);
     279    typeErrorPrototype->putDirect(exec->propertyNames().constructor, d()->typeErrorConstructor, DontEnum);
     280    URIErrorPrototype->putDirect(exec->propertyNames().constructor, d()->URIErrorConstructor, DontEnum);
    287281
    288282    // Set global constructors
     
    308302    // Set global values.
    309303    GlobalPropertyInfo staticGlobals[] = {
    310         GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, d()->objectPrototype), DontEnum | DontDelete),
     304        GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, StructureID::create(d()->objectPrototype)), DontEnum | DontDelete),
    311305        GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete),
    312306        GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete),
     
    318312    // Set global functions.
    319313
    320     d()->evalFunction = new (exec) GlobalEvalFunction(exec, d()->functionPrototype, 1, exec->propertyNames().eval, globalFuncEval, this);
     314    d()->evalFunction = new (exec) GlobalEvalFunction(exec, StructureID::create(d()->functionPrototype), 1, exec->propertyNames().eval, globalFuncEval, this);
    321315    putDirectFunction(exec, d()->evalFunction, DontEnum);
    322     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);
    323     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);
    324     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum);
    325     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum);
    326     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum);
    327     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum);
    328     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum);
    329     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum);
    330     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum);
    331     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum);
     316    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 2, Identifier(exec, "parseInt"), globalFuncParseInt), DontEnum);
     317    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "parseFloat"), globalFuncParseFloat), DontEnum);
     318    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isNaN"), globalFuncIsNaN), DontEnum);
     319    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "isFinite"), globalFuncIsFinite), DontEnum);
     320    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "escape"), globalFuncEscape), DontEnum);
     321    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "unescape"), globalFuncUnescape), DontEnum);
     322    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURI"), globalFuncDecodeURI), DontEnum);
     323    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "decodeURIComponent"), globalFuncDecodeURIComponent), DontEnum);
     324    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURI"), globalFuncEncodeURI), DontEnum);
     325    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "encodeURIComponent"), globalFuncEncodeURIComponent), DontEnum);
    332326#ifndef NDEBUG
    333     putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->functionPrototype, 1, Identifier(exec, "kjsprint"), globalFuncKJSPrint), DontEnum);
     327    putDirectFunction(exec, new (exec) PrototypeFunction(exec, d()->prototypeFunctionStructure.get(), 1, Identifier(exec, "kjsprint"), globalFuncKJSPrint), DontEnum);
    334328#endif
    335329
     
    381375    markIfNeeded(d()->typeErrorConstructor);
    382376    markIfNeeded(d()->URIErrorConstructor);
    383    
     377
    384378    markIfNeeded(d()->evalFunction);
    385    
     379
    386380    markIfNeeded(d()->objectPrototype);
    387381    markIfNeeded(d()->functionPrototype);
    388     markIfNeeded(d()->arrayPrototype);
    389382    markIfNeeded(d()->booleanPrototype);
    390383    markIfNeeded(d()->stringPrototype);
     
    392385    markIfNeeded(d()->datePrototype);
    393386    markIfNeeded(d()->regExpPrototype);
    394     markIfNeeded(d()->errorPrototype);
    395     markIfNeeded(d()->evalErrorPrototype);
    396     markIfNeeded(d()->rangeErrorPrototype);
    397     markIfNeeded(d()->referenceErrorPrototype);
    398     markIfNeeded(d()->syntaxErrorPrototype);
    399     markIfNeeded(d()->typeErrorPrototype);
    400     markIfNeeded(d()->URIErrorPrototype);
     387
     388    markIfNeeded(d()->errorStructure);
     389
     390    // No need to mark the other structures, because their prototypes are all
     391    // guaranteed to be referenced elsewhere.
    401392}
    402393
Note: See TracChangeset for help on using the changeset viewer.