<https://webkit.org/b/129554>
Tweak some places that jump through unnecessary hoops to get the VM.
There are many more like this.
Reviewed by Sam Weinig.
* runtime/JSObject.cpp:
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectIndexBeyondVectorLength):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164925
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-01 Andreas Kling <akling@apple.com>
+
+ Avoid going through ExecState for VM when we already have it (in some places.)
+ <https://webkit.org/b/129554>
+
+ Tweak some places that jump through unnecessary hoops to get the VM.
+ There are many more like this.
+
+ Reviewed by Sam Weinig.
+
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::putByIndexBeyondVectorLength):
+ (JSC::JSObject::putDirectIndexBeyondVectorLength):
+ * runtime/ObjectPrototype.cpp:
+ (JSC::objectProtoFuncToString):
+
2014-02-28 Filip Pizlo <fpizlo@apple.com>
FTL should support PhantomArguments
exec, i, value, shouldThrow, createArrayStorage(vm, 0, 0));
break;
}
- if (structure(exec->vm())->needsSlowPutIndexing()) {
+ if (structure(vm)->needsSlowPutIndexing()) {
ArrayStorage* storage = createArrayStorage(vm, i + 1, getNewVectorLength(0, 0, i + 1));
storage->m_vector[i].set(vm, this, value);
storage->m_numValuesInVector++;
return putDirectIndexBeyondVectorLengthWithArrayStorage(
exec, i, value, attributes, mode, createArrayStorage(vm, 0, 0));
}
- if (structure(exec->vm())->needsSlowPutIndexing()) {
+ if (structure(vm)->needsSlowPutIndexing()) {
ArrayStorage* storage = createArrayStorage(vm, i + 1, getNewVectorLength(0, 0, i + 1));
storage->m_vector[i].set(vm, this, value);
storage->m_numValuesInVector++;
EncodedJSValue JSC_HOST_CALL objectProtoFuncToString(ExecState* exec)
{
+ VM& vm = exec->vm();
JSValue thisValue = exec->hostThisValue().toThis(exec, StrictMode);
if (thisValue.isUndefinedOrNull())
- return JSValue::encode(jsNontrivialString(exec, String(thisValue.isUndefined() ? ASCIILiteral("[object Undefined]") : ASCIILiteral("[object Null]"))));
+ return JSValue::encode(jsNontrivialString(&vm, String(thisValue.isUndefined() ? ASCIILiteral("[object Undefined]") : ASCIILiteral("[object Null]"))));
JSObject* thisObject = thisValue.toObject(exec);
- JSString* result = thisObject->structure(exec->vm())->objectToStringValue();
+ JSString* result = thisObject->structure(vm)->objectToStringValue();
if (!result) {
RefPtr<StringImpl> newString = WTF::tryMakeString("[object ", thisObject->methodTable(exec->vm())->className(thisObject), "]");
if (!newString)
return JSValue::encode(throwOutOfMemoryError(exec));
- result = jsNontrivialString(exec, newString.release());
- thisObject->structure(exec->vm())->setObjectToStringValue(exec->vm(), thisObject, result);
+ result = jsNontrivialString(&vm, newString.release());
+ thisObject->structure(vm)->setObjectToStringValue(vm, thisObject, result);
}
return JSValue::encode(result);
}