Changeset 36726 in webkit
- Timestamp:
- Sep 20, 2008, 7:29:12 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 93 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackConstructor.cpp
r36263 r36726 37 37 const ClassInfo JSCallbackConstructor::info = { "CallbackConstructor", 0, 0, 0 }; 38 38 39 JSCallbackConstructor::JSCallbackConstructor( ExecState* exec, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback)40 : JSObject( exec->lexicalGlobalObject()->objectPrototype())39 JSCallbackConstructor::JSCallbackConstructor(PassRefPtr<StructureID> structure, JSClassRef jsClass, JSObjectCallAsConstructorCallback callback) 40 : JSObject(structure) 41 41 , m_class(jsClass) 42 42 , m_callback(callback) -
trunk/JavaScriptCore/API/JSCallbackConstructor.h
r36263 r36726 34 34 class JSCallbackConstructor : public JSObject { 35 35 public: 36 JSCallbackConstructor( ExecState*, JSClassRef, JSObjectCallAsConstructorCallback);36 JSCallbackConstructor(PassRefPtr<StructureID>, JSClassRef, JSObjectCallAsConstructorCallback); 37 37 virtual ~JSCallbackConstructor(); 38 38 JSClassRef classRef() const { return m_class; } -
trunk/JavaScriptCore/API/JSCallbackFunction.cpp
r36263 r36726 42 42 43 43 JSCallbackFunction::JSCallbackFunction(ExecState* exec, JSObjectCallAsFunctionCallback callback, const Identifier& name) 44 : InternalFunction(exec, exec->lexicalGlobalObject()-> functionPrototype(), name)44 : InternalFunction(exec, exec->lexicalGlobalObject()->callbackFunctionStructure(), name) 45 45 , m_callback(callback) 46 46 { -
trunk/JavaScriptCore/API/JSCallbackObject.h
r36417 r36726 37 37 class JSCallbackObject : public Base { 38 38 public: 39 JSCallbackObject(ExecState*, JSClassRef, JSObject* prototype, void* data);39 JSCallbackObject(ExecState*, PassRefPtr<StructureID>, JSClassRef, void* data); 40 40 JSCallbackObject(JSGlobalData*, JSClassRef); 41 41 virtual ~JSCallbackObject(); -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r36417 r36726 41 41 42 42 template <class Base> 43 JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, JSClassRef jsClass, JSObject* prototype, void* data)44 : Base( prototype)43 JSCallbackObject<Base>::JSCallbackObject(ExecState* exec, PassRefPtr<StructureID> structure, JSClassRef jsClass, void* data) 44 : Base(structure) 45 45 , m_callbackObjectData(new JSCallbackObjectData(data, jsClass)) 46 46 { -
trunk/JavaScriptCore/API/JSClassRef.cpp
r36263 r36726 236 236 if (!jsClassData.cachedPrototype) { 237 237 // Recursive, but should be good enough for our purposes 238 JSObject* parentPrototype = 0; 239 if (parentClass) 240 parentPrototype = parentClass->prototype(exec); // can be null 241 if (!parentPrototype) 242 parentPrototype = exec->dynamicGlobalObject()->objectPrototype(); 243 jsClassData.cachedPrototype = new (exec) JSCallbackObject<JSObject>(exec, prototypeClass, parentPrototype, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction 238 jsClassData.cachedPrototype = new (exec) JSCallbackObject<JSObject>(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData); // set jsClassData as the object's private data, so it can clear our reference on destruction 239 if (parentClass) { 240 if (JSObject* prototype = parentClass->prototype(exec)) 241 jsClassData.cachedPrototype->setPrototype(prototype); 242 } 244 243 } 245 244 return jsClassData.cachedPrototype; -
trunk/JavaScriptCore/API/JSObjectRef.cpp
r36263 r36726 73 73 74 74 if (!jsClass) 75 return toRef(new (exec) JSObject(exec->lexicalGlobalObject()-> objectPrototype())); // slightly more efficient76 77 JS Object* jsPrototype = jsClass->prototype(exec);78 if ( !jsPrototype)79 jsPrototype = exec->lexicalGlobalObject()->objectPrototype();80 81 return toRef( new (exec) JSCallbackObject<JSObject>(exec, jsClass, jsPrototype, data));75 return toRef(new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure())); // slightly more efficient 76 77 JSCallbackObject<JSObject>* object = new (exec) JSCallbackObject<JSObject>(exec, exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data); 78 if (JSObject* prototype = jsClass->prototype(exec)) 79 object->setPrototype(prototype); 80 81 return toRef(object); 82 82 } 83 83 … … 103 103 : exec->dynamicGlobalObject()->objectPrototype(); 104 104 105 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec , jsClass, callAsConstructor);105 JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor); 106 106 constructor->putDirect(exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly); 107 107 return toRef(constructor); -
trunk/JavaScriptCore/ChangeLog
r36705 r36726 1 2008-09-20 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 - finish https://bugs.webkit.org/show_bug.cgi?id=20858 6 make each distinct C++ class get a distinct JSC::Structure 7 8 This also includes some optimizations that make the change an overall 9 small speedup. Without those it was a bit of a slowdown. 10 11 * API/JSCallbackConstructor.cpp: 12 (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure. 13 * API/JSCallbackConstructor.h: Ditto. 14 * API/JSCallbackFunction.cpp: 15 (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure. 16 * API/JSCallbackObject.h: Take a structure. 17 * API/JSCallbackObjectFunctions.h: 18 (JSC::JSCallbackObject::JSCallbackObject): Ditto. 19 20 * API/JSClassRef.cpp: 21 (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype 22 if there's a custom prototype involved. 23 * API/JSObjectRef.cpp: 24 (JSObjectMake): Ditto. 25 (JSObjectMakeConstructor): Pass in a structure. 26 27 * JavaScriptCore.exp: Updated. 28 29 * VM/Machine.cpp: 30 (JSC::jsLess): Added a special case for when both arguments are strings. 31 This avoids converting both strings to with UString::toDouble. 32 (JSC::jsLessEq): Ditto. 33 (JSC::Machine::privateExecute): Pass in a structure. 34 (JSC::Machine::cti_op_construct_JSConstruct): Ditto. 35 (JSC::Machine::cti_op_new_regexp): Ditto. 36 (JSC::Machine::cti_op_is_string): Ditto. 37 * VM/Machine.h: Made isJSString public so it can be used in the CTI. 38 39 * kjs/Arguments.cpp: 40 (JSC::Arguments::Arguments): Pass in a structure. 41 42 * kjs/JSCell.h: Mark constructor explicit. 43 44 * kjs/JSGlobalObject.cpp: 45 (JSC::markIfNeeded): Added an overload for marking structures. 46 (JSC::JSGlobalObject::reset): Eliminate code to set data members to 47 zero. We now do that in the constructor, and we no longer use this 48 anywhere except in the constructor. Added code to create structures. 49 Pass structures rather than prototypes when creating objects. 50 (JSC::JSGlobalObject::mark): Mark the structures. 51 52 * kjs/JSGlobalObject.h: Removed unneeded class declarations. 53 Added initializers for raw pointers in JSGlobalObjectData so 54 everything starts with a 0. Added structure data and accessor 55 functions. 56 57 * kjs/JSImmediate.cpp: 58 (JSC::JSImmediate::nonInlineNaN): Added. 59 * kjs/JSImmediate.h: 60 (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches. 61 62 * kjs/JSNumberCell.cpp: 63 (JSC::jsNumberCell): Made non-inline to avoid PIC branches 64 in functions that call this one. 65 (JSC::jsNaN): Ditto. 66 * kjs/JSNumberCell.h: Ditto. 67 68 * kjs/JSObject.h: Removed constructor that takes a prototype. 69 All callers now pass structures. 70 71 * kjs/ArrayConstructor.cpp: 72 (JSC::ArrayConstructor::ArrayConstructor): 73 (JSC::constructArrayWithSizeQuirk): 74 * kjs/ArrayConstructor.h: 75 * kjs/ArrayPrototype.cpp: 76 (JSC::ArrayPrototype::ArrayPrototype): 77 * kjs/ArrayPrototype.h: 78 * kjs/BooleanConstructor.cpp: 79 (JSC::BooleanConstructor::BooleanConstructor): 80 (JSC::constructBoolean): 81 (JSC::constructBooleanFromImmediateBoolean): 82 * kjs/BooleanConstructor.h: 83 * kjs/BooleanObject.cpp: 84 (JSC::BooleanObject::BooleanObject): 85 * kjs/BooleanObject.h: 86 * kjs/BooleanPrototype.cpp: 87 (JSC::BooleanPrototype::BooleanPrototype): 88 * kjs/BooleanPrototype.h: 89 * kjs/DateConstructor.cpp: 90 (JSC::DateConstructor::DateConstructor): 91 (JSC::constructDate): 92 * kjs/DateConstructor.h: 93 * kjs/DateInstance.cpp: 94 (JSC::DateInstance::DateInstance): 95 * kjs/DateInstance.h: 96 * kjs/DatePrototype.cpp: 97 (JSC::DatePrototype::DatePrototype): 98 * kjs/DatePrototype.h: 99 * kjs/ErrorConstructor.cpp: 100 (JSC::ErrorConstructor::ErrorConstructor): 101 (JSC::constructError): 102 * kjs/ErrorConstructor.h: 103 * kjs/ErrorInstance.cpp: 104 (JSC::ErrorInstance::ErrorInstance): 105 * kjs/ErrorInstance.h: 106 * kjs/ErrorPrototype.cpp: 107 (JSC::ErrorPrototype::ErrorPrototype): 108 * kjs/ErrorPrototype.h: 109 * kjs/FunctionConstructor.cpp: 110 (JSC::FunctionConstructor::FunctionConstructor): 111 * kjs/FunctionConstructor.h: 112 * kjs/FunctionPrototype.cpp: 113 (JSC::FunctionPrototype::FunctionPrototype): 114 (JSC::FunctionPrototype::addFunctionProperties): 115 * kjs/FunctionPrototype.h: 116 * kjs/GlobalEvalFunction.cpp: 117 (JSC::GlobalEvalFunction::GlobalEvalFunction): 118 * kjs/GlobalEvalFunction.h: 119 * kjs/InternalFunction.cpp: 120 (JSC::InternalFunction::InternalFunction): 121 * kjs/InternalFunction.h: 122 (JSC::InternalFunction::InternalFunction): 123 * kjs/JSArray.cpp: 124 (JSC::JSArray::JSArray): 125 (JSC::constructEmptyArray): 126 (JSC::constructArray): 127 * kjs/JSArray.h: 128 * kjs/JSFunction.cpp: 129 (JSC::JSFunction::JSFunction): 130 (JSC::JSFunction::construct): 131 * kjs/JSObject.cpp: 132 (JSC::constructEmptyObject): 133 * kjs/JSString.cpp: 134 (JSC::StringObject::create): 135 * kjs/JSWrapperObject.h: 136 * kjs/MathObject.cpp: 137 (JSC::MathObject::MathObject): 138 * kjs/MathObject.h: 139 * kjs/NativeErrorConstructor.cpp: 140 (JSC::NativeErrorConstructor::NativeErrorConstructor): 141 (JSC::NativeErrorConstructor::construct): 142 * kjs/NativeErrorConstructor.h: 143 * kjs/NativeErrorPrototype.cpp: 144 (JSC::NativeErrorPrototype::NativeErrorPrototype): 145 * kjs/NativeErrorPrototype.h: 146 * kjs/NumberConstructor.cpp: 147 (JSC::NumberConstructor::NumberConstructor): 148 (JSC::constructWithNumberConstructor): 149 * kjs/NumberConstructor.h: 150 * kjs/NumberObject.cpp: 151 (JSC::NumberObject::NumberObject): 152 (JSC::constructNumber): 153 (JSC::constructNumberFromImmediateNumber): 154 * kjs/NumberObject.h: 155 * kjs/NumberPrototype.cpp: 156 (JSC::NumberPrototype::NumberPrototype): 157 * kjs/NumberPrototype.h: 158 * kjs/ObjectConstructor.cpp: 159 (JSC::ObjectConstructor::ObjectConstructor): 160 (JSC::constructObject): 161 * kjs/ObjectConstructor.h: 162 * kjs/ObjectPrototype.cpp: 163 (JSC::ObjectPrototype::ObjectPrototype): 164 * kjs/ObjectPrototype.h: 165 * kjs/PrototypeFunction.cpp: 166 (JSC::PrototypeFunction::PrototypeFunction): 167 * kjs/PrototypeFunction.h: 168 * kjs/RegExpConstructor.cpp: 169 (JSC::RegExpConstructor::RegExpConstructor): 170 (JSC::RegExpMatchesArray::RegExpMatchesArray): 171 (JSC::constructRegExp): 172 * kjs/RegExpConstructor.h: 173 * kjs/RegExpObject.cpp: 174 (JSC::RegExpObject::RegExpObject): 175 * kjs/RegExpObject.h: 176 * kjs/RegExpPrototype.cpp: 177 (JSC::RegExpPrototype::RegExpPrototype): 178 * kjs/RegExpPrototype.h: 179 * kjs/Shell.cpp: 180 (GlobalObject::GlobalObject): 181 * kjs/StringConstructor.cpp: 182 (JSC::StringConstructor::StringConstructor): 183 (JSC::constructWithStringConstructor): 184 * kjs/StringConstructor.h: 185 * kjs/StringObject.cpp: 186 (JSC::StringObject::StringObject): 187 * kjs/StringObject.h: 188 * kjs/StringObjectThatMasqueradesAsUndefined.h: 189 (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined): 190 * kjs/StringPrototype.cpp: 191 (JSC::StringPrototype::StringPrototype): 192 * kjs/StringPrototype.h: 193 Take and pass structures. 194 1 195 2008-09-19 Alp Toker <alp@nuanti.com> 2 196 -
trunk/JavaScriptCore/JavaScriptCore.exp
r36701 r36726 99 99 __ZN3JSC11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiN3WTF10PassRefPtrINS_14SourceProviderEEEPNS_7JSValueE 100 100 __ZN3JSC11Interpreter8evaluateEPNS_9ExecStateERNS_10ScopeChainERKNS_7UStringEiS7_PNS_7JSValueE 101 __ZN3JSC11JSImmediate12nonInlineNaNEv 101 102 __ZN3JSC11JSImmediate8toObjectEPKNS_7JSValueEPNS_9ExecStateE 102 103 __ZN3JSC11JSImmediate8toStringEPKNS_7JSValueE … … 128 129 __ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierEPNS_7JSValueERNS_15PutPropertySlotE 129 130 __ZN3JSC12StringObject4infoE 130 __ZN3JSC12StringObjectC2EPNS_9ExecStateEPNS_8JSObjectERKNS_7UStringE 131 __ZN3JSC12StringObjectC2EPNS_9ExecStateEN3WTF10PassRefPtrINS_11StructureIDEEERKNS_7UStringE 132 __ZN3JSC12jsNumberCellEPNS_9ExecStateEd 131 133 __ZN3JSC13CodeGenerator21setDumpsGeneratedCodeEb 132 134 __ZN3JSC13StatementNode6setLocEii … … 147 149 __ZN3JSC15JSWrapperObject4markEv 148 150 __ZN3JSC16InternalFunction4infoE 149 __ZN3JSC16InternalFunctionC2EPNS_9ExecStateE PNS_17FunctionPrototypeERKNS_10IdentifierE151 __ZN3JSC16InternalFunctionC2EPNS_9ExecStateEN3WTF10PassRefPtrINS_11StructureIDEEERKNS_10IdentifierE 150 152 __ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 151 153 __ZN3JSC16JSVariableObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE … … 154 156 __ZN3JSC16ParserRefCounted5derefEv 155 157 __ZN3JSC17PropertyNameArray3addEPNS_7UString3RepE 156 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateE PNS_17FunctionPrototypeEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectES9_RKNS_7ArgListEE158 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEN3WTF10PassRefPtrINS_11StructureIDEEEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectESB_RKNS_7ArgListEE 157 159 __ZN3JSC17PrototypeFunctionC1EPNS_9ExecStateEiRKNS_10IdentifierEPFPNS_7JSValueES2_PNS_8JSObjectES7_RKNS_7ArgListEE 158 160 __ZN3JSC17constructFunctionEPNS_9ExecStateERKNS_7ArgListERKNS_10IdentifierERKNS_7UStringEi -
trunk/JavaScriptCore/VM/Machine.cpp
r36695 r36726 151 151 return n1 < n2; 152 152 153 Machine* machine = exec->machine(); 154 if (machine->isJSString(v1) && machine->isJSString(v2)) 155 return static_cast<const JSString*>(v1)->value() < static_cast<const JSString*>(v2)->value(); 156 153 157 JSValue* p1; 154 158 JSValue* p2; … … 171 175 if (fastIsNumber(v1, n1) && fastIsNumber(v2, n2)) 172 176 return n1 <= n2; 177 178 Machine* machine = exec->machine(); 179 if (machine->isJSString(v1) && machine->isJSString(v2)) 180 return !(static_cast<const JSString*>(v2)->value() < static_cast<const JSString*>(v1)->value()); 173 181 174 182 JSValue* p1; … … 1505 1513 int dst = (++vPC)->u.operand; 1506 1514 int regExp = (++vPC)->u.operand; 1507 r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExp Prototype(), codeBlock->regexps[regExp]);1515 r[dst] = new (exec) RegExpObject(scopeChain->globalObject()->regExpStructure(), codeBlock->regexps[regExp]); 1508 1516 1509 1517 ++vPC; … … 3386 3394 (*enabledProfilerReference)->willExecute(exec, constructor); 3387 3395 3388 JSObject* prototype;3389 JSValue* p = r[constrProto].jsValue(exec);3390 if (p ->isObject())3391 prototype = static_cast<JSObject*>(p);3396 StructureID* structure; 3397 JSValue* prototype = r[constrProto].jsValue(exec); 3398 if (prototype->isObject()) 3399 structure = static_cast<JSObject*>(prototype)->inheritorID(); 3392 3400 else 3393 prototype = scopeChain->globalObject()->objectPrototype();3394 JSObject* newObject = new (exec) JSObject( prototype);3401 structure = scopeChain->globalObject()->emptyObjectStructure(); 3402 JSObject* newObject = new (exec) JSObject(structure); 3395 3403 3396 3404 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 4540 4548 (*ARG_profilerReference)->willExecute(exec, constructor); 4541 4549 4542 JSObject* prototype; 4543 JSValue* p = constrProtoVal; 4544 if (p->isObject()) 4545 prototype = static_cast<JSObject*>(p); 4550 StructureID* structure; 4551 if (constrProtoVal->isObject()) 4552 structure = static_cast<JSObject*>(constrProtoVal)->inheritorID(); 4546 4553 else 4547 prototype = scopeChain->globalObject()->objectPrototype();4548 JSObject* newObject = new (exec) JSObject( prototype);4554 structure = scopeChain->globalObject()->emptyObjectStructure(); 4555 JSObject* newObject = new (exec) JSObject(structure); 4549 4556 4550 4557 ScopeChainNode* callDataScopeChain = constructData.js.scopeChain; … … 5145 5152 JSValue* Machine::cti_op_new_regexp(CTI_ARGS) 5146 5153 { 5147 return new (ARG_exec) RegExpObject(ARG_scopeChain->globalObject()->regExp Prototype(), ARG_regexp1);5154 return new (ARG_exec) RegExpObject(ARG_scopeChain->globalObject()->regExpStructure(), ARG_regexp1); 5148 5155 } 5149 5156 … … 5275 5282 JSValue* Machine::cti_op_is_string(CTI_ARGS) 5276 5283 { 5277 return jsBoolean(ARG_ src1->isString());5284 return jsBoolean(ARG_exec->machine()->isJSString(ARG_src1)); 5278 5285 } 5279 5286 -
trunk/JavaScriptCore/VM/Machine.h
r36604 r36726 233 233 static const int initialTickCountThreshold = 1024; 234 234 235 bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; } 236 bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; } 237 235 238 private: 236 239 enum ExecutionFlag { Normal, InitializeAndReturn }; … … 257 260 void resetTimeoutCheck(); 258 261 259 bool isJSArray(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsArrayVptr; }260 bool isJSString(JSValue* v) { return !JSImmediate::isImmediate(v) && v->asCell()->vptr() == m_jsStringVptr; }261 262 262 void tryCacheGetByID(ExecState*, CodeBlock*, Instruction* vPC, JSValue* baseValue, const Identifier& propertyName, const PropertySlot&); 263 263 void uncacheGetByID(CodeBlock*, Instruction* vPC); -
trunk/JavaScriptCore/kjs/Arguments.cpp
r36263 r36726 39 39 // ECMA 10.1.8 40 40 Arguments::Arguments(ExecState* exec, JSFunction* function, const ArgList& args, JSActivation* activation) 41 : JSObject(exec->lexicalGlobalObject()-> objectPrototype())41 : JSObject(exec->lexicalGlobalObject()->argumentsStructure()) 42 42 , d(new ArgumentsData(activation, function, args)) 43 43 { -
trunk/JavaScriptCore/kjs/ArrayConstructor.cpp
r36263 r36726 26 26 27 27 #include "ArrayPrototype.h" 28 #include "FunctionPrototype.h"29 28 #include "JSArray.h" 30 29 #include "lookup.h" … … 34 33 ASSERT_CLASS_FITS_IN_CELL(ArrayConstructor); 35 34 36 ArrayConstructor::ArrayConstructor(ExecState* exec, FunctionPrototype* functionPrototype, ArrayPrototype* arrayPrototype)37 : InternalFunction(exec, functionPrototype, Identifier(exec, arrayPrototype->classInfo()->className))35 ArrayConstructor::ArrayConstructor(ExecState* exec, PassRefPtr<StructureID> structure, ArrayPrototype* arrayPrototype) 36 : InternalFunction(exec, structure, Identifier(exec, arrayPrototype->classInfo()->className)) 38 37 { 39 38 // ECMA 15.4.3.1 Array.prototype … … 51 50 if (n != args.at(exec, 0)->toNumber(exec)) 52 51 return throwError(exec, RangeError, "Array size is not a small enough positive integer."); 53 return new (exec) JSArray(exec->lexicalGlobalObject()->array Prototype(), n);52 return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), n); 54 53 } 55 54 56 55 // otherwise the array is constructed with the arguments in it 57 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->array Prototype(), args);56 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->arrayStructure(), args); 58 57 } 59 58 -
trunk/JavaScriptCore/kjs/ArrayConstructor.h
r36263 r36726 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2007 Apple Inc. All rights reserved.3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 27 27 28 28 class ArrayPrototype; 29 class FunctionPrototype;30 29 31 30 class ArrayConstructor : public InternalFunction { 32 31 public: 33 ArrayConstructor(ExecState*, FunctionPrototype*, ArrayPrototype*);32 ArrayConstructor(ExecState*, PassRefPtr<StructureID>, ArrayPrototype*); 34 33 35 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/JavaScriptCore/kjs/ArrayPrototype.cpp
r36263 r36726 92 92 93 93 // ECMA 15.4.4 94 ArrayPrototype::ArrayPrototype( ExecState*, ObjectPrototype* objectPrototype)95 : JSArray( objectPrototype, 0)94 ArrayPrototype::ArrayPrototype(PassRefPtr<StructureID> structure) 95 : JSArray(structure) 96 96 { 97 97 } -
trunk/JavaScriptCore/kjs/ArrayPrototype.h
r36263 r36726 29 29 class ArrayPrototype : public JSArray { 30 30 public: 31 ArrayPrototype(ExecState*, ObjectPrototype*);31 explicit ArrayPrototype(PassRefPtr<StructureID>); 32 32 33 33 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/kjs/BooleanConstructor.cpp
r36263 r36726 29 29 ASSERT_CLASS_FITS_IN_CELL(BooleanConstructor); 30 30 31 BooleanConstructor::BooleanConstructor(ExecState* exec, FunctionPrototype* functionPrototype, BooleanPrototype* booleanPrototype)32 : InternalFunction(exec, functionPrototype, Identifier(exec, booleanPrototype->classInfo()->className))31 BooleanConstructor::BooleanConstructor(ExecState* exec, PassRefPtr<StructureID> structure, BooleanPrototype* booleanPrototype) 32 : InternalFunction(exec, structure, Identifier(exec, booleanPrototype->classInfo()->className)) 33 33 { 34 34 putDirect(exec->propertyNames().prototype, booleanPrototype, DontEnum | DontDelete | ReadOnly); … … 41 41 JSObject* constructBoolean(ExecState* exec, const ArgList& args) 42 42 { 43 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->boolean Prototype());43 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure()); 44 44 obj->setInternalValue(jsBoolean(args.at(exec, 0)->toBoolean(exec))); 45 45 return obj; … … 71 71 JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSValue* immediateBooleanValue) 72 72 { 73 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->boolean Prototype());73 BooleanObject* obj = new (exec) BooleanObject(exec->lexicalGlobalObject()->booleanObjectStructure()); 74 74 obj->setInternalValue(immediateBooleanValue); 75 75 return obj; -
trunk/JavaScriptCore/kjs/BooleanConstructor.h
r36263 r36726 27 27 28 28 class BooleanPrototype; 29 class FunctionPrototype;30 29 31 30 class BooleanConstructor : public InternalFunction { 32 31 public: 33 BooleanConstructor(ExecState*, FunctionPrototype*, BooleanPrototype*);32 BooleanConstructor(ExecState*, PassRefPtr<StructureID>, BooleanPrototype*); 34 33 35 34 private: -
trunk/JavaScriptCore/kjs/BooleanObject.cpp
r36263 r36726 28 28 const ClassInfo BooleanObject::info = { "Boolean", 0, 0, 0 }; 29 29 30 BooleanObject::BooleanObject( JSObject* prototype)31 : JSWrapperObject( prototype)30 BooleanObject::BooleanObject(PassRefPtr<StructureID> structure) 31 : JSWrapperObject(structure) 32 32 { 33 33 } -
trunk/JavaScriptCore/kjs/BooleanObject.h
r36263 r36726 28 28 class BooleanObject : public JSWrapperObject { 29 29 public: 30 BooleanObject(JSObject* prototype);30 explicit BooleanObject(PassRefPtr<StructureID>); 31 31 32 32 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/kjs/BooleanPrototype.cpp
r36263 r36726 23 23 24 24 #include "Error.h" 25 #include "FunctionPrototype.h"26 25 #include "JSString.h" 27 26 #include "ObjectPrototype.h" … … 38 37 // ECMA 15.6.4 39 38 40 BooleanPrototype::BooleanPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)41 : BooleanObject( objectPrototype)39 BooleanPrototype::BooleanPrototype(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure) 40 : BooleanObject(structure) 42 41 { 43 42 setInternalValue(jsBoolean(false)); 44 43 45 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum);46 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum);44 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, booleanProtoFuncToString), DontEnum); 45 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, booleanProtoFuncValueOf), DontEnum); 47 46 } 48 47 -
trunk/JavaScriptCore/kjs/BooleanPrototype.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 class ObjectPrototype;30 31 28 class BooleanPrototype : public BooleanObject { 32 29 public: 33 BooleanPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);30 BooleanPrototype(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure); 34 31 }; 35 32 -
trunk/JavaScriptCore/kjs/DateConstructor.cpp
r36263 r36726 52 52 static JSValue* dateUTC(ExecState*, JSObject*, JSValue*, const ArgList&); 53 53 54 DateConstructor::DateConstructor(ExecState* exec, FunctionPrototype* functionPrototype, DatePrototype* datePrototype)55 : InternalFunction(exec, functionPrototype, Identifier(exec, datePrototype->classInfo()->className))54 DateConstructor::DateConstructor(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure, DatePrototype* datePrototype) 55 : InternalFunction(exec, structure, Identifier(exec, datePrototype->classInfo()->className)) 56 56 { 57 57 putDirect(exec->propertyNames().prototype, datePrototype, DontEnum|DontDelete|ReadOnly); 58 58 59 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().parse, dateParse), DontEnum);60 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 7, exec->propertyNames().UTC, dateUTC), DontEnum);61 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().now, dateNow), DontEnum);59 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().parse, dateParse), DontEnum); 60 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 7, exec->propertyNames().UTC, dateUTC), DontEnum); 61 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().now, dateNow), DontEnum); 62 62 63 63 putDirect(exec->propertyNames().length, jsNumber(exec, 7), ReadOnly | DontEnum | DontDelete); … … 107 107 } 108 108 109 DateInstance* re t = new (exec) DateInstance(exec->lexicalGlobalObject()->datePrototype());110 re t->setInternalValue(jsNumber(exec, timeClip(value)));111 return re t;109 DateInstance* result = new (exec) DateInstance(exec->lexicalGlobalObject()->dateStructure()); 110 result->setInternalValue(jsNumber(exec, timeClip(value))); 111 return result; 112 112 } 113 113 -
trunk/JavaScriptCore/kjs/DateConstructor.h
r36263 r36726 27 27 28 28 class DatePrototype; 29 class FunctionPrototype;30 29 31 30 class DateConstructor : public InternalFunction { 32 31 public: 33 DateConstructor(ExecState*, FunctionPrototype*, DatePrototype*);32 DateConstructor(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure, DatePrototype*); 34 33 35 34 private: -
trunk/JavaScriptCore/kjs/DateInstance.cpp
r36263 r36726 38 38 const ClassInfo DateInstance::info = {"Date", 0, 0, 0}; 39 39 40 DateInstance::DateInstance( JSObject* prototype)41 : JSWrapperObject( prototype)40 DateInstance::DateInstance(PassRefPtr<StructureID> structure) 41 : JSWrapperObject(structure) 42 42 , m_cache(0) 43 43 { -
trunk/JavaScriptCore/kjs/DateInstance.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 class ObjectPrototype;30 28 struct GregorianDateTime; 31 29 32 30 class DateInstance : public JSWrapperObject { 33 31 public: 34 DateInstance(JSObject* prototype);32 explicit DateInstance(PassRefPtr<StructureID>); 35 33 virtual ~DateInstance(); 36 34 -
trunk/JavaScriptCore/kjs/DatePrototype.cpp
r36263 r36726 346 346 // ECMA 15.9.4 347 347 348 DatePrototype::DatePrototype(ExecState* exec, ObjectPrototype* objectPrototype)349 : DateInstance( objectPrototype)348 DatePrototype::DatePrototype(ExecState* exec, PassRefPtr<StructureID> structure) 349 : DateInstance(structure) 350 350 { 351 351 setInternalValue(jsNaN(exec)); -
trunk/JavaScriptCore/kjs/DatePrototype.h
r36263 r36726 30 30 class DatePrototype : public DateInstance { 31 31 public: 32 DatePrototype(ExecState*, ObjectPrototype*);32 DatePrototype(ExecState*, PassRefPtr<StructureID>); 33 33 34 34 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/kjs/ErrorConstructor.cpp
r36263 r36726 24 24 #include "ErrorInstance.h" 25 25 #include "ErrorPrototype.h" 26 #include "FunctionPrototype.h"27 26 #include "JSGlobalObject.h" 28 27 #include "JSString.h" … … 32 31 ASSERT_CLASS_FITS_IN_CELL(ErrorConstructor); 33 32 34 ErrorConstructor::ErrorConstructor(ExecState* exec, FunctionPrototype* functionPrototype, ErrorPrototype* errorPrototype)35 : InternalFunction(exec, functionPrototype, Identifier(exec, errorPrototype->classInfo()->className))33 ErrorConstructor::ErrorConstructor(ExecState* exec, PassRefPtr<StructureID> structure, ErrorPrototype* errorPrototype) 34 : InternalFunction(exec, structure, Identifier(exec, errorPrototype->classInfo()->className)) 36 35 { 37 36 // ECMA 15.11.3.1 Error.prototype … … 43 42 static ErrorInstance* constructError(ExecState* exec, const ArgList& args) 44 43 { 45 ErrorInstance* obj = new (exec) ErrorInstance(exec->lexicalGlobalObject()->error Prototype());44 ErrorInstance* obj = new (exec) ErrorInstance(exec->lexicalGlobalObject()->errorStructure()); 46 45 if (!args.at(exec, 0)->isUndefined()) 47 46 obj->putDirect(exec->propertyNames().message, jsString(exec, args.at(exec, 0)->toString(exec))); -
trunk/JavaScriptCore/kjs/ErrorConstructor.h
r36263 r36726 27 27 28 28 class ErrorPrototype; 29 class FunctionPrototype;30 29 31 30 class ErrorConstructor : public InternalFunction { 32 31 public: 33 ErrorConstructor(ExecState*, FunctionPrototype*, ErrorPrototype*);32 ErrorConstructor(ExecState*, PassRefPtr<StructureID>, ErrorPrototype*); 34 33 35 34 private: -
trunk/JavaScriptCore/kjs/ErrorInstance.cpp
r36263 r36726 26 26 const ClassInfo ErrorInstance::info = { "Error", 0, 0, 0 }; 27 27 28 ErrorInstance::ErrorInstance( JSObject* prototype)29 : JSObject( prototype)28 ErrorInstance::ErrorInstance(PassRefPtr<StructureID> structure) 29 : JSObject(structure) 30 30 { 31 31 } -
trunk/JavaScriptCore/kjs/ErrorInstance.h
r36263 r36726 28 28 class ErrorInstance : public JSObject { 29 29 public: 30 ErrorInstance(JSObject* prototype);30 explicit ErrorInstance(PassRefPtr<StructureID>); 31 31 32 32 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/kjs/ErrorPrototype.cpp
r36263 r36726 22 22 #include "ErrorPrototype.h" 23 23 24 #include "FunctionPrototype.h"25 24 #include "JSString.h" 26 25 #include "ObjectPrototype.h" … … 35 34 36 35 // ECMA 15.9.4 37 ErrorPrototype::ErrorPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)38 : ErrorInstance( objectPrototype)36 ErrorPrototype::ErrorPrototype(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure) 37 : ErrorInstance(structure) 39 38 { 40 39 // The constructor will be added later in ErrorConstructor's constructor … … 43 42 putDirect(exec->propertyNames().message, jsNontrivialString(exec, "Unknown error"), DontEnum); 44 43 45 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum);44 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, errorProtoFuncToString), DontEnum); 46 45 } 47 46 -
trunk/JavaScriptCore/kjs/ErrorPrototype.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 28 class ObjectPrototype; 30 29 31 30 class ErrorPrototype : public ErrorInstance { 32 31 public: 33 ErrorPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);32 ErrorPrototype(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure); 34 33 }; 35 34 -
trunk/JavaScriptCore/kjs/FunctionConstructor.cpp
r36263 r36726 35 35 ASSERT_CLASS_FITS_IN_CELL(FunctionConstructor); 36 36 37 FunctionConstructor::FunctionConstructor(ExecState* exec, FunctionPrototype* functionPrototype)38 : InternalFunction(exec, functionPrototype, Identifier(exec, functionPrototype->classInfo()->className))37 FunctionConstructor::FunctionConstructor(ExecState* exec, PassRefPtr<StructureID> structure, FunctionPrototype* functionPrototype) 38 : InternalFunction(exec, structure, Identifier(exec, functionPrototype->classInfo()->className)) 39 39 { 40 40 putDirect(exec->propertyNames().prototype, functionPrototype, DontEnum | DontDelete | ReadOnly); -
trunk/JavaScriptCore/kjs/FunctionConstructor.h
r36263 r36726 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 4 * Copyright (C) 2006 Apple Computer, Inc.3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 5 4 * 6 5 * This library is free software; you can redistribute it and/or … … 31 30 class FunctionConstructor : public InternalFunction { 32 31 public: 33 FunctionConstructor(ExecState*, FunctionPrototype*);32 FunctionConstructor(ExecState*, PassRefPtr<StructureID>, FunctionPrototype*); 34 33 35 34 private: -
trunk/JavaScriptCore/kjs/FunctionPrototype.cpp
r36263 r36726 40 40 { 41 41 putDirect(exec->propertyNames().length, jsNumber(exec, 0), DontDelete | ReadOnly | DontEnum); 42 } 42 43 43 putDirectFunction(exec, new (exec) PrototypeFunction(exec, this, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum); 44 putDirectFunction(exec, new (exec) PrototypeFunction(exec, this, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum); 45 putDirectFunction(exec, new (exec) PrototypeFunction(exec, this, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum); 44 void FunctionPrototype::addFunctionProperties(ExecState* exec, StructureID* prototypeFunctionStructure) 45 { 46 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum); 47 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 2, exec->propertyNames().apply, functionProtoFuncApply), DontEnum); 48 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().call, functionProtoFuncCall), DontEnum); 46 49 } 47 50 -
trunk/JavaScriptCore/kjs/FunctionPrototype.h
r36263 r36726 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 4 * Copyright (C) 2006 Apple Computer, Inc.3 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 5 4 * 6 5 * This library is free software; you can redistribute it and/or … … 30 29 public: 31 30 FunctionPrototype(ExecState*); 31 void addFunctionProperties(ExecState*, StructureID* prototypeFunctionStructure); 32 32 33 33 private: -
trunk/JavaScriptCore/kjs/GlobalEvalFunction.cpp
r36263 r36726 26 26 #include "GlobalEvalFunction.h" 27 27 28 #include "FunctionPrototype.h"29 28 #include "JSGlobalObject.h" 30 29 #include <wtf/Assertions.h> … … 34 33 ASSERT_CLASS_FITS_IN_CELL(GlobalEvalFunction); 35 34 36 GlobalEvalFunction::GlobalEvalFunction(ExecState* exec, FunctionPrototype* functionPrototype, int len, const Identifier& name, NativeFunction function, JSGlobalObject* cachedGlobalObject)37 : PrototypeFunction(exec, functionPrototype, len, name, function)35 GlobalEvalFunction::GlobalEvalFunction(ExecState* exec, PassRefPtr<StructureID> structure, int len, const Identifier& name, NativeFunction function, JSGlobalObject* cachedGlobalObject) 36 : PrototypeFunction(exec, structure, len, name, function) 38 37 , m_cachedGlobalObject(cachedGlobalObject) 39 38 { -
trunk/JavaScriptCore/kjs/GlobalEvalFunction.h
r36263 r36726 29 29 namespace JSC { 30 30 31 class ExecState;32 class FunctionPrototype;33 31 class JSGlobalObject; 34 32 35 33 class GlobalEvalFunction : public PrototypeFunction { 36 34 public: 37 GlobalEvalFunction(ExecState*, FunctionPrototype*, int len, const Identifier&, NativeFunction, JSGlobalObject* expectedThisObject);35 GlobalEvalFunction(ExecState*, PassRefPtr<StructureID>, int len, const Identifier&, NativeFunction, JSGlobalObject* expectedThisObject); 38 36 JSGlobalObject* cachedGlobalObject() const { return m_cachedGlobalObject; } 39 37 -
trunk/JavaScriptCore/kjs/InternalFunction.cpp
r36263 r36726 39 39 } 40 40 41 InternalFunction::InternalFunction(ExecState* exec, FunctionPrototype* prototype, const Identifier& name)42 : JSObject( prototype)41 InternalFunction::InternalFunction(ExecState* exec, PassRefPtr<StructureID> structure, const Identifier& name) 42 : JSObject(structure) 43 43 { 44 44 putDirect(exec->propertyNames().name, jsString(exec, name.ustring()), DontDelete | ReadOnly | DontEnum); -
trunk/JavaScriptCore/kjs/InternalFunction.h
r36263 r36726 40 40 41 41 protected: 42 InternalFunction(PassRefPtr< JSC::StructureID> st) : JSObject(st){}42 InternalFunction(PassRefPtr<StructureID> structure) : JSObject(structure) { } 43 43 InternalFunction(ExecState*); 44 InternalFunction(ExecState*, FunctionPrototype*, const Identifier&);44 InternalFunction(ExecState*, PassRefPtr<StructureID>, const Identifier&); 45 45 46 46 private: -
trunk/JavaScriptCore/kjs/JSArray.cpp
r36263 r36726 139 139 } 140 140 141 JSArray::JSArray( JSObject* prototype, unsigned initialLength)142 : JSObject( prototype)141 JSArray::JSArray(PassRefPtr<StructureID> structure, unsigned initialLength) 142 : JSObject(structure) 143 143 { 144 144 unsigned initialCapacity = min(initialLength, MIN_SPARSE_ARRAY_INDEX); … … 154 154 } 155 155 156 JSArray::JSArray(ExecState* exec, JSObject* prototype, const ArgList& list)157 : JSObject( prototype)156 JSArray::JSArray(ExecState* exec, PassRefPtr<StructureID> structure, const ArgList& list) 157 : JSObject(structure) 158 158 { 159 159 unsigned length = list.size(); … … 888 888 JSArray* constructEmptyArray(ExecState* exec) 889 889 { 890 return new (exec) JSArray(exec->lexicalGlobalObject()->array Prototype(), 0);890 return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure()); 891 891 } 892 892 893 893 JSArray* constructEmptyArray(ExecState* exec, unsigned initialLength) 894 894 { 895 return new (exec) JSArray(exec->lexicalGlobalObject()->array Prototype(), initialLength);895 return new (exec) JSArray(exec->lexicalGlobalObject()->arrayStructure(), initialLength); 896 896 } 897 897 … … 900 900 ArgList values; 901 901 values.append(singleItemValue); 902 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->array Prototype(), values);902 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->arrayStructure(), values); 903 903 } 904 904 905 905 JSArray* constructArray(ExecState* exec, const ArgList& values) 906 906 { 907 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->array Prototype(), values);907 return new (exec) JSArray(exec, exec->lexicalGlobalObject()->arrayStructure(), values); 908 908 } 909 909 -
trunk/JavaScriptCore/kjs/JSArray.h
r36263 r36726 41 41 42 42 public: 43 JSArray(PassRefPtr<StructureID>);44 JSArray( JSObject* prototype, unsigned initialLength);45 JSArray(ExecState* exec, JSObject* prototype, const ArgList& initialValues);43 explicit JSArray(PassRefPtr<StructureID>); 44 JSArray(PassRefPtr<StructureID>, unsigned initialLength); 45 JSArray(ExecState*, PassRefPtr<StructureID>, const ArgList& initialValues); 46 46 virtual ~JSArray(); 47 47 -
trunk/JavaScriptCore/kjs/JSCell.h
r36475 r36726 41 41 friend class CTI; 42 42 private: 43 JSCell(StructureID*);43 explicit JSCell(StructureID*); 44 44 virtual ~JSCell(); 45 45 -
trunk/JavaScriptCore/kjs/JSFunction.cpp
r36263 r36726 46 46 47 47 JSFunction::JSFunction(ExecState* exec, const Identifier& name, FunctionBodyNode* body, ScopeChainNode* scopeChainNode) 48 : Base(exec, exec->lexicalGlobalObject()->function Prototype(), name)48 : Base(exec, exec->lexicalGlobalObject()->functionStructure(), name) 49 49 , m_body(body) 50 50 , m_scopeChain(scopeChainNode) … … 159 159 JSObject* JSFunction::construct(ExecState* exec, const ArgList& args) 160 160 { 161 JSObject* proto;162 JSValue* p = get(exec, exec->propertyNames().prototype);163 if (p ->isObject())164 proto = static_cast<JSObject*>(p);161 StructureID* structure; 162 JSValue* prototype = get(exec, exec->propertyNames().prototype); 163 if (prototype->isObject()) 164 structure = static_cast<JSObject*>(prototype)->inheritorID(); 165 165 else 166 proto = exec->lexicalGlobalObject()->objectPrototype(); 167 168 JSObject* thisObj = new (exec) JSObject(proto); 166 structure = exec->lexicalGlobalObject()->emptyObjectStructure(); 167 JSObject* thisObj = new (exec) JSObject(structure); 169 168 170 169 JSValue* result = exec->machine()->execute(m_body.get(), exec, this, thisObj, args, m_scopeChain.node(), exec->exceptionSlot()); -
trunk/JavaScriptCore/kjs/JSGlobalObject.cpp
r36263 r36726 78 78 } 79 79 80 static inline void markIfNeeded(const RefPtr<StructureID>& s) 81 { 82 if (s) 83 s->mark(); 84 } 85 80 86 JSGlobalObject::~JSGlobalObject() 81 87 { … … 192 198 setRegisterArray(0, 0); 193 199 200 ExecState* exec = d()->globalExec.get(); 201 194 202 // 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"); 212 240 213 241 // 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); 269 263 270 264 d()->functionPrototype->putDirect(exec->propertyNames().constructor, functionConstructor, DontEnum); … … 278 272 d()->datePrototype->putDirect(exec->propertyNames().constructor, dateConstructor, DontEnum); 279 273 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); 287 281 288 282 // Set global constructors … … 308 302 // Set global values. 309 303 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), 311 305 GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(exec), DontEnum | DontDelete), 312 306 GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(exec, Inf), DontEnum | DontDelete), … … 318 312 // Set global functions. 319 313 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); 321 315 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); 332 326 #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); 334 328 #endif 335 329 … … 381 375 markIfNeeded(d()->typeErrorConstructor); 382 376 markIfNeeded(d()->URIErrorConstructor); 383 377 384 378 markIfNeeded(d()->evalFunction); 385 379 386 380 markIfNeeded(d()->objectPrototype); 387 381 markIfNeeded(d()->functionPrototype); 388 markIfNeeded(d()->arrayPrototype);389 382 markIfNeeded(d()->booleanPrototype); 390 383 markIfNeeded(d()->stringPrototype); … … 392 385 markIfNeeded(d()->datePrototype); 393 386 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. 401 392 } 402 393 -
trunk/JavaScriptCore/kjs/JSGlobalObject.h
r36675 r36726 37 37 class Debugger; 38 38 class ErrorConstructor; 39 class ErrorPrototype;40 class EvalError;41 class EvalErrorPrototype;42 39 class FunctionPrototype; 43 40 class GlobalEvalFunction; 44 class JSGlobalObject;45 41 class NativeErrorConstructor; 46 class NativeErrorPrototype;47 class NumberPrototype;48 class ObjectPrototype;49 42 class ProgramCodeBlock; 50 class RangeError;51 class RangeErrorPrototype;52 class ReferenceError;53 class ReferenceError;54 class ReferenceErrorPrototype;55 43 class RegExpConstructor; 56 44 class RegExpPrototype; 57 45 class RegisterFile; 58 class RuntimeMethod;59 class ScopeChain;60 class StringPrototype;61 class SyntaxErrorPrototype;62 class TypeError;63 class TypeErrorPrototype;64 class UriError;65 class UriErrorPrototype;66 46 67 47 struct ActivationStackNode; … … 78 58 : JSVariableObjectData(&symbolTable, 0) 79 59 , globalScopeChain(globalObject, thisValue) 60 , regExpConstructor(0) 61 , errorConstructor(0) 62 , evalErrorConstructor(0) 63 , rangeErrorConstructor(0) 64 , referenceErrorConstructor(0) 65 , syntaxErrorConstructor(0) 66 , typeErrorConstructor(0) 67 , URIErrorConstructor(0) 68 , evalFunction(0) 69 , objectPrototype(0) 70 , functionPrototype(0) 71 , arrayPrototype(0) 72 , booleanPrototype(0) 73 , stringPrototype(0) 74 , numberPrototype(0) 75 , datePrototype(0) 76 , regExpPrototype(0) 80 77 { 81 78 } … … 114 111 DatePrototype* datePrototype; 115 112 RegExpPrototype* regExpPrototype; 116 ErrorPrototype* errorPrototype; 117 NativeErrorPrototype* evalErrorPrototype; 118 NativeErrorPrototype* rangeErrorPrototype; 119 NativeErrorPrototype* referenceErrorPrototype; 120 NativeErrorPrototype* syntaxErrorPrototype; 121 NativeErrorPrototype* typeErrorPrototype; 122 NativeErrorPrototype* URIErrorPrototype; 123 113 114 RefPtr<StructureID> argumentsStructure; 115 RefPtr<StructureID> arrayStructure; 116 RefPtr<StructureID> booleanObjectStructure; 117 RefPtr<StructureID> callbackConstructorStructure; 118 RefPtr<StructureID> callbackFunctionStructure; 119 RefPtr<StructureID> callbackObjectStructure; 120 RefPtr<StructureID> dateStructure; 121 RefPtr<StructureID> emptyObjectStructure; 122 RefPtr<StructureID> errorStructure; 123 RefPtr<StructureID> functionStructure; 124 RefPtr<StructureID> numberObjectStructure; 125 RefPtr<StructureID> prototypeFunctionStructure; 126 RefPtr<StructureID> regExpMatchesArrayStructure; 127 RefPtr<StructureID> regExpStructure; 128 RefPtr<StructureID> stringObjectStructure; 129 124 130 SymbolTable symbolTable; 125 131 unsigned profileGroup; … … 186 192 DatePrototype* datePrototype() const { return d()->datePrototype; } 187 193 RegExpPrototype* regExpPrototype() const { return d()->regExpPrototype; } 188 ErrorPrototype* errorPrototype() const { return d()->errorPrototype; } 189 NativeErrorPrototype* evalErrorPrototype() const { return d()->evalErrorPrototype; } 190 NativeErrorPrototype* rangeErrorPrototype() const { return d()->rangeErrorPrototype; } 191 NativeErrorPrototype* referenceErrorPrototype() const { return d()->referenceErrorPrototype; } 192 NativeErrorPrototype* syntaxErrorPrototype() const { return d()->syntaxErrorPrototype; } 193 NativeErrorPrototype* typeErrorPrototype() const { return d()->typeErrorPrototype; } 194 NativeErrorPrototype* URIErrorPrototype() const { return d()->URIErrorPrototype; } 194 195 StructureID* argumentsStructure() const { return d()->argumentsStructure.get(); } 196 StructureID* arrayStructure() const { return d()->arrayStructure.get(); } 197 StructureID* booleanObjectStructure() const { return d()->booleanObjectStructure.get(); } 198 StructureID* callbackConstructorStructure() const { return d()->callbackConstructorStructure.get(); } 199 StructureID* callbackFunctionStructure() const { return d()->callbackFunctionStructure.get(); } 200 StructureID* callbackObjectStructure() const { return d()->callbackObjectStructure.get(); } 201 StructureID* dateStructure() const { return d()->dateStructure.get(); } 202 StructureID* emptyObjectStructure() const { return d()->emptyObjectStructure.get(); } 203 StructureID* errorStructure() const { return d()->errorStructure.get(); } 204 StructureID* functionStructure() const { return d()->functionStructure.get(); } 205 StructureID* numberObjectStructure() const { return d()->numberObjectStructure.get(); } 206 StructureID* prototypeFunctionStructure() const { return d()->prototypeFunctionStructure.get(); } 207 StructureID* regExpMatchesArrayStructure() const { return d()->regExpMatchesArrayStructure.get(); } 208 StructureID* regExpStructure() const { return d()->regExpStructure.get(); } 209 StructureID* stringObjectStructure() const { return d()->stringObjectStructure.get(); } 195 210 196 211 void setProfileGroup(unsigned value) { d()->profileGroup = value; } -
trunk/JavaScriptCore/kjs/JSImmediate.cpp
r36263 r36726 74 74 } 75 75 76 NEVER_INLINE double JSImmediate::nonInlineNaN() 77 { 78 return std::numeric_limits<double>::quiet_NaN(); 79 } 80 76 81 } // namespace JSC -
trunk/JavaScriptCore/kjs/JSImmediate.h
r36483 r36726 289 289 return reinterpret_cast<uintptr_t>(v); 290 290 } 291 292 static double nonInlineNaN(); 291 293 }; 292 294 … … 406 408 { 407 409 ASSERT(isImmediate(v)); 410 int i; 408 411 if (isNumber(v)) 409 returnintValue(v);410 if (rawValue(v) == (FullTagTypeBool | ExtendedPayloadBitBoolValue))411 return 1.0;412 if (rawValue(v) != FullTagTypeUndefined)413 return 0.0;414 return std::numeric_limits<double>::quiet_NaN();412 i = intValue(v); 413 else if (rawValue(v) == FullTagTypeUndefined) 414 return nonInlineNaN(); 415 else 416 i = rawValue(v) >> ExtendedPayloadShift; 417 return i; 415 418 } 416 419 -
trunk/JavaScriptCore/kjs/JSNumberCell.cpp
r36263 r36726 102 102 } 103 103 104 NEVER_INLINE JSValue* jsNumberCell(ExecState* exec, double d) 105 { 106 return new (exec) JSNumberCell(exec, d); 107 } 108 109 NEVER_INLINE JSValue* jsNaN(ExecState* exec) 110 { 111 return new (exec) JSNumberCell(exec, NaN); 112 } 113 104 114 } // namespace JSC -
trunk/JavaScriptCore/kjs/JSNumberCell.h
r36316 r36726 44 44 class JSNumberCell : public JSCell { 45 45 friend JSValue* jsNumberCell(ExecState*, double); 46 friend JSValue* jsNaN(ExecState*); 46 47 public: 47 48 double value() const { return m_value; } … … 87 88 extern const double Inf; 88 89 89 // Beware marking this function ALWAYS_INLINE: It takes a PIC branch, so 90 // inlining it may not always be a win. 91 inline JSValue* jsNumberCell(ExecState* exec, double d) 92 { 93 return new (exec) JSNumberCell(exec, d); 94 } 95 96 inline JSValue* jsNaN(ExecState* exec) 97 { 98 return jsNumberCell(exec, NaN); 99 } 90 JSValue* jsNumberCell(ExecState*, double); 91 JSValue* jsNaN(ExecState*); 100 92 101 93 ALWAYS_INLINE JSValue* jsNumber(ExecState* exec, double d) -
trunk/JavaScriptCore/kjs/JSObject.cpp
r36701 r36726 518 518 JSObject* constructEmptyObject(ExecState* exec) 519 519 { 520 return new (exec) JSObject(exec->lexicalGlobalObject()-> objectPrototype());520 return new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure()); 521 521 } 522 522 -
trunk/JavaScriptCore/kjs/JSObject.h
r36436 r36726 58 58 59 59 public: 60 JSObject(PassRefPtr<StructureID>); 61 JSObject(JSObject* prototype); 60 explicit JSObject(PassRefPtr<StructureID>); 62 61 63 62 virtual void mark(); … … 198 197 JSObject* constructEmptyObject(ExecState*); 199 198 200 inline JSObject::JSObject(JSObject* prototype)201 : JSCell(prototype->inheritorID())202 , m_propertyStorage(m_inlineStorage)203 {204 ASSERT(m_structureID);205 ASSERT(this->prototype());206 ASSERT(this->prototype()->isNull() || Heap::heap(this) == Heap::heap(this->prototype()));207 m_structureID->ref(); // ~JSObject balances this ref()208 }209 210 199 inline JSObject::JSObject(PassRefPtr<StructureID> structureID) 211 200 : JSCell(structureID.releaseRef()) // ~JSObject balances this ref() … … 213 202 { 214 203 ASSERT(m_structureID); 204 ASSERT(prototype()->isNull() || Heap::heap(this) == Heap::heap(prototype())); 215 205 } 216 206 -
trunk/JavaScriptCore/kjs/JSString.cpp
r36368 r36726 70 70 inline StringObject* StringObject::create(ExecState* exec, JSString* string) 71 71 { 72 return new (exec) StringObject(exec->lexicalGlobalObject()->string Prototype(), string);72 return new (exec) StringObject(exec->lexicalGlobalObject()->stringObjectStructure(), string); 73 73 } 74 74 -
trunk/JavaScriptCore/kjs/JSWrapperObject.h
r36475 r36726 27 27 namespace JSC { 28 28 29 /** 30 This class is used as a base for classes such as String, 31 Number, Boolean and Date which which are wrappers for primitive 32 types. These classes stores the internal value, which is the 33 actual value represented by the wrapper objects. 34 */ 29 // This class is used as a base for classes such as String, 30 // Number, Boolean and Date which are wrappers for primitive types. 35 31 class JSWrapperObject : public JSObject { 36 32 public: 37 JSWrapperObject(JSObject* prototype);33 explicit JSWrapperObject(PassRefPtr<StructureID>); 38 34 39 JSValue* internalValue() const ;35 JSValue* internalValue() const { return m_internalValue; } 40 36 void setInternalValue(JSValue*); 41 37 … … 46 42 }; 47 43 48 inline JSWrapperObject::JSWrapperObject( JSObject* prototype)49 : JSObject( prototype)44 inline JSWrapperObject::JSWrapperObject(PassRefPtr<StructureID> structure) 45 : JSObject(structure) 50 46 , m_internalValue(0) 51 47 { 52 }53 54 inline JSValue* JSWrapperObject::internalValue() const55 {56 return m_internalValue;57 48 } 58 49 … … 60 51 { 61 52 ASSERT(value); 53 ASSERT(!value->isObject()); 62 54 m_internalValue = value; 63 55 } -
trunk/JavaScriptCore/kjs/MathObject.cpp
r36286 r36726 84 84 */ 85 85 86 MathObject::MathObject(ExecState* exec, ObjectPrototype* objectPrototype)87 : JSObject( objectPrototype)86 MathObject::MathObject(ExecState* exec, PassRefPtr<StructureID> structure) 87 : JSObject(structure) 88 88 { 89 89 putDirect(Identifier(exec, "E"), jsNumber(exec, exp(1.0)), DontDelete | DontEnum | ReadOnly); -
trunk/JavaScriptCore/kjs/MathObject.h
r36263 r36726 22 22 23 23 #include "JSObject.h" 24 #include "lookup.h"25 24 26 25 namespace JSC { … … 28 27 class MathObject : public JSObject { 29 28 public: 30 MathObject(ExecState*, ObjectPrototype*);29 MathObject(ExecState*, PassRefPtr<StructureID>); 31 30 32 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);31 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 33 32 34 33 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/kjs/NativeErrorConstructor.cpp
r36263 r36726 23 23 24 24 #include "ErrorInstance.h" 25 #include "FunctionPrototype.h"26 25 #include "JSFunction.h" 27 26 #include "NativeErrorPrototype.h" … … 33 32 const ClassInfo NativeErrorConstructor::info = { "Function", &InternalFunction::info, 0, 0 }; 34 33 35 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, FunctionPrototype* functionPrototype, NativeErrorPrototype* nativeErrorPrototype)36 : InternalFunction(exec, functionPrototype, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name)->getString()))37 , m_ proto(nativeErrorPrototype)34 NativeErrorConstructor::NativeErrorConstructor(ExecState* exec, PassRefPtr<StructureID> structure, NativeErrorPrototype* nativeErrorPrototype) 35 : InternalFunction(exec, structure, Identifier(exec, nativeErrorPrototype->getDirect(exec->propertyNames().name)->getString())) 36 , m_errorStructure(StructureID::create(nativeErrorPrototype)) 38 37 { 39 38 putDirect(exec->propertyNames().length, jsNumber(exec, 1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 40 putDirect(exec->propertyNames().prototype, m_proto, DontDelete | ReadOnly | DontEnum);39 putDirect(exec->propertyNames().prototype, nativeErrorPrototype, DontDelete | ReadOnly | DontEnum); 41 40 } 42 41 43 42 ErrorInstance* NativeErrorConstructor::construct(ExecState* exec, const ArgList& args) 44 43 { 45 ErrorInstance* object = new (exec) ErrorInstance(m_ proto);44 ErrorInstance* object = new (exec) ErrorInstance(m_errorStructure); 46 45 if (!args.at(exec, 0)->isUndefined()) 47 46 object->putDirect(exec->propertyNames().message, jsString(exec, args.at(exec, 0)->toString(exec))); … … 71 70 } 72 71 73 void NativeErrorConstructor::mark()74 {75 JSObject::mark();76 if (m_proto && !m_proto->marked())77 m_proto->mark();78 }79 80 72 } // namespace JSC -
trunk/JavaScriptCore/kjs/NativeErrorConstructor.h
r36263 r36726 32 32 class NativeErrorConstructor : public InternalFunction { 33 33 public: 34 NativeErrorConstructor(ExecState*, FunctionPrototype*, NativeErrorPrototype*); 35 36 virtual void mark(); 34 NativeErrorConstructor(ExecState*, PassRefPtr<StructureID>, NativeErrorPrototype*); 37 35 38 36 static const ClassInfo info; … … 46 44 virtual const ClassInfo* classInfo() const { return &info; } 47 45 48 NativeErrorPrototype* m_proto;46 RefPtr<StructureID> m_errorStructure; 49 47 }; 50 48 -
trunk/JavaScriptCore/kjs/NativeErrorPrototype.cpp
r36263 r36726 30 30 ASSERT_CLASS_FITS_IN_CELL(NativeErrorPrototype); 31 31 32 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, ErrorPrototype* errorPrototype, const UString& name, const UString& message)33 : JSObject( errorPrototype)32 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, PassRefPtr<StructureID> structure, const UString& name, const UString& message) 33 : JSObject(structure) 34 34 { 35 35 putDirect(exec->propertyNames().name, jsString(exec, name), 0); -
trunk/JavaScriptCore/kjs/NativeErrorPrototype.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class ErrorPrototype;29 class UString;30 31 28 class NativeErrorPrototype : public JSObject { 32 29 public: 33 NativeErrorPrototype(ExecState*, ErrorPrototype*, const UString& name, const UString& message);30 NativeErrorPrototype(ExecState*, PassRefPtr<StructureID>, const UString& name, const UString& message); 34 31 }; 35 32 -
trunk/JavaScriptCore/kjs/NumberConstructor.cpp
r36263 r36726 42 42 @end 43 43 */ 44 NumberConstructor::NumberConstructor(ExecState* exec, FunctionPrototype* functionPrototype, NumberPrototype* numberPrototype)45 : InternalFunction(exec, functionPrototype, Identifier(exec, numberPrototype->info.className))44 NumberConstructor::NumberConstructor(ExecState* exec, PassRefPtr<StructureID> structure, NumberPrototype* numberPrototype) 45 : InternalFunction(exec, structure, Identifier(exec, numberPrototype->info.className)) 46 46 { 47 47 // Number.Prototype … … 79 79 static JSObject* constructWithNumberConstructor(ExecState* exec, JSObject*, const ArgList& args) 80 80 { 81 NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());81 NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure()); 82 82 double n = args.isEmpty() ? 0 : args.at(exec, 0)->toNumber(exec); 83 obj ->setInternalValue(jsNumber(exec, n));84 return obj ;83 object->setInternalValue(jsNumber(exec, n)); 84 return object; 85 85 } 86 86 -
trunk/JavaScriptCore/kjs/NumberConstructor.h
r36263 r36726 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 28 class NumberPrototype; 30 29 31 30 class NumberConstructor : public InternalFunction { 32 31 public: 33 NumberConstructor(ExecState*, FunctionPrototype*, NumberPrototype*);32 NumberConstructor(ExecState*, PassRefPtr<StructureID>, NumberPrototype*); 34 33 35 34 bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); -
trunk/JavaScriptCore/kjs/NumberObject.cpp
r36263 r36726 32 32 const ClassInfo NumberObject::info = { "Number", 0, 0, 0 }; 33 33 34 NumberObject::NumberObject( JSObject* prototype)35 : JSWrapperObject( prototype)34 NumberObject::NumberObject(PassRefPtr<StructureID> structure) 35 : JSWrapperObject(structure) 36 36 { 37 37 } … … 44 44 NumberObject* constructNumber(ExecState* exec, JSNumberCell* number) 45 45 { 46 NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());47 obj ->setInternalValue(number);48 return obj ;46 NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure()); 47 object->setInternalValue(number); 48 return object; 49 49 } 50 50 51 51 NumberObject* constructNumberFromImmediateNumber(ExecState* exec, JSValue* value) 52 52 { 53 NumberObject* obj = new (exec) NumberObject(exec->lexicalGlobalObject()->numberPrototype());54 obj ->setInternalValue(value);55 return obj ;53 NumberObject* object = new (exec) NumberObject(exec->lexicalGlobalObject()->numberObjectStructure()); 54 object->setInternalValue(value); 55 return object; 56 56 } 57 57 -
trunk/JavaScriptCore/kjs/NumberObject.h
r36263 r36726 30 30 class NumberObject : public JSWrapperObject { 31 31 public: 32 NumberObject(JSObject* prototype);32 explicit NumberObject(PassRefPtr<StructureID>); 33 33 34 34 static const ClassInfo info; -
trunk/JavaScriptCore/kjs/NumberPrototype.cpp
r36263 r36726 24 24 25 25 #include "Error.h" 26 #include "FunctionPrototype.h"27 26 #include "JSString.h" 28 #include "ObjectPrototype.h"29 27 #include "PrototypeFunction.h" 30 28 #include "dtoa.h" … … 47 45 // ECMA 15.7.4 48 46 49 NumberPrototype::NumberPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)50 : NumberObject( objectPrototype)47 NumberPrototype::NumberPrototype(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure) 48 : NumberObject(structure) 51 49 { 52 50 setInternalValue(jsNumber(exec, 0)); … … 54 52 // The constructor will be added later, after NumberConstructor has been constructed 55 53 56 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum);57 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum);58 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum);59 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum);60 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum);61 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum);54 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().toString, numberProtoFuncToString), DontEnum); 55 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, numberProtoFuncToLocaleString), DontEnum); 56 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, numberProtoFuncValueOf), DontEnum); 57 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().toFixed, numberProtoFuncToFixed), DontEnum); 58 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().toExponential, numberProtoFuncToExponential), DontEnum); 59 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().toPrecision, numberProtoFuncToPrecision), DontEnum); 62 60 } 63 61 -
trunk/JavaScriptCore/kjs/NumberPrototype.h
r36263 r36726 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2000 Harri Porten (porten@kde.org) 3 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 class ObjectPrototype;30 31 28 class NumberPrototype : public NumberObject { 32 29 public: 33 NumberPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);30 NumberPrototype(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure); 34 31 }; 35 32 -
trunk/JavaScriptCore/kjs/ObjectConstructor.cpp
r36263 r36726 22 22 #include "ObjectConstructor.h" 23 23 24 #include "FunctionPrototype.h"25 24 #include "JSGlobalObject.h" 26 25 #include "ObjectPrototype.h" … … 30 29 ASSERT_CLASS_FITS_IN_CELL(ObjectConstructor); 31 30 32 ObjectConstructor::ObjectConstructor(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)33 : InternalFunction(exec, functionPrototype, Identifier(exec, "Object"))31 ObjectConstructor::ObjectConstructor(ExecState* exec, PassRefPtr<StructureID> structure, ObjectPrototype* objectPrototype) 32 : InternalFunction(exec, structure, Identifier(exec, "Object")) 34 33 { 35 34 // ECMA 15.2.3.1 … … 45 44 JSValue* arg = args.at(exec, 0); 46 45 if (arg->isUndefinedOrNull()) 47 return new (exec) JSObject(exec->lexicalGlobalObject()-> objectPrototype());46 return new (exec) JSObject(exec->lexicalGlobalObject()->emptyObjectStructure()); 48 47 return arg->toObject(exec); 49 48 } -
trunk/JavaScriptCore/kjs/ObjectConstructor.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 28 class ObjectPrototype; 30 29 31 30 class ObjectConstructor : public InternalFunction { 32 31 public: 33 ObjectConstructor(ExecState*, ObjectPrototype*, FunctionPrototype*);32 ObjectConstructor(ExecState*, PassRefPtr<StructureID>, ObjectPrototype*); 34 33 35 34 private: -
trunk/JavaScriptCore/kjs/ObjectPrototype.cpp
r36263 r36726 23 23 24 24 #include "Error.h" 25 #include "FunctionPrototype.h"26 25 #include "JSString.h" 27 26 #include "PrototypeFunction.h" … … 41 40 static JSValue* objectProtoFuncToLocaleString(ExecState*, JSObject*, JSValue*, const ArgList&); 42 41 43 ObjectPrototype::ObjectPrototype(ExecState* exec, FunctionPrototype* functionPrototype)42 ObjectPrototype::ObjectPrototype(ExecState* exec, StructureID* prototypeFunctionStructure) 44 43 : JSObject(exec->globalData().nullProtoStructureID) 45 44 { 46 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum);47 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum);48 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum);49 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum);50 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum);51 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum);45 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum); 46 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum); 47 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum); 48 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum); 49 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().propertyIsEnumerable, objectProtoFuncPropertyIsEnumerable), DontEnum); 50 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().isPrototypeOf, objectProtoFuncIsPrototypeOf), DontEnum); 52 51 53 52 // Mozilla extensions 54 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum);55 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum);56 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum);57 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum);53 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 2, exec->propertyNames().__defineGetter__, objectProtoFuncDefineGetter), DontEnum); 54 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 2, exec->propertyNames().__defineSetter__, objectProtoFuncDefineSetter), DontEnum); 55 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().__lookupGetter__, objectProtoFuncLookupGetter), DontEnum); 56 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().__lookupSetter__, objectProtoFuncLookupSetter), DontEnum); 58 57 } 59 60 58 61 59 // ------------------------------ Functions -------------------------------- -
trunk/JavaScriptCore/kjs/ObjectPrototype.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 30 /**31 * @internal32 *33 * The initial value of Object.prototype (and thus all objects created34 * with the Object constructor35 */36 28 class ObjectPrototype : public JSObject { 37 29 public: 38 ObjectPrototype(ExecState*, FunctionPrototype*);30 ObjectPrototype(ExecState*, StructureID* prototypeFunctionStructure); 39 31 }; 40 32 -
trunk/JavaScriptCore/kjs/PrototypeFunction.cpp
r36263 r36726 26 26 #include "PrototypeFunction.h" 27 27 28 #include "FunctionPrototype.h"29 28 #include "JSGlobalObject.h" 30 29 #include <wtf/Assertions.h> … … 35 34 36 35 PrototypeFunction::PrototypeFunction(ExecState* exec, int length, const Identifier& name, NativeFunction function) 37 : InternalFunction(exec, exec->lexicalGlobalObject()-> functionPrototype(), name)36 : InternalFunction(exec, exec->lexicalGlobalObject()->prototypeFunctionStructure(), name) 38 37 , m_function(function) 39 38 { … … 42 41 } 43 42 44 PrototypeFunction::PrototypeFunction(ExecState* exec, FunctionPrototype* functionPrototype, int length, const Identifier& name, NativeFunction function)45 : InternalFunction(exec, functionPrototype, name)43 PrototypeFunction::PrototypeFunction(ExecState* exec, PassRefPtr<StructureID> prototypeFunctionStructure, int length, const Identifier& name, NativeFunction function) 44 : InternalFunction(exec, prototypeFunctionStructure, name) 46 45 , m_function(function) 47 46 { … … 49 48 putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum); 50 49 } 51 50 52 51 CallType PrototypeFunction::getCallData(CallData& callData) 53 52 { -
trunk/JavaScriptCore/kjs/PrototypeFunction.h
r36263 r36726 33 33 public: 34 34 PrototypeFunction(ExecState*, int length, const Identifier&, NativeFunction); 35 PrototypeFunction(ExecState*, FunctionPrototype*, int length, const Identifier&, NativeFunction);35 PrototypeFunction(ExecState*, PassRefPtr<StructureID>, int length, const Identifier&, NativeFunction); 36 36 37 37 private: -
trunk/JavaScriptCore/kjs/RegExpConstructor.cpp
r36263 r36726 79 79 }; 80 80 81 RegExpConstructor::RegExpConstructor(ExecState* exec, FunctionPrototype* functionPrototype, RegExpPrototype* regExpPrototype)82 : InternalFunction(exec, functionPrototype, Identifier(exec, "RegExp"))81 RegExpConstructor::RegExpConstructor(ExecState* exec, PassRefPtr<StructureID> structure, RegExpPrototype* regExpPrototype) 82 : InternalFunction(exec, structure, Identifier(exec, "RegExp")) 83 83 , d(new RegExpConstructorPrivate) 84 84 { … … 133 133 134 134 RegExpMatchesArray::RegExpMatchesArray(ExecState* exec, RegExpConstructorPrivate* data) 135 : JSArray(exec->lexicalGlobalObject()-> arrayPrototype(), data->lastNumSubPatterns + 1)135 : JSArray(exec->lexicalGlobalObject()->regExpMatchesArrayStructure(), data->lastNumSubPatterns + 1) 136 136 { 137 137 RegExpConstructorPrivate* d = new RegExpConstructorPrivate; … … 296 296 if (!regExp->isValid()) 297 297 return throwError(exec, SyntaxError, UString("Invalid regular expression: ").append(regExp->errorMessage())); 298 return new (exec) RegExpObject(exec->lexicalGlobalObject()->regExp Prototype(), regExp.release());298 return new (exec) RegExpObject(exec->lexicalGlobalObject()->regExpStructure(), regExp.release()); 299 299 } 300 300 -
trunk/JavaScriptCore/kjs/RegExpConstructor.h
r36263 r36726 27 27 namespace JSC { 28 28 29 class FunctionPrototype;30 29 class RegExp; 31 30 class RegExpPrototype; … … 52 51 }; 53 52 54 RegExpConstructor(ExecState*, FunctionPrototype*, RegExpPrototype*);53 RegExpConstructor(ExecState*, PassRefPtr<StructureID>, RegExpPrototype*); 55 54 56 55 virtual void put(ExecState*, const Identifier& propertyName, JSValue*, PutPropertySlot&); -
trunk/JavaScriptCore/kjs/RegExpObject.cpp
r36263 r36726 45 45 */ 46 46 47 RegExpObject::RegExpObject( RegExpPrototype* regExpPrototype, PassRefPtr<RegExp> regExp)48 : JSObject( regExpPrototype)47 RegExpObject::RegExpObject(PassRefPtr<StructureID> structure, PassRefPtr<RegExp> regExp) 48 : JSObject(structure) 49 49 , d(new RegExpObjectData(regExp, 0)) 50 50 { -
trunk/JavaScriptCore/kjs/RegExpObject.h
r36263 r36726 27 27 namespace JSC { 28 28 29 class RegExpPrototype;30 31 29 class RegExpObject : public JSObject { 32 30 public: 33 31 enum { Global, IgnoreCase, Multiline, Source, LastIndex }; 34 32 35 RegExpObject( RegExpPrototype*, PassRefPtr<RegExp>);33 RegExpObject(PassRefPtr<StructureID>, PassRefPtr<RegExp>); 36 34 virtual ~RegExpObject(); 37 35 -
trunk/JavaScriptCore/kjs/RegExpPrototype.cpp
r36263 r36726 23 23 24 24 #include "ArrayPrototype.h" 25 #include "FunctionPrototype.h"26 25 #include "JSArray.h" 27 26 #include "JSObject.h" … … 46 45 const ClassInfo RegExpPrototype::info = { "RegExpPrototype", 0, 0, 0 }; 47 46 48 RegExpPrototype::RegExpPrototype(ExecState* exec, ObjectPrototype* objectPrototype, FunctionPrototype* functionPrototype)49 : JSObject( objectPrototype)47 RegExpPrototype::RegExpPrototype(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure) 48 : JSObject(structure) 50 49 { 51 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum);52 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum);53 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().test, regExpProtoFuncTest), DontEnum);54 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum);50 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().compile, regExpProtoFuncCompile), DontEnum); 51 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().exec, regExpProtoFuncExec), DontEnum); 52 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().test, regExpProtoFuncTest), DontEnum); 53 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, regExpProtoFuncToString), DontEnum); 55 54 } 56 55 -
trunk/JavaScriptCore/kjs/RegExpPrototype.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 class ObjectPrototype;30 31 28 class RegExpPrototype : public JSObject { 32 29 public: 33 RegExpPrototype(ExecState*, ObjectPrototype*, FunctionPrototype*);30 RegExpPrototype(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure); 34 31 35 32 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/kjs/Shell.cpp
r36263 r36726 172 172 : JSGlobalObject(globalData) 173 173 { 174 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, Identifier(globalExec(), "debug"), functionDebug));175 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, Identifier(globalExec(), "print"), functionPrint));176 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, Identifier(globalExec(), "quit"), functionQuit));177 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, Identifier(globalExec(), "gc"), functionGC));178 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, Identifier(globalExec(), "version"), functionVersion));179 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, Identifier(globalExec(), "run"), functionRun));180 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 1, Identifier(globalExec(), "load"), functionLoad));181 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), functionPrototype(), 0, Identifier(globalExec(), "readline"), functionReadline));174 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug)); 175 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "print"), functionPrint)); 176 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "quit"), functionQuit)); 177 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "gc"), functionGC)); 178 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "version"), functionVersion)); 179 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun)); 180 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad)); 181 putDirectFunction(globalExec(), new (globalExec()) PrototypeFunction(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline)); 182 182 183 183 JSObject* array = constructEmptyArray(globalExec()); -
trunk/JavaScriptCore/kjs/StringConstructor.cpp
r36263 r36726 22 22 #include "StringConstructor.h" 23 23 24 #include "FunctionPrototype.h"25 24 #include "JSGlobalObject.h" 26 25 #include "PrototypeFunction.h" … … 48 47 ASSERT_CLASS_FITS_IN_CELL(StringConstructor); 49 48 50 StringConstructor::StringConstructor(ExecState* exec, FunctionPrototype* functionPrototype, StringPrototype* stringPrototype)51 : InternalFunction(exec, functionPrototype, Identifier(exec, stringPrototype->classInfo()->className))49 StringConstructor::StringConstructor(ExecState* exec, PassRefPtr<StructureID> structure, StructureID* prototypeFunctionStructure, StringPrototype* stringPrototype) 50 : InternalFunction(exec, structure, Identifier(exec, stringPrototype->classInfo()->className)) 52 51 { 53 52 // ECMA 15.5.3.1 String.prototype … … 55 54 56 55 // ECMA 15.5.3.2 fromCharCode() 57 putDirectFunction(exec, new (exec) PrototypeFunction(exec, functionPrototype, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum);56 putDirectFunction(exec, new (exec) PrototypeFunction(exec, prototypeFunctionStructure, 1, exec->propertyNames().fromCharCode, stringFromCharCode), DontEnum); 58 57 59 58 // no. of arguments for constructor … … 64 63 static JSObject* constructWithStringConstructor(ExecState* exec, JSObject*, const ArgList& args) 65 64 { 66 JSObject* prototype = exec->lexicalGlobalObject()->stringPrototype();67 65 if (args.isEmpty()) 68 return new (exec) StringObject(exec, prototype);69 return new (exec) StringObject(exec, prototype, args.at(exec, 0)->toString(exec));66 return new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure()); 67 return new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure(), args.at(exec, 0)->toString(exec)); 70 68 } 71 69 -
trunk/JavaScriptCore/kjs/StringConstructor.h
r36263 r36726 26 26 namespace JSC { 27 27 28 class FunctionPrototype;29 28 class StringPrototype; 30 29 31 30 class StringConstructor : public InternalFunction { 32 31 public: 33 StringConstructor(ExecState*, FunctionPrototype*, StringPrototype*);32 StringConstructor(ExecState*, PassRefPtr<StructureID>, StructureID* prototypeFunctionStructure, StringPrototype*); 34 33 35 34 virtual ConstructType getConstructData(ConstructData&); -
trunk/JavaScriptCore/kjs/StringObject.cpp
r36263 r36726 30 30 const ClassInfo StringObject::info = { "String", 0, 0, 0 }; 31 31 32 StringObject::StringObject(ExecState* exec, JSObject* prototype)33 : JSWrapperObject( prototype)32 StringObject::StringObject(ExecState* exec, PassRefPtr<StructureID> structure) 33 : JSWrapperObject(structure) 34 34 { 35 35 setInternalValue(jsEmptyString(exec)); 36 36 } 37 37 38 StringObject::StringObject( JSObject* prototype, JSString* string)39 : JSWrapperObject( prototype)38 StringObject::StringObject(PassRefPtr<StructureID> structure, JSString* string) 39 : JSWrapperObject(structure) 40 40 { 41 41 setInternalValue(string); 42 42 } 43 43 44 StringObject::StringObject(ExecState* exec, JSObject* prototype, const UString& string)45 : JSWrapperObject( prototype)44 StringObject::StringObject(ExecState* exec, PassRefPtr<StructureID> structure, const UString& string) 45 : JSWrapperObject(structure) 46 46 { 47 47 setInternalValue(jsString(exec, string)); -
trunk/JavaScriptCore/kjs/StringObject.h
r36475 r36726 29 29 class StringObject : public JSWrapperObject { 30 30 public: 31 StringObject(ExecState*, JSObject* prototype);32 StringObject(ExecState*, JSObject* prototype, const UString&);31 StringObject(ExecState*, PassRefPtr<StructureID>); 32 StringObject(ExecState*, PassRefPtr<StructureID>, const UString&); 33 33 34 34 static StringObject* create(ExecState*, JSString*); … … 47 47 48 48 protected: 49 StringObject( JSObject* prototype, JSString*);49 StringObject(PassRefPtr<StructureID>, JSString*); 50 50 51 51 private: -
trunk/JavaScriptCore/kjs/StringObjectThatMasqueradesAsUndefined.h
r36475 r36726 30 30 class StringObjectThatMasqueradesAsUndefined : public StringObject { 31 31 public: 32 StringObjectThatMasqueradesAsUndefined(ExecState* exec, JSObject* prototype, const UString& string)33 : StringObject(exec, prototype, string)32 StringObjectThatMasqueradesAsUndefined(ExecState* exec, PassRefPtr<StructureID> structure, const UString& string) 33 : StringObject(exec, structure, string) 34 34 { 35 35 } -
trunk/JavaScriptCore/kjs/StringPrototype.cpp
r36263 r36726 117 117 118 118 // ECMA 15.5.4 119 StringPrototype::StringPrototype(ExecState* exec, ObjectPrototype* objectPrototype)120 : StringObject(exec, objectPrototype)119 StringPrototype::StringPrototype(ExecState* exec, PassRefPtr<StructureID> structure) 120 : StringObject(exec, structure) 121 121 { 122 122 // The constructor will be added later, after StringConstructor has been built -
trunk/JavaScriptCore/kjs/StringPrototype.h
r36263 r36726 30 30 class StringPrototype : public StringObject { 31 31 public: 32 StringPrototype(ExecState*, ObjectPrototype*);32 StringPrototype(ExecState*, PassRefPtr<StructureID>); 33 33 34 34 virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); -
trunk/WebCore/ChangeLog
r36725 r36726 1 2008-09-20 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej Stachowiak. 4 5 - finish https://bugs.webkit.org/show_bug.cgi?id=20858 6 make each distinct C++ class get a distinct JSC::Structure 7 8 * bindings/js/JSCSSStyleDeclarationCustom.cpp: 9 (WebCore::JSCSSStyleDeclaration::nameGetter): Pass in a structure 10 ID. Note that this makes a new structure every time -- we could 11 optimize this slightly be caching and reusing a single one. 12 13 * bridge/runtime_method.cpp: 14 (JSC::RuntimeMethod::RuntimeMethod): Create a unique structure using 15 getDOMStructure. 16 * bridge/runtime_method.h: 17 (JSC::RuntimeMethod::createPrototype): Added createPrototype so 18 getDOMStructure will work. 19 20 * bindings/js/JSDOMWindowShell.cpp: 21 (WebCore::JSDOMWindowShell::JSDOMWindowShell): Initialize m_window to 22 0; needed in case garbage collection happens while creating the 23 JSDOMWindow. 24 1 25 2008-09-20 Dan Bernstein <mitz@apple.com> 2 26 … … 131 155 BackButtonPart was split into Start and End Part 132 156 ForwardButtonPart was split into Start and End Part 133 134 157 135 158 * platform/qt/ScrollbarThemeQt.cpp: -
trunk/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp
r36662 r36726 151 151 // Make the SVG 'filter' attribute undetectable, to avoid confusion with the IE 'filter' attribute. 152 152 if (propertyName == "filter") 153 return new (exec) StringObjectThatMasqueradesAsUndefined(exec, exec->lexicalGlobalObject()->stringPrototype(), 153 return new (exec) StringObjectThatMasqueradesAsUndefined(exec, 154 StructureID::create(exec->lexicalGlobalObject()->stringPrototype()), 154 155 thisObj->impl()->getPropertyValue(prop)); 155 156 -
trunk/WebCore/bindings/js/JSDOMWindowShell.cpp
r36675 r36726 46 46 JSDOMWindowShell::JSDOMWindowShell(PassRefPtr<DOMWindow> window) 47 47 : Base(StructureID::create(jsNull())) 48 , m_window(0) 48 49 { 49 50 setWindow(window); -
trunk/WebCore/bridge/runtime_method.cpp
r36263 r36726 27 27 #include "runtime_method.h" 28 28 29 #include "JSDOMBinding.h" 29 30 #include "runtime_object.h" 30 31 #include <kjs/Error.h> 31 #include <kjs/JSGlobalObject.h> 32 #include <kjs/FunctionPrototype.h> 33 34 using namespace WebCore; 32 35 33 36 namespace JSC { … … 37 40 ASSERT_CLASS_FITS_IN_CELL(RuntimeMethod); 38 41 39 RuntimeMethod::RuntimeMethod(ExecState *exec, const Identifier &ident, Bindings::MethodList &m) 40 : InternalFunction(exec, exec->lexicalGlobalObject()->functionPrototype(), ident) 42 const ClassInfo RuntimeMethod::s_info = { "RuntimeMethod", 0, 0, 0 }; 43 44 RuntimeMethod::RuntimeMethod(ExecState* exec, const Identifier& ident, Bindings::MethodList& m) 45 : InternalFunction(exec, getDOMStructure<RuntimeMethod>(exec), ident) 41 46 , _methodList(new MethodList(m)) 42 47 { -
trunk/WebCore/bridge/runtime_method.h
r36263 r36726 29 29 #include "runtime.h" 30 30 #include <kjs/InternalFunction.h> 31 #include <kjs/JSGlobalObject.h> 31 32 #include <wtf/OwnPtr.h> 32 33 … … 37 38 RuntimeMethod(ExecState*, const Identifier& name, Bindings::MethodList&); 38 39 Bindings::MethodList* methods() const { return _methodList.get(); } 40 41 static const ClassInfo s_info; 42 43 static FunctionPrototype* createPrototype(ExecState* exec) 44 { 45 return exec->lexicalGlobalObject()->functionPrototype(); 46 } 39 47 40 48 private:
Note:
See TracChangeset
for help on using the changeset viewer.