Commit 0c4a2dbd authored by akling@apple.com's avatar akling@apple.com

Pass VM instead of ExecState to ObjectPrototype constructor.

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

Reviewed by Geoffrey Garen.

The ObjectPrototype constructor was only using the ExecState to get
to the VM.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3828a863
2013-09-30 Andreas Kling <akling@apple.com>
Pass VM instead of ExecState to ObjectPrototype constructor.
<https://webkit.org/b/122116>
Reviewed by Geoffrey Garen.
The ObjectPrototype constructor was only using the ExecState to get
to the VM.
2013-09-30 Andreas Kling <akling@apple.com>
Pass VM instead of JSGlobalObject to MathObject constructor.
......@@ -238,7 +238,7 @@ void JSGlobalObject::reset(JSValue prototype)
m_functionPrototype->addFunctionProperties(exec, this, &callFunction, &applyFunction);
m_callFunction.set(vm, this, callFunction);
m_applyFunction.set(vm, this, applyFunction);
m_objectPrototype.set(vm, this, ObjectPrototype::create(exec, this, ObjectPrototype::createStructure(vm, this, jsNull())));
m_objectPrototype.set(vm, this, ObjectPrototype::create(vm, this, ObjectPrototype::createStructure(vm, this, jsNull())));
GetterSetter* protoAccessor = GetterSetter::create(vm);
protoAccessor->setGetter(vm, JSFunction::create(vm, this, 0, String(), globalFuncProtoGetter));
protoAccessor->setSetter(vm, JSFunction::create(vm, this, 0, String(), globalFuncProtoSetter));
......
......@@ -45,15 +45,13 @@ STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(ObjectPrototype);
const ClassInfo ObjectPrototype::s_info = { "Object", &JSNonFinalObject::s_info, 0, 0, CREATE_METHOD_TABLE(ObjectPrototype) };
ObjectPrototype::ObjectPrototype(ExecState* exec, Structure* stucture)
: JSNonFinalObject(exec->vm(), stucture)
ObjectPrototype::ObjectPrototype(VM& vm, Structure* stucture)
: JSNonFinalObject(vm, stucture)
{
}
void ObjectPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
void ObjectPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
{
VM& vm = exec->vm();
Base::finishCreation(vm);
ASSERT(inherits(info()));
vm.prototypeMap.addPrototype(this);
......@@ -70,10 +68,10 @@ void ObjectPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObje
JSC_NATIVE_FUNCTION(vm.propertyNames->__lookupSetter__, objectProtoFuncLookupSetter, DontEnum, 1);
}
ObjectPrototype* ObjectPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
ObjectPrototype* ObjectPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
{
ObjectPrototype* prototype = new (NotNull, allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
ObjectPrototype* prototype = new (NotNull, allocateCell<ObjectPrototype>(vm.heap)) ObjectPrototype(vm, structure);
prototype->finishCreation(vm, globalObject);
return prototype;
}
......
......@@ -29,7 +29,7 @@ namespace JSC {
public:
typedef JSNonFinalObject Base;
static ObjectPrototype* create(ExecState*, JSGlobalObject*, Structure*);
static ObjectPrototype* create(VM&, JSGlobalObject*, Structure*);
DECLARE_INFO;
......@@ -39,10 +39,10 @@ namespace JSC {
}
protected:
void finishCreation(ExecState*, JSGlobalObject*);
void finishCreation(VM&, JSGlobalObject*);
private:
ObjectPrototype(ExecState*, Structure*);
ObjectPrototype(VM&, Structure*);
};
JS_EXPORT_PRIVATE EncodedJSValue JSC_HOST_CALL objectProtoFuncToString(ExecState*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment