Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (157613 => 157614)
--- trunk/Source/_javascript_Core/ChangeLog 2013-10-17 23:33:53 UTC (rev 157613)
+++ trunk/Source/_javascript_Core/ChangeLog 2013-10-17 23:35:47 UTC (rev 157614)
@@ -1,3 +1,19 @@
+2013-10-17 Andreas Kling <[email protected]>
+
+ Pass VM instead of JSGlobalObject to JSONObject constructor.
+ <https://webkit.org/b/122999>
+
+ JSONObject was only use the JSGlobalObject to grab at the VM.
+ Dodge a few loads by passing the VM directly instead.
+
+ Reviewed by Geoffrey Garen.
+
+ * runtime/JSONObject.cpp:
+ (JSC::JSONObject::JSONObject):
+ (JSC::JSONObject::finishCreation):
+ * runtime/JSONObject.h:
+ (JSC::JSONObject::create):
+
2013-10-17 Geoffrey Garen <[email protected]>
Removed the JITStackFrame struct
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (157613 => 157614)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-10-17 23:33:53 UTC (rev 157613)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-10-17 23:35:47 UTC (rev 157614)
@@ -395,7 +395,7 @@
m_evalFunction.set(vm, this, JSFunction::create(vm, this, 1, vm.propertyNames->eval.string(), globalFuncEval));
putDirectWithoutTransition(vm, vm.propertyNames->eval, m_evalFunction.get(), DontEnum);
- putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(exec, this, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
+ putDirectWithoutTransition(vm, vm.propertyNames->JSON, JSONObject::create(vm, JSONObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
putDirectWithoutTransition(vm, vm.propertyNames->Math, MathObject::create(vm, this, MathObject::createStructure(vm, this, m_objectPrototype.get())), DontEnum);
FixedArray<InternalFunction*, NUMBER_OF_TYPED_ARRAY_TYPES> typedArrayConstructors;
Modified: trunk/Source/_javascript_Core/runtime/JSONObject.cpp (157613 => 157614)
--- trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2013-10-17 23:33:53 UTC (rev 157613)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2013-10-17 23:35:47 UTC (rev 157614)
@@ -54,14 +54,14 @@
namespace JSC {
-JSONObject::JSONObject(JSGlobalObject* globalObject, Structure* structure)
- : JSNonFinalObject(globalObject->vm(), structure)
+JSONObject::JSONObject(VM& vm, Structure* structure)
+ : JSNonFinalObject(vm, structure)
{
}
-void JSONObject::finishCreation(JSGlobalObject* globalObject)
+void JSONObject::finishCreation(VM& vm)
{
- Base::finishCreation(globalObject->vm());
+ Base::finishCreation(vm);
ASSERT(inherits(info()));
}
Modified: trunk/Source/_javascript_Core/runtime/JSONObject.h (157613 => 157614)
--- trunk/Source/_javascript_Core/runtime/JSONObject.h 2013-10-17 23:33:53 UTC (rev 157613)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.h 2013-10-17 23:35:47 UTC (rev 157614)
@@ -36,10 +36,10 @@
public:
typedef JSNonFinalObject Base;
- static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
+ static JSONObject* create(VM& vm, Structure* structure)
{
- JSONObject* object = new (NotNull, allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
- object->finishCreation(globalObject);
+ JSONObject* object = new (NotNull, allocateCell<JSONObject>(vm.heap)) JSONObject(vm, structure);
+ object->finishCreation(vm);
return object;
}
@@ -51,11 +51,11 @@
DECLARE_INFO;
protected:
- void finishCreation(JSGlobalObject*);
+ void finishCreation(VM&);
static const unsigned StructureFlags = OverridesGetOwnPropertySlot | JSObject::StructureFlags;
private:
- JSONObject(JSGlobalObject*, Structure*);
+ JSONObject(VM&, Structure*);
static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
};