Changeset 156620 in webkit
- Timestamp:
- Sep 29, 2013 3:20:26 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r156617 r156620 1 2013-09-29 Andreas Kling <akling@apple.com> 2 3 Pass VM instead of ExecState to simple builtin constructors. 4 <https://webkit.org/b/122077> 5 6 Reviewed by Sam Weinig. 7 8 None of the simple builtins need the ExecState for anything during 9 their construction, so reduce the amount of loads by just passing 10 the VM around instead. 11 1 12 2013-09-29 Nadav Rotem <nrotem@apple.com> 2 13 -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp
r156498 r156620 51 51 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(BooleanPrototype); 52 52 53 BooleanPrototype::BooleanPrototype( ExecState* exec, Structure* structure)54 : BooleanObject( exec->vm(), structure)53 BooleanPrototype::BooleanPrototype(VM& vm, Structure* structure) 54 : BooleanObject(vm, structure) 55 55 { 56 56 } -
trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h
r156498 r156620 30 30 typedef BooleanObject Base; 31 31 32 static BooleanPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)32 static BooleanPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 33 33 { 34 VM& vm = exec->vm(); 35 BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(exec, structure); 34 BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(vm, structure); 36 35 prototype->finishCreation(vm, globalObject); 37 36 return prototype; … … 50 49 51 50 private: 52 BooleanPrototype( ExecState*, Structure*);51 BooleanPrototype(VM&, Structure*); 53 52 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 54 53 }; -
trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp
r156540 r156620 95 95 JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args) 96 96 { 97 VM& vm = exec->vm(); 97 98 int numArgs = args.size(); 98 99 … … 107 108 JSValue primitive = args.at(0).toPrimitive(exec); 108 109 if (primitive.isString()) 109 value = parseDate( exec->vm(), primitive.getString(exec));110 value = parseDate(vm, primitive.getString(exec)); 110 111 else 111 112 value = primitive.toNumber(exec); … … 140 141 t.setIsDST(-1); 141 142 double ms = (numArgs >= 7) ? doubleArguments[6] : 0; 142 value = gregorianDateTimeToMS( exec->vm(), t, ms, false);143 value = gregorianDateTimeToMS(vm, t, ms, false); 143 144 } 144 145 } 145 146 146 return DateInstance::create( exec, globalObject->dateStructure(), value);147 return DateInstance::create(vm, globalObject->dateStructure(), value); 147 148 } 148 149 -
trunk/Source/JavaScriptCore/runtime/DateInstance.cpp
r156540 r156620 35 35 const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)}; 36 36 37 DateInstance::DateInstance( ExecState* exec, Structure* structure)38 : JSWrapperObject( exec->vm(), structure)37 DateInstance::DateInstance(VM& vm, Structure* structure) 38 : JSWrapperObject(vm, structure) 39 39 { 40 40 } -
trunk/Source/JavaScriptCore/runtime/DateInstance.h
r154038 r156620 28 28 class DateInstance : public JSWrapperObject { 29 29 protected: 30 JS_EXPORT_PRIVATE DateInstance( ExecState*, Structure*);30 JS_EXPORT_PRIVATE DateInstance(VM&, Structure*); 31 31 void finishCreation(VM&); 32 32 JS_EXPORT_PRIVATE void finishCreation(VM&, double); … … 37 37 typedef JSWrapperObject Base; 38 38 39 static DateInstance* create( ExecState* exec, Structure* structure, double date)39 static DateInstance* create(VM& vm, Structure* structure, double date) 40 40 { 41 DateInstance* instance = new (NotNull, allocateCell<DateInstance>( *exec->heap())) DateInstance(exec, structure);42 instance->finishCreation( exec->vm(), date);41 DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure); 42 instance->finishCreation(vm, date); 43 43 return instance; 44 44 } 45 45 46 static DateInstance* create( ExecState* exec, Structure* structure)46 static DateInstance* create(VM& vm, Structure* structure) 47 47 { 48 DateInstance* instance = new (NotNull, allocateCell<DateInstance>( *exec->heap())) DateInstance(exec, structure);49 instance->finishCreation( exec->vm());48 DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure); 49 instance->finishCreation(vm); 50 50 return instance; 51 51 } -
trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp
r156540 r156620 502 502 // ECMA 15.9.4 503 503 504 DatePrototype::DatePrototype( ExecState* exec, Structure* structure)505 : DateInstance( exec, structure)504 DatePrototype::DatePrototype(VM& vm, Structure* structure) 505 : DateInstance(vm, structure) 506 506 { 507 507 } -
trunk/Source/JavaScriptCore/runtime/DatePrototype.h
r156498 r156620 30 30 class DatePrototype : public DateInstance { 31 31 private: 32 DatePrototype( ExecState*, Structure*);32 DatePrototype(VM&, Structure*); 33 33 34 34 public: 35 35 typedef DateInstance Base; 36 36 37 static DatePrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)37 static DatePrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 VM& vm = exec->vm(); 40 DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(exec, structure); 39 DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(vm, structure); 41 40 prototype->finishCreation(vm, globalObject); 42 41 return prototype; -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp
r156498 r156620 50 50 */ 51 51 52 ErrorPrototype::ErrorPrototype( ExecState* exec, Structure* structure)53 : ErrorInstance( exec->vm(), structure)52 ErrorPrototype::ErrorPrototype(VM& vm, Structure* structure) 53 : ErrorInstance(vm, structure) 54 54 { 55 55 } -
trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h
r156498 r156620 32 32 typedef ErrorInstance Base; 33 33 34 static ErrorPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)34 static ErrorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 35 35 { 36 VM& vm = exec->vm(); 37 ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(exec, structure); 36 ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(vm, structure); 38 37 prototype->finishCreation(vm, globalObject); 39 38 return prototype; … … 48 47 49 48 protected: 50 ErrorPrototype( ExecState*, Structure*);49 ErrorPrototype(VM&, Structure*); 51 50 void finishCreation(VM&, JSGlobalObject*); 52 51 -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp
r156240 r156620 79 79 } 80 80 81 void JSArrayBufferPrototype::finishCreation( ExecState* exec, JSGlobalObject* globalObject)81 void JSArrayBufferPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) 82 82 { 83 VM& vm = exec->vm();84 85 83 Base::finishCreation(vm); 86 84 … … 88 86 } 89 87 90 JSArrayBufferPrototype* JSArrayBufferPrototype::create( 91 ExecState* exec, JSGlobalObject* globalObject, Structure* structure) 88 JSArrayBufferPrototype* JSArrayBufferPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 92 89 { 93 VM& vm = exec->vm();94 90 JSArrayBufferPrototype* prototype = 95 91 new (NotNull, allocateCell<JSArrayBufferPrototype>(vm.heap)) 96 92 JSArrayBufferPrototype(vm, structure); 97 prototype->finishCreation( exec, globalObject);93 prototype->finishCreation(vm, globalObject); 98 94 return prototype; 99 95 } -
trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.h
r154127 r156620 37 37 protected: 38 38 JSArrayBufferPrototype(VM&, Structure*); 39 void finishCreation( ExecState*, JSGlobalObject*);39 void finishCreation(VM&, JSGlobalObject*); 40 40 41 41 public: 42 static JSArrayBufferPrototype* create( ExecState*, JSGlobalObject*, Structure*);42 static JSArrayBufferPrototype* create(VM&, JSGlobalObject*, Structure*); 43 43 44 44 DECLARE_INFO; -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r156602 r156620 313 313 314 314 #define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ 315 m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create( exec, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \315 m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \ 316 316 m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get())); 317 317 … … 345 345 Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(vm, this, m_errorPrototype.get()); 346 346 Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(vm, this, m_functionPrototype.get()); 347 m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError")));348 m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError")));349 m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError")));350 m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError")));351 m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError")));352 m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create( exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError")));347 m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError"))); 348 m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError"))); 349 m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError"))); 350 m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError"))); 351 m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError"))); 352 m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError"))); 353 353 354 354 m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum); -
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r156602 r156620 2202 2202 } 2203 2203 2204 void JSObject::putDirectNativeFunction( ExecState* exec, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)2204 void JSObject::putDirectNativeFunction(VM& vm, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes) 2205 2205 { 2206 2206 StringImpl* name = propertyName.publicName(); 2207 2207 ASSERT(name); 2208 2208 2209 VM& vm = exec->vm();2210 2209 JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic); 2211 2210 putDirect(vm, propertyName, function, attributes); -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r156602 r156620 578 578 void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); } 579 579 580 void putDirectNativeFunction( ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);580 void putDirectNativeFunction(VM&, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes); 581 581 void putDirectNativeFunctionWithoutTransition(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes); 582 582 … … 1499 1499 COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment); 1500 1500 1501 ALWAYS_INLINE Identifier makeIdentifier( ExecState* exec, const char* name)1502 { 1503 return Identifier( exec, name);1504 } 1505 1506 ALWAYS_INLINE Identifier makeIdentifier( ExecState*, const Identifier& name)1501 ALWAYS_INLINE Identifier makeIdentifier(VM& vm, const char* name) 1502 { 1503 return Identifier(&vm, name); 1504 } 1505 1506 ALWAYS_INLINE Identifier makeIdentifier(VM&, const Identifier& name) 1507 1507 { 1508 1508 return name; … … 1515 1515 #define JSC_NATIVE_INTRINSIC_FUNCTION(jsName, cppName, attributes, length, intrinsic) \ 1516 1516 putDirectNativeFunction(\ 1517 exec, globalObject, makeIdentifier(exec, (jsName)), (length), cppName, \1517 vm, globalObject, makeIdentifier(vm, (jsName)), (length), cppName, \ 1518 1518 (intrinsic), (attributes)) 1519 1519 -
trunk/Source/JavaScriptCore/runtime/Lookup.cpp
r154253 r156620 70 70 ASSERT(thisObj->globalObject()); 71 71 ASSERT(entry->attributes() & Function); 72 VM& vm = exec->vm(); 72 73 unsigned attributes; 73 PropertyOffset offset = thisObj->getDirectOffset( exec->vm(), propertyName, attributes);74 PropertyOffset offset = thisObj->getDirectOffset(vm, propertyName, attributes); 74 75 75 76 if (!isValidOffset(offset)) { … … 80 81 81 82 thisObj->putDirectNativeFunction( 82 exec, thisObj->globalObject(), propertyName, entry->functionLength(),83 vm, thisObj->globalObject(), propertyName, entry->functionLength(), 83 84 entry->function(), entry->intrinsic(), entry->attributes()); 84 offset = thisObj->getDirectOffset( exec->vm(), propertyName, attributes);85 offset = thisObj->getDirectOffset(vm, propertyName, attributes); 85 86 ASSERT(isValidOffset(offset)); 86 87 } -
trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp
r156602 r156620 49 49 static EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(ExecState*); 50 50 51 void MapPrototype::finishCreation( ExecState* exec, JSGlobalObject* globalObject)51 void MapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) 52 52 { 53 VM& vm = exec->vm();54 55 53 Base::finishCreation(vm); 56 54 ASSERT(inherits(info())); -
trunk/Source/JavaScriptCore/runtime/MapPrototype.h
r154861 r156620 35 35 typedef JSNonFinalObject Base; 36 36 37 static MapPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)37 static MapPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>( *exec->heap())) MapPrototype(exec, structure);40 prototype->finishCreation( exec, globalObject);39 MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>(vm.heap)) MapPrototype(vm, structure); 40 prototype->finishCreation(vm, globalObject); 41 41 return prototype; 42 42 } … … 50 50 51 51 private: 52 MapPrototype( ExecState* exec, Structure* structure)53 : Base( exec->vm(), structure)52 MapPrototype(VM& vm, Structure* structure) 53 : Base(vm, structure) 54 54 { 55 55 } 56 void finishCreation( ExecState*, JSGlobalObject*);56 void finishCreation(VM&, JSGlobalObject*); 57 57 }; 58 58 -
trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h
r154038 r156620 35 35 typedef InternalFunction Base; 36 36 37 static NativeErrorConstructor* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)37 static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name) 38 38 { 39 NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>( *exec->heap())) NativeErrorConstructor(globalObject, structure);40 constructor->finishCreation( exec, globalObject, prototypeStructure, name);39 NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(globalObject, structure); 40 constructor->finishCreation(vm, globalObject, prototypeStructure, name); 41 41 return constructor; 42 42 } … … 52 52 53 53 protected: 54 void finishCreation( ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name)54 void finishCreation(VM& vm, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name) 55 55 { 56 Base::finishCreation( exec->vm(), name);56 Base::finishCreation(vm, name); 57 57 ASSERT(inherits(info())); 58 58 59 NativeErrorPrototype* prototype = NativeErrorPrototype::create( exec, globalObject, prototypeStructure, name, this);59 NativeErrorPrototype* prototype = NativeErrorPrototype::create(vm, globalObject, prototypeStructure, name, this); 60 60 61 putDirect( exec->vm(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.562 putDirect( exec->vm(), exec->propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum);63 m_errorStructure.set( exec->vm(), this, ErrorInstance::createStructure(exec->vm(), globalObject, prototype));61 putDirect(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 62 putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | ReadOnly | DontEnum); 63 m_errorStructure.set(vm, this, ErrorInstance::createStructure(vm, globalObject, prototype)); 64 64 ASSERT(m_errorStructure); 65 65 ASSERT(m_errorStructure->isObject()); -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp
r156498 r156620 29 29 namespace JSC { 30 30 31 NativeErrorPrototype::NativeErrorPrototype( ExecState* exec, Structure* structure)32 : ErrorPrototype( exec, structure)31 NativeErrorPrototype::NativeErrorPrototype(VM& vm, Structure* structure) 32 : ErrorPrototype(vm, structure) 33 33 { 34 34 } -
trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h
r156498 r156620 29 29 class NativeErrorPrototype : public ErrorPrototype { 30 30 private: 31 NativeErrorPrototype( ExecState*, Structure*);31 NativeErrorPrototype(VM&, Structure*); 32 32 33 33 public: 34 34 typedef ErrorPrototype Base; 35 35 36 static NativeErrorPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& name, NativeErrorConstructor* constructor)36 static NativeErrorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, const String& name, NativeErrorConstructor* constructor) 37 37 { 38 VM& vm = exec->vm(); 39 NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(vm.heap)) NativeErrorPrototype(exec, structure); 38 NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(vm.heap)) NativeErrorPrototype(vm, structure); 40 39 prototype->finishCreation(vm, globalObject, name, constructor); 41 40 return prototype; -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp
r156498 r156620 71 71 STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NumberPrototype); 72 72 73 NumberPrototype::NumberPrototype( ExecState* exec, Structure* structure)74 : NumberObject( exec->vm(), structure)73 NumberPrototype::NumberPrototype(VM& vm, Structure* structure) 74 : NumberObject(vm, structure) 75 75 { 76 76 } -
trunk/Source/JavaScriptCore/runtime/NumberPrototype.h
r156498 r156620 30 30 typedef NumberObject Base; 31 31 32 static NumberPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)32 static NumberPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 33 33 { 34 VM& vm = exec->vm(); 35 NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(vm.heap)) NumberPrototype(exec, structure); 34 NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(vm.heap)) NumberPrototype(vm, structure); 36 35 prototype->finishCreation(vm, globalObject); 37 36 return prototype; … … 50 49 51 50 private: 52 NumberPrototype( ExecState*, Structure*);51 NumberPrototype(VM&, Structure*); 53 52 static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); 54 53 }; -
trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp
r156602 r156620 48 48 static EncodedJSValue JSC_HOST_CALL setProtoFuncSize(ExecState*); 49 49 50 void SetPrototype::finishCreation( ExecState* exec, JSGlobalObject* globalObject)50 void SetPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) 51 51 { 52 VM& vm = exec->vm();53 54 52 Base::finishCreation(vm); 55 53 ASSERT(inherits(info())); -
trunk/Source/JavaScriptCore/runtime/SetPrototype.h
r154916 r156620 35 35 typedef JSNonFinalObject Base; 36 36 37 static SetPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)37 static SetPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 SetPrototype* prototype = new (NotNull, allocateCell<SetPrototype>( *exec->heap())) SetPrototype(exec, structure);40 prototype->finishCreation( exec, globalObject);39 SetPrototype* prototype = new (NotNull, allocateCell<SetPrototype>(vm.heap)) SetPrototype(vm, structure); 40 prototype->finishCreation(vm, globalObject); 41 41 return prototype; 42 42 } … … 50 50 51 51 private: 52 SetPrototype( ExecState* exec, Structure* structure)53 : Base( exec->vm(), structure)52 SetPrototype(VM& vm, Structure* structure) 53 : Base(vm, structure) 54 54 { 55 55 } 56 void finishCreation( ExecState*, JSGlobalObject*);56 void finishCreation(VM&, JSGlobalObject*); 57 57 }; 58 58 -
trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp
r156240 r156620 86 86 87 87 // ECMA 15.5.4 88 StringPrototype::StringPrototype(ExecState* exec, Structure* structure) 89 : StringObject(exec->vm(), structure) 90 { 91 } 92 93 void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSString* nameAndMessage) 94 { 95 VM& vm = exec->vm(); 96 88 StringPrototype::StringPrototype(VM& vm, Structure* structure) 89 : StringObject(vm, structure) 90 { 91 } 92 93 void StringPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject, JSString* nameAndMessage) 94 { 97 95 Base::finishCreation(vm, nameAndMessage); 98 96 ASSERT(inherits(info())); … … 135 133 136 134 // The constructor will be added later, after StringConstructor has been built 137 putDirectWithoutTransition( exec->vm(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);138 } 139 140 StringPrototype* StringPrototype::create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)141 { 142 JSString* empty = jsEmptyString( exec);143 StringPrototype* prototype = new (NotNull, allocateCell<StringPrototype>( *exec->heap())) StringPrototype(exec, structure);144 prototype->finishCreation( exec, globalObject, empty);135 putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontDelete | ReadOnly | DontEnum); 136 } 137 138 StringPrototype* StringPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 139 { 140 JSString* empty = jsEmptyString(&vm); 141 StringPrototype* prototype = new (NotNull, allocateCell<StringPrototype>(vm.heap)) StringPrototype(vm, structure); 142 prototype->finishCreation(vm, globalObject, empty); 145 143 return prototype; 146 144 } -
trunk/Source/JavaScriptCore/runtime/StringPrototype.h
r154038 r156620 30 30 class StringPrototype : public StringObject { 31 31 private: 32 StringPrototype( ExecState*, Structure*);32 StringPrototype(VM&, Structure*); 33 33 34 34 public: 35 35 typedef StringObject Base; 36 36 37 static StringPrototype* create( ExecState*, JSGlobalObject*, Structure*);37 static StringPrototype* create(VM&, JSGlobalObject*, Structure*); 38 38 39 39 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) … … 45 45 46 46 protected: 47 void finishCreation( ExecState*, JSGlobalObject*, JSString*);47 void finishCreation(VM&, JSGlobalObject*, JSString*); 48 48 static const unsigned StructureFlags = StringObject::StructureFlags; 49 49 -
trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp
r155558 r156620 41 41 static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapSet(ExecState*); 42 42 43 void WeakMapPrototype::finishCreation( ExecState* exec, JSGlobalObject* globalObject)43 void WeakMapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) 44 44 { 45 VM& vm = exec->vm();46 47 45 Base::finishCreation(vm); 48 46 ASSERT(inherits(info())); 49 47 vm.prototypeMap.addPrototype(this); 50 48 51 JSC_NATIVE_FUNCTION( exec->propertyNames().clear, protoFuncWeakMapClear, DontEnum, 0);52 JSC_NATIVE_FUNCTION( exec->propertyNames().deleteKeyword, protoFuncWeakMapDelete, DontEnum, 1);53 JSC_NATIVE_FUNCTION( exec->propertyNames().get, protoFuncWeakMapGet, DontEnum, 1);54 JSC_NATIVE_FUNCTION( exec->propertyNames().has, protoFuncWeakMapHas, DontEnum, 1);55 JSC_NATIVE_FUNCTION( exec->propertyNames().set, protoFuncWeakMapSet, DontEnum, 2);49 JSC_NATIVE_FUNCTION(vm.propertyNames->clear, protoFuncWeakMapClear, DontEnum, 0); 50 JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, protoFuncWeakMapDelete, DontEnum, 1); 51 JSC_NATIVE_FUNCTION(vm.propertyNames->get, protoFuncWeakMapGet, DontEnum, 1); 52 JSC_NATIVE_FUNCTION(vm.propertyNames->has, protoFuncWeakMapHas, DontEnum, 1); 53 JSC_NATIVE_FUNCTION(vm.propertyNames->set, protoFuncWeakMapSet, DontEnum, 2); 56 54 } 57 55 -
trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.h
r155473 r156620 35 35 typedef JSNonFinalObject Base; 36 36 37 static WeakMapPrototype* create( ExecState* exec, JSGlobalObject* globalObject, Structure* structure)37 static WeakMapPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure) 38 38 { 39 WeakMapPrototype* prototype = new (NotNull, allocateCell<WeakMapPrototype>( *exec->heap())) WeakMapPrototype(exec, structure);40 prototype->finishCreation( exec, globalObject);39 WeakMapPrototype* prototype = new (NotNull, allocateCell<WeakMapPrototype>(vm.heap)) WeakMapPrototype(vm, structure); 40 prototype->finishCreation(vm, globalObject); 41 41 return prototype; 42 42 } … … 50 50 51 51 private: 52 WeakMapPrototype( ExecState* exec, Structure* structure)53 : Base( exec->vm(), structure)52 WeakMapPrototype(VM& vm, Structure* structure) 53 : Base(vm, structure) 54 54 { 55 55 } 56 void finishCreation( ExecState*, JSGlobalObject*);56 void finishCreation(VM&, JSGlobalObject*); 57 57 }; 58 58 -
trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp
r156602 r156620 122 122 if (!std::isfinite(value)) 123 123 return jsNull(); 124 return DateInstance::create(exec , exec->lexicalGlobalObject()->dateStructure(), value);124 return DateInstance::create(exec->vm(), exec->lexicalGlobalObject()->dateStructure(), value); 125 125 } 126 126 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r156550 r156620 1517 1517 if (!read(d)) 1518 1518 return JSValue(); 1519 return DateInstance::create(m_exec , m_globalObject->dateStructure(), d);1519 return DateInstance::create(m_exec->vm(), m_globalObject->dateStructure(), d); 1520 1520 } 1521 1521 case FileTag: {
Note: See TracChangeset
for help on using the changeset viewer.