Commit b34659a8 authored by akling@apple.com's avatar akling@apple.com

Pass VM instead of ExecState to simple builtin constructors.

<https://webkit.org/b/122077>

Reviewed by Sam Weinig.

None of the simple builtins need the ExecState for anything during
their construction, so reduce the amount of loads by just passing
the VM around instead.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ffe769be
2013-09-29 Andreas Kling <akling@apple.com>
Pass VM instead of ExecState to simple builtin constructors.
<https://webkit.org/b/122077>
Reviewed by Sam Weinig.
None of the simple builtins need the ExecState for anything during
their construction, so reduce the amount of loads by just passing
the VM around instead.
2013-09-29 Nadav Rotem <nrotem@apple.com> 2013-09-29 Nadav Rotem <nrotem@apple.com>
Refactor code for finding x86 scratch register. Refactor code for finding x86 scratch register.
...@@ -50,8 +50,8 @@ const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info, ...@@ -50,8 +50,8 @@ const ClassInfo BooleanPrototype::s_info = { "Boolean", &BooleanObject::s_info,
STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(BooleanPrototype); STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(BooleanPrototype);
BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure) BooleanPrototype::BooleanPrototype(VM& vm, Structure* structure)
: BooleanObject(exec->vm(), structure) : BooleanObject(vm, structure)
{ {
} }
......
...@@ -29,10 +29,9 @@ class BooleanPrototype : public BooleanObject { ...@@ -29,10 +29,9 @@ class BooleanPrototype : public BooleanObject {
public: public:
typedef BooleanObject Base; typedef BooleanObject Base;
static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) static BooleanPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{ {
VM& vm = exec->vm(); BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(vm, structure);
BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(exec, structure);
prototype->finishCreation(vm, globalObject); prototype->finishCreation(vm, globalObject);
return prototype; return prototype;
} }
...@@ -49,7 +48,7 @@ protected: ...@@ -49,7 +48,7 @@ protected:
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags; static const unsigned StructureFlags = OverridesGetOwnPropertySlot | BooleanObject::StructureFlags;
private: private:
BooleanPrototype(ExecState*, Structure*); BooleanPrototype(VM&, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&); static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
}; };
......
...@@ -94,6 +94,7 @@ bool DateConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, Prop ...@@ -94,6 +94,7 @@ bool DateConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, Prop
// ECMA 15.9.3 // ECMA 15.9.3
JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args) JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args)
{ {
VM& vm = exec->vm();
int numArgs = args.size(); int numArgs = args.size();
double value; double value;
...@@ -106,7 +107,7 @@ JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const Arg ...@@ -106,7 +107,7 @@ JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const Arg
else { else {
JSValue primitive = args.at(0).toPrimitive(exec); JSValue primitive = args.at(0).toPrimitive(exec);
if (primitive.isString()) if (primitive.isString())
value = parseDate(exec->vm(), primitive.getString(exec)); value = parseDate(vm, primitive.getString(exec));
else else
value = primitive.toNumber(exec); value = primitive.toNumber(exec);
} }
...@@ -139,11 +140,11 @@ JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const Arg ...@@ -139,11 +140,11 @@ JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const Arg
t.setSecond(JSC::toInt32(doubleArguments[5])); t.setSecond(JSC::toInt32(doubleArguments[5]));
t.setIsDST(-1); t.setIsDST(-1);
double ms = (numArgs >= 7) ? doubleArguments[6] : 0; double ms = (numArgs >= 7) ? doubleArguments[6] : 0;
value = gregorianDateTimeToMS(exec->vm(), t, ms, false); value = gregorianDateTimeToMS(vm, t, ms, false);
} }
} }
return DateInstance::create(exec, globalObject->dateStructure(), value); return DateInstance::create(vm, globalObject->dateStructure(), value);
} }
static EncodedJSValue JSC_HOST_CALL constructWithDateConstructor(ExecState* exec) static EncodedJSValue JSC_HOST_CALL constructWithDateConstructor(ExecState* exec)
......
...@@ -34,8 +34,8 @@ namespace JSC { ...@@ -34,8 +34,8 @@ namespace JSC {
const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)}; const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)};
DateInstance::DateInstance(ExecState* exec, Structure* structure) DateInstance::DateInstance(VM& vm, Structure* structure)
: JSWrapperObject(exec->vm(), structure) : JSWrapperObject(vm, structure)
{ {
} }
......
...@@ -27,7 +27,7 @@ namespace JSC { ...@@ -27,7 +27,7 @@ namespace JSC {
class DateInstance : public JSWrapperObject { class DateInstance : public JSWrapperObject {
protected: protected:
JS_EXPORT_PRIVATE DateInstance(ExecState*, Structure*); JS_EXPORT_PRIVATE DateInstance(VM&, Structure*);
void finishCreation(VM&); void finishCreation(VM&);
JS_EXPORT_PRIVATE void finishCreation(VM&, double); JS_EXPORT_PRIVATE void finishCreation(VM&, double);
...@@ -36,17 +36,17 @@ namespace JSC { ...@@ -36,17 +36,17 @@ namespace JSC {
public: public:
typedef JSWrapperObject Base; typedef JSWrapperObject Base;
static DateInstance* create(ExecState* exec, Structure* structure, double date) static DateInstance* create(VM& vm, Structure* structure, double date)
{ {
DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure); DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure);
instance->finishCreation(exec->vm(), date); instance->finishCreation(vm, date);
return instance; return instance;
} }
static DateInstance* create(ExecState* exec, Structure* structure) static DateInstance* create(VM& vm, Structure* structure)
{ {
DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure); DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure);
instance->finishCreation(exec->vm()); instance->finishCreation(vm);
return instance; return instance;
} }
......
...@@ -501,8 +501,8 @@ const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecS ...@@ -501,8 +501,8 @@ const ClassInfo DatePrototype::s_info = {"Date", &DateInstance::s_info, 0, ExecS
// ECMA 15.9.4 // ECMA 15.9.4
DatePrototype::DatePrototype(ExecState* exec, Structure* structure) DatePrototype::DatePrototype(VM& vm, Structure* structure)
: DateInstance(exec, structure) : DateInstance(vm, structure)
{ {
} }
......
...@@ -29,15 +29,14 @@ namespace JSC { ...@@ -29,15 +29,14 @@ namespace JSC {
class DatePrototype : public DateInstance { class DatePrototype : public DateInstance {
private: private:
DatePrototype(ExecState*, Structure*); DatePrototype(VM&, Structure*);
public: public:
typedef DateInstance Base; typedef DateInstance Base;
static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) static DatePrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{ {
VM& vm = exec->vm(); DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(vm, structure);
DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(exec, structure);
prototype->finishCreation(vm, globalObject); prototype->finishCreation(vm, globalObject);
return prototype; return prototype;
} }
......
...@@ -49,8 +49,8 @@ const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, E ...@@ -49,8 +49,8 @@ const ClassInfo ErrorPrototype::s_info = { "Error", &ErrorInstance::s_info, 0, E
@end @end
*/ */
ErrorPrototype::ErrorPrototype(ExecState* exec, Structure* structure) ErrorPrototype::ErrorPrototype(VM& vm, Structure* structure)
: ErrorInstance(exec->vm(), structure) : ErrorInstance(vm, structure)
{ {
} }
......
...@@ -31,10 +31,9 @@ namespace JSC { ...@@ -31,10 +31,9 @@ namespace JSC {
public: public:
typedef ErrorInstance Base; typedef ErrorInstance Base;
static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) static ErrorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{ {
VM& vm = exec->vm(); ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(vm, structure);
ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(exec, structure);
prototype->finishCreation(vm, globalObject); prototype->finishCreation(vm, globalObject);
return prototype; return prototype;
} }
...@@ -47,7 +46,7 @@ namespace JSC { ...@@ -47,7 +46,7 @@ namespace JSC {
} }
protected: protected:
ErrorPrototype(ExecState*, Structure*); ErrorPrototype(VM&, Structure*);
void finishCreation(VM&, JSGlobalObject*); void finishCreation(VM&, JSGlobalObject*);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ErrorInstance::StructureFlags; static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ErrorInstance::StructureFlags;
......
...@@ -78,23 +78,19 @@ JSArrayBufferPrototype::JSArrayBufferPrototype(VM& vm, Structure* structure) ...@@ -78,23 +78,19 @@ JSArrayBufferPrototype::JSArrayBufferPrototype(VM& vm, Structure* structure)
{ {
} }
void JSArrayBufferPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) void JSArrayBufferPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
{ {
VM& vm = exec->vm();
Base::finishCreation(vm); Base::finishCreation(vm);
JSC_NATIVE_FUNCTION(vm.propertyNames->slice, arrayBufferProtoFuncSlice, DontEnum, 2); JSC_NATIVE_FUNCTION(vm.propertyNames->slice, arrayBufferProtoFuncSlice, DontEnum, 2);
} }
JSArrayBufferPrototype* JSArrayBufferPrototype::create( JSArrayBufferPrototype* JSArrayBufferPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{ {
VM& vm = exec->vm();
JSArrayBufferPrototype* prototype = JSArrayBufferPrototype* prototype =
new (NotNull, allocateCell<JSArrayBufferPrototype>(vm.heap)) new (NotNull, allocateCell<JSArrayBufferPrototype>(vm.heap))
JSArrayBufferPrototype(vm, structure); JSArrayBufferPrototype(vm, structure);
prototype->finishCreation(exec, globalObject); prototype->finishCreation(vm, globalObject);
return prototype; return prototype;
} }
......
...@@ -36,10 +36,10 @@ public: ...@@ -36,10 +36,10 @@ public:
protected: protected:
JSArrayBufferPrototype(VM&, Structure*); JSArrayBufferPrototype(VM&, Structure*);
void finishCreation(ExecState*, JSGlobalObject*); void finishCreation(VM&, JSGlobalObject*);
public: public:
static JSArrayBufferPrototype* create(ExecState*, JSGlobalObject*, Structure*); static JSArrayBufferPrototype* create(VM&, JSGlobalObject*, Structure*);
DECLARE_INFO; DECLARE_INFO;
......
...@@ -312,7 +312,7 @@ void JSGlobalObject::reset(JSValue prototype) ...@@ -312,7 +312,7 @@ void JSGlobalObject::reset(JSValue prototype)
#endif // ENABLE(PROMISES) #endif // ENABLE(PROMISES)
#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ #define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(exec, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \ m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \
m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get())); m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get()));
FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE) FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE)
...@@ -344,12 +344,12 @@ void JSGlobalObject::reset(JSValue prototype) ...@@ -344,12 +344,12 @@ void JSGlobalObject::reset(JSValue prototype)
Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(vm, this, m_errorPrototype.get()); Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(vm, this, m_errorPrototype.get());
Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(vm, this, m_functionPrototype.get()); Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(vm, this, m_functionPrototype.get());
m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError"))); m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError")));
m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError"))); m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError")));
m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError"))); m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError")));
m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError"))); m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError")));
m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError"))); m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError")));
m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError"))); m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError")));
m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum); m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum);
m_functionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, functionConstructor, DontEnum); m_functionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, functionConstructor, DontEnum);
......
...@@ -2201,12 +2201,11 @@ bool JSObject::putDirectIndexBeyondVectorLength(ExecState* exec, unsigned i, JSV ...@@ -2201,12 +2201,11 @@ bool JSObject::putDirectIndexBeyondVectorLength(ExecState* exec, unsigned i, JSV
} }
} }
void JSObject::putDirectNativeFunction(ExecState* exec, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes) void JSObject::putDirectNativeFunction(VM& vm, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)
{ {
StringImpl* name = propertyName.publicName(); StringImpl* name = propertyName.publicName();
ASSERT(name); ASSERT(name);
VM& vm = exec->vm();
JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic); JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic);
putDirect(vm, propertyName, function, attributes); putDirect(vm, propertyName, function, attributes);
} }
......
...@@ -577,7 +577,7 @@ public: ...@@ -577,7 +577,7 @@ public:
void putDirect(VM& vm, PropertyOffset offset, JSValue value) { locationForOffset(offset)->set(vm, this, value); } void putDirect(VM& vm, PropertyOffset offset, JSValue value) { locationForOffset(offset)->set(vm, this, value); }
void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); } void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); }
void putDirectNativeFunction(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes); void putDirectNativeFunction(VM&, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
void putDirectNativeFunctionWithoutTransition(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes); void putDirectNativeFunctionWithoutTransition(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow); JS_EXPORT_PRIVATE static bool defineOwnProperty(JSObject*, ExecState*, PropertyName, const PropertyDescriptor&, bool shouldThrow);
...@@ -1498,12 +1498,12 @@ inline int offsetRelativeToBase(PropertyOffset offset) ...@@ -1498,12 +1498,12 @@ inline int offsetRelativeToBase(PropertyOffset offset)
COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment); COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment);
ALWAYS_INLINE Identifier makeIdentifier(ExecState* exec, const char* name) ALWAYS_INLINE Identifier makeIdentifier(VM& vm, const char* name)
{ {
return Identifier(exec, name); return Identifier(&vm, name);
} }
ALWAYS_INLINE Identifier makeIdentifier(ExecState*, const Identifier& name) ALWAYS_INLINE Identifier makeIdentifier(VM&, const Identifier& name)
{ {
return name; return name;
} }
...@@ -1514,7 +1514,7 @@ ALWAYS_INLINE Identifier makeIdentifier(ExecState*, const Identifier& name) ...@@ -1514,7 +1514,7 @@ ALWAYS_INLINE Identifier makeIdentifier(ExecState*, const Identifier& name)
// have the expected meanings. // have the expected meanings.
#define JSC_NATIVE_INTRINSIC_FUNCTION(jsName, cppName, attributes, length, intrinsic) \ #define JSC_NATIVE_INTRINSIC_FUNCTION(jsName, cppName, attributes, length, intrinsic) \
putDirectNativeFunction(\ putDirectNativeFunction(\
exec, globalObject, makeIdentifier(exec, (jsName)), (length), cppName, \ vm, globalObject, makeIdentifier(vm, (jsName)), (length), cppName, \
(intrinsic), (attributes)) (intrinsic), (attributes))
// As above, but this assumes that the function you're defining doesn't have an // As above, but this assumes that the function you're defining doesn't have an
......
...@@ -69,8 +69,9 @@ bool setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* ...@@ -69,8 +69,9 @@ bool setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject*
{ {
ASSERT(thisObj->globalObject()); ASSERT(thisObj->globalObject());
ASSERT(entry->attributes() & Function); ASSERT(entry->attributes() & Function);
VM& vm = exec->vm();
unsigned attributes; unsigned attributes;
PropertyOffset offset = thisObj->getDirectOffset(exec->vm(), propertyName, attributes); PropertyOffset offset = thisObj->getDirectOffset(vm, propertyName, attributes);
if (!isValidOffset(offset)) { if (!isValidOffset(offset)) {
// If a property is ever deleted from an object with a static table, then we reify // If a property is ever deleted from an object with a static table, then we reify
...@@ -79,9 +80,9 @@ bool setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* ...@@ -79,9 +80,9 @@ bool setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject*
return false; return false;
thisObj->putDirectNativeFunction( thisObj->putDirectNativeFunction(
exec, thisObj->globalObject(), propertyName, entry->functionLength(), vm, thisObj->globalObject(), propertyName, entry->functionLength(),
entry->function(), entry->intrinsic(), entry->attributes()); entry->function(), entry->intrinsic(), entry->attributes());
offset = thisObj->getDirectOffset(exec->vm(), propertyName, attributes); offset = thisObj->getDirectOffset(vm, propertyName, attributes);
ASSERT(isValidOffset(offset)); ASSERT(isValidOffset(offset));
} }
......
...@@ -48,10 +48,8 @@ static EncodedJSValue JSC_HOST_CALL mapProtoFuncSet(ExecState*); ...@@ -48,10 +48,8 @@ static EncodedJSValue JSC_HOST_CALL mapProtoFuncSet(ExecState*);
static EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(ExecState*); static EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(ExecState*);
void MapPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject) void MapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
{ {
VM& vm = exec->vm();
Base::finishCreation(vm); Base::finishCreation(vm);
ASSERT(inherits(info())); ASSERT(inherits(info()));
vm.prototypeMap.addPrototype(this); vm.prototypeMap.addPrototype(this);
......
...@@ -34,10 +34,10 @@ class MapPrototype : public JSNonFinalObject { ...@@ -34,10 +34,10 @@ class MapPrototype : public JSNonFinalObject {
public: public:
typedef JSNonFinalObject Base; typedef JSNonFinalObject Base;
static MapPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) static MapPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{ {
MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>(*exec->heap())) MapPrototype(exec, structure); MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>(vm.heap)) MapPrototype(vm, structure);
prototype->finishCreation(exec, globalObject); prototype->finishCreation(vm, globalObject);
return prototype; return prototype;
} }
...@@ -49,11 +49,11 @@ public: ...@@ -49,11 +49,11 @@ public:
} }
private: private:
MapPrototype(ExecState* exec, Structure* structure) MapPrototype(VM& vm, Structure* structure)
: Base(exec->vm(), structure) : Base(vm, structure)
{ {
} }
void finishCreation(ExecState*, JSGlobalObject*); void finishCreation(VM&, JSGlobalObject*);
}; };
} }
......
...@@ -34,10 +34,10 @@ namespace JSC { ...@@ -34,10 +34,10 @@ namespace JSC {
public: public:
typedef InternalFunction Base; typedef InternalFunction Base;
static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name) static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)
{ {
NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure); NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(globalObject, structure);
constructor->finishCreation(exec, globalObject, prototypeStructure, name); constructor->finishCreation(vm, globalObject, prototypeStructure, name);
return constructor; return constructor;
} }
...@@ -51,16 +51,16 @@ namespace JSC { ...@@ -51,16 +51,16 @@ namespace JSC {
Structure* errorStructure() { return m_errorStructure.get(); } Structure* errorStructure() { return m_errorStructure.get(); }
protected: protected:
void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name) void finishCreation(VM& vm, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name)
{ {
Base::finishCreation(exec->vm(), name); Base::finishCreation(vm, name);
ASSERT(inherits(info())); ASSERT(inherits(info()));
NativeErrorPrototype* prototype = NativeErrorPrototype::create(exec, globalObject, prototypeStructure, name, this); NativeErrorPrototype* prototype = NativeErrorPrototype::create(vm, globalObject, prototypeStructure, name, this);
putDirect(exec->vm(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5 putDirect(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
putDirect(exec->vm(), exec->propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum); putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | ReadOnly | DontEnum);
m_errorStructure.set(exec->vm(), this, ErrorInstance::createStructure(exec->vm(), globalObject, prototype)); m_errorStructure.set(vm, this, ErrorInstance::createStructure(vm, globalObject, prototype));
ASSERT(m_errorStructure); ASSERT(m_errorStructure);
ASSERT(m_errorStructure->isObject()); ASSERT(m_errorStructure->isObject());
} }
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
namespace JSC { namespace JSC {
NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure) NativeErrorPrototype::NativeErrorPrototype(VM& vm, Structure* structure)
: ErrorPrototype(exec, structure)