Changeset 47404 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- Aug 17, 2009, 6:00:12 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Arguments.h
r47330 r47404 101 101 102 102 void init(CallFrame*); 103 void initializeStandardProperties(CallFrame*);104 103 105 104 OwnPtr<ArgumentsData> d; … … 135 134 , d(new ArgumentsData) 136 135 { 137 initializeStandardProperties(callFrame);138 136 JSFunction* callee; 139 137 ptrdiff_t firstParameterIndex; … … 174 172 { 175 173 ASSERT(!callFrame->callee()->body()->parameterCount()); 176 177 initializeStandardProperties(callFrame); 174 178 175 unsigned numArguments = callFrame->argumentCount() - 1; 179 176 … … 243 240 } 244 241 245 246 inline void Arguments::initializeStandardProperties(CallFrame* callFrame)247 {248 putDirectFunction(callFrame->propertyNames().constructor, callFrame->lexicalGlobalObject()->objectConstructor(), DontEnum);249 putDirectFunction(callFrame->propertyNames().toString, callFrame->lexicalGlobalObject()->objectToStringFunction(), DontEnum);250 putDirectFunction(callFrame->propertyNames().toLocaleString, callFrame->lexicalGlobalObject()->objectToLocaleStringFunction(), DontEnum);251 }252 242 253 243 } // namespace JSC -
trunk/JavaScriptCore/runtime/JSGlobalObject.cpp
r47304 r47404 211 211 d()->callFunction = callFunction; 212 212 d()->applyFunction = applyFunction; 213 NativeFunctionWrapper* objectToStringFunction = 0; 214 NativeFunctionWrapper* objectToLocaleStringFunction = 0; 215 d()->objectPrototype = new (exec) ObjectPrototype(exec, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get(), &objectToStringFunction, &objectToLocaleStringFunction); 216 d()->objectToStringFunction = objectToStringFunction; 217 d()->objectToLocaleStringFunction = objectToLocaleStringFunction; 213 d()->objectPrototype = new (exec) ObjectPrototype(exec, ObjectPrototype::createStructure(jsNull()), d()->prototypeFunctionStructure.get()); 218 214 d()->functionPrototype->structure()->setPrototypeWithoutTransition(d()->objectPrototype); 219 215 … … 222 218 d()->functionStructure = JSFunction::createStructure(d()->functionPrototype); 223 219 d()->callbackFunctionStructure = JSCallbackFunction::createStructure(d()->functionPrototype); 220 d()->argumentsStructure = Arguments::createStructure(d()->objectPrototype); 224 221 d()->callbackConstructorStructure = JSCallbackConstructor::createStructure(d()->objectPrototype); 225 222 d()->callbackObjectStructure = JSCallbackObject<JSObject>::createStructure(d()->objectPrototype); 226 223 227 224 d()->arrayPrototype = new (exec) ArrayPrototype(ArrayPrototype::createStructure(d()->objectPrototype)); 228 d()->argumentsStructure = Arguments::createStructure(d()->arrayPrototype);229 225 d()->arrayStructure = JSArray::createStructure(d()->arrayPrototype); 230 226 d()->regExpMatchesArrayStructure = RegExpMatchesArray::createStructure(d()->arrayPrototype); … … 261 257 // Constructors 262 258 263 ObjectConstructor* objectConstructor = new (exec) ObjectConstructor(exec, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get());259 JSCell* objectConstructor = new (exec) ObjectConstructor(exec, ObjectConstructor::createStructure(d()->functionPrototype), d()->objectPrototype, d()->prototypeFunctionStructure.get()); 264 260 JSCell* functionConstructor = new (exec) FunctionConstructor(exec, FunctionConstructor::createStructure(d()->functionPrototype), d()->functionPrototype); 265 261 JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, ArrayConstructor::createStructure(d()->functionPrototype), d()->arrayPrototype, d()->prototypeFunctionStructure.get()); … … 275 271 RefPtr<Structure> nativeErrorStructure = NativeErrorConstructor::createStructure(d()->functionPrototype); 276 272 277 d()->objectConstructor = objectConstructor;278 273 d()->evalErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, evalErrorPrototype); 279 274 d()->rangeErrorConstructor = new (exec) NativeErrorConstructor(exec, nativeErrorStructure, rangeErrorPrototype); … … 374 369 if (registerFile.globalObject() == this) 375 370 registerFile.markGlobals(markStack, &globalData()->heap); 376 377 markIfNeeded(markStack, d()->objectConstructor); 371 378 372 markIfNeeded(markStack, d()->regExpConstructor); 379 373 markIfNeeded(markStack, d()->errorConstructor); … … 388 382 markIfNeeded(markStack, d()->callFunction); 389 383 markIfNeeded(markStack, d()->applyFunction); 390 markIfNeeded(markStack, d()->objectToStringFunction);391 markIfNeeded(markStack, d()->objectToLocaleStringFunction);392 384 393 385 markIfNeeded(markStack, d()->objectPrototype); -
trunk/JavaScriptCore/runtime/JSGlobalObject.h
r47304 r47404 39 39 class ErrorConstructor; 40 40 class FunctionPrototype; 41 class GlobalCodeBlock; 41 42 class GlobalEvalFunction; 42 43 class NativeErrorConstructor; 43 class GlobalCodeBlock; 44 class ObjectConstructor; 44 class ProgramCodeBlock; 45 45 class PrototypeFunction; 46 46 class RegExpConstructor; … … 62 62 , registerArraySize(0) 63 63 , globalScopeChain(NoScopeChain()) 64 , objectConstructor(0)65 64 , regExpConstructor(0) 66 65 , errorConstructor(0) … … 74 73 , callFunction(0) 75 74 , applyFunction(0) 76 , objectToStringFunction(0)77 , objectToLocaleStringFunction(0)78 75 , objectPrototype(0) 79 76 , functionPrototype(0) … … 104 101 int recursion; 105 102 106 ObjectConstructor* objectConstructor;107 103 RegExpConstructor* regExpConstructor; 108 104 ErrorConstructor* errorConstructor; … … 117 113 NativeFunctionWrapper* callFunction; 118 114 NativeFunctionWrapper* applyFunction; 119 NativeFunctionWrapper* objectToStringFunction;120 NativeFunctionWrapper* objectToLocaleStringFunction;121 115 122 116 ObjectPrototype* objectPrototype; … … 191 185 // replaces the global object's associated property. 192 186 193 ObjectConstructor* objectConstructor() const { return d()->objectConstructor; }194 187 RegExpConstructor* regExpConstructor() const { return d()->regExpConstructor; } 195 188 … … 212 205 DatePrototype* datePrototype() const { return d()->datePrototype; } 213 206 RegExpPrototype* regExpPrototype() const { return d()->regExpPrototype; } 214 215 NativeFunctionWrapper* objectToStringFunction() const { return d()->objectToStringFunction; }216 NativeFunctionWrapper* objectToLocaleStringFunction() const { return d()->objectToLocaleStringFunction; }217 207 218 208 JSObject* methodCallDummy() const { return d()->methodCallDummy; } -
trunk/JavaScriptCore/runtime/ObjectPrototype.cpp
r47292 r47404 41 41 static JSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState*, JSObject*, JSValue, const ArgList&); 42 42 43 ObjectPrototype::ObjectPrototype(ExecState* exec, PassRefPtr<Structure> stucture, Structure* prototypeFunctionStructure , NativeFunctionWrapper** toStringFunction, NativeFunctionWrapper** toLocaleStringFunction)43 ObjectPrototype::ObjectPrototype(ExecState* exec, PassRefPtr<Structure> stucture, Structure* prototypeFunctionStructure) 44 44 : JSObject(stucture) 45 45 { 46 NativeFunctionWrapper* toString = new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString); 47 NativeFunctionWrapper* toLocaleString = new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString); 48 *toStringFunction = toString; 49 *toLocaleStringFunction = toLocaleString; 50 putDirectFunctionWithoutTransition(exec, toString, DontEnum); 51 putDirectFunctionWithoutTransition(exec, toLocaleString, DontEnum); 46 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toString, objectProtoFuncToString), DontEnum); 47 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().toLocaleString, objectProtoFuncToLocaleString), DontEnum); 52 48 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 0, exec->propertyNames().valueOf, objectProtoFuncValueOf), DontEnum); 53 49 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().hasOwnProperty, objectProtoFuncHasOwnProperty), DontEnum); -
trunk/JavaScriptCore/runtime/ObjectPrototype.h
r47292 r47404 28 28 class ObjectPrototype : public JSObject { 29 29 public: 30 ObjectPrototype(ExecState*, PassRefPtr<Structure>, Structure* prototypeFunctionStructure , NativeFunctionWrapper** toStringFunction, NativeFunctionWrapper** toLocaleStringFunction);30 ObjectPrototype(ExecState*, PassRefPtr<Structure>, Structure* prototypeFunctionStructure); 31 31 }; 32 32
Note:
See TracChangeset
for help on using the changeset viewer.