Diff
Modified: trunk/Source/_javascript_Core/API/JSObjectRef.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/API/JSObjectRef.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/API/JSObjectRef.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -291,7 +291,7 @@
// Someday we might use proxies for something other than JSGlobalObjects, but today is not that day.
RELEASE_ASSERT_NOT_REACHED();
}
- jsObject->setPrototypeOfInline(exec->vm(), exec, jsValue.isObject() ? jsValue : jsNull());
+ jsObject->setPrototype(exec->vm(), exec, jsValue.isObject() ? jsValue : jsNull());
}
bool JSObjectHasProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName)
Modified: trunk/Source/_javascript_Core/ChangeLog (197483 => 197484)
--- trunk/Source/_javascript_Core/ChangeLog 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-03-03 02:04:49 UTC (rev 197484)
@@ -1,3 +1,60 @@
+2016-03-02 Saam barati <[email protected]>
+
+ clean up JSObject::isExtensibleInline and JSObject::setPrototypeOfInline, and rename setPrototypeOf to setPrototype
+ https://bugs.webkit.org/show_bug.cgi?id=154942
+
+ Reviewed by Benjamin Poulain.
+
+ These don't need to be inlined in the way they are.
+ Doing dynamic dispatch is ok performance wise until
+ we have evidence stating otherwise.
+
+ * API/JSObjectRef.cpp:
+ (JSObjectSetPrototype):
+ (JSObjectHasProperty):
+ * runtime/ClassInfo.h:
+ * runtime/IntlCollatorConstructor.cpp:
+ (JSC::constructIntlCollator):
+ * runtime/IntlDateTimeFormatConstructor.cpp:
+ (JSC::constructIntlDateTimeFormat):
+ * runtime/IntlNumberFormatConstructor.cpp:
+ (JSC::constructIntlNumberFormat):
+ * runtime/JSCell.cpp:
+ (JSC::JSCell::isExtensible):
+ (JSC::JSCell::setPrototype):
+ (JSC::JSCell::setPrototypeOf): Deleted.
+ * runtime/JSCell.h:
+ * runtime/JSGlobalObjectFunctions.cpp:
+ (JSC::globalFuncProtoSetter):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::setPrototypeWithCycleCheck):
+ (JSC::JSObject::setPrototype):
+ (JSC::JSObject::allowsAccessFrom):
+ (JSC::JSObject::isExtensible):
+ (JSC::JSObject::reifyAllStaticProperties):
+ (JSC::JSObject::defineOwnNonIndexProperty):
+ (JSC::JSObject::setPrototypeOf): Deleted.
+ * runtime/JSObject.h:
+ (JSC::JSObject::mayInterceptIndexedAccesses):
+ (JSC::JSObject::indexingShouldBeSparse):
+ (JSC::JSObject::setPrototypeOfInline): Deleted.
+ (JSC::JSObject::isExtensibleInline): Deleted.
+ * runtime/ObjectConstructor.cpp:
+ (JSC::objectConstructorSetPrototypeOf):
+ (JSC::objectConstructorIsSealed):
+ (JSC::objectConstructorIsFrozen):
+ (JSC::objectConstructorIsExtensible):
+ * runtime/ProxyObject.cpp:
+ (JSC::ProxyObject::performInternalMethodGetOwnProperty):
+ (JSC::ProxyObject::performHasProperty):
+ (JSC::ProxyObject::performPreventExtensions):
+ (JSC::ProxyObject::performIsExtensible):
+ * runtime/ReflectObject.cpp:
+ (JSC::reflectObjectIsExtensible):
+ (JSC::reflectObjectSetPrototypeOf):
+ * runtime/StringObject.cpp:
+ (JSC::StringObject::defineOwnProperty):
+
2016-03-02 Konstantin Tokarev <[email protected]>
[cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
Modified: trunk/Source/_javascript_Core/runtime/ClassInfo.h (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/ClassInfo.h 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/ClassInfo.h 2016-03-03 02:04:49 UTC (rev 197484)
@@ -109,8 +109,8 @@
typedef bool (*IsExtensibleFunctionPtr)(JSObject*, ExecState*);
IsExtensibleFunctionPtr isExtensible;
- typedef bool (*SetPrototypeOfFunctionPtr)(JSObject*, ExecState*, JSValue);
- SetPrototypeOfFunctionPtr setPrototypeOf;
+ typedef bool (*SetPrototypeFunctionPtr)(JSObject*, ExecState*, JSValue);
+ SetPrototypeFunctionPtr setPrototype;
typedef void (*DumpToStreamFunctionPtr)(const JSCell*, PrintStream&);
DumpToStreamFunctionPtr dumpToStream;
@@ -165,7 +165,7 @@
&ClassName::getTypedArrayImpl, \
&ClassName::preventExtensions, \
&ClassName::isExtensible, \
- &ClassName::setPrototypeOf, \
+ &ClassName::setPrototype, \
&ClassName::dumpToStream, \
&ClassName::estimatedSize \
}, \
Modified: trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/IntlCollatorConstructor.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -97,7 +97,7 @@
IntlCollator* collator = IntlCollator::create(vm, jsCast<IntlCollatorConstructor*>(state->callee()));
if (collator && !jsDynamicCast<IntlCollatorConstructor*>(newTarget)) {
JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
- asObject(collator)->setPrototypeOfInline(vm, state, proto);
+ asObject(collator)->setPrototype(vm, state, proto);
if (vm.exception())
return JSValue::encode(JSValue());
}
Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormatConstructor.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -96,7 +96,7 @@
IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, jsCast<IntlDateTimeFormatConstructor*>(state->callee()));
if (dateTimeFormat && !jsDynamicCast<IntlDateTimeFormatConstructor*>(newTarget)) {
JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
- asObject(dateTimeFormat)->setPrototypeOfInline(vm, state, proto);
+ asObject(dateTimeFormat)->setPrototype(vm, state, proto);
if (vm.exception())
return JSValue::encode(JSValue());
}
Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormatConstructor.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -96,7 +96,7 @@
IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, jsCast<IntlNumberFormatConstructor*>(state->callee()));
if (numberFormat && !jsDynamicCast<IntlNumberFormatConstructor*>(newTarget)) {
JSValue proto = asObject(newTarget)->getDirect(vm, vm.propertyNames->prototype);
- asObject(numberFormat)->setPrototypeOfInline(vm, state, proto);
+ asObject(numberFormat)->setPrototype(vm, state, proto);
if (vm.exception())
return JSValue::encode(JSValue());
}
Modified: trunk/Source/_javascript_Core/runtime/JSCell.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/JSCell.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/JSCell.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -280,7 +280,7 @@
RELEASE_ASSERT_NOT_REACHED();
}
-bool JSCell::setPrototypeOf(JSObject*, ExecState*, JSValue)
+bool JSCell::setPrototype(JSObject*, ExecState*, JSValue)
{
RELEASE_ASSERT_NOT_REACHED();
}
Modified: trunk/Source/_javascript_Core/runtime/JSCell.h (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/JSCell.h 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/JSCell.h 2016-03-03 02:04:49 UTC (rev 197484)
@@ -208,7 +208,7 @@
static NO_RETURN_DUE_TO_CRASH void getGenericPropertyNames(JSObject*, ExecState*, PropertyNameArray&, EnumerationMode);
static NO_RETURN_DUE_TO_CRASH bool preventExtensions(JSObject*, ExecState*);
static NO_RETURN_DUE_TO_CRASH bool isExtensible(JSObject*, ExecState*);
- static NO_RETURN_DUE_TO_CRASH bool setPrototypeOf(JSObject*, ExecState*, JSValue);
+ static NO_RETURN_DUE_TO_CRASH bool setPrototype(JSObject*, ExecState*, JSValue);
static String className(const JSObject*);
JS_EXPORT_PRIVATE static bool customHasInstance(JSObject*, ExecState*, JSValue);
Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -885,14 +885,14 @@
if (thisObject->prototype() == value)
return JSValue::encode(jsUndefined());
- bool isExtensible = thisObject->isExtensibleInline(exec);
+ bool isExtensible = thisObject->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
if (!isExtensible)
return throwVMError(exec, createTypeError(exec, StrictModeReadonlyPropertyWriteError));
VM& vm = exec->vm();
- if (!thisObject->setPrototypeOfInline(vm, exec, value)) {
+ if (!thisObject->setPrototype(vm, exec, value)) {
if (!vm.exception())
vm.throwException(exec, createError(exec, ASCIILiteral("cyclic __proto__ value")));
return JSValue::encode(jsUndefined());
Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -1211,11 +1211,16 @@
return true;
}
-bool JSObject::setPrototypeOf(JSObject* object, ExecState* exec, JSValue prototype)
+bool JSObject::setPrototype(JSObject* object, ExecState* exec, JSValue prototype)
{
return object->setPrototypeWithCycleCheck(exec->vm(), exec, prototype);
}
+bool JSObject::setPrototype(VM& vm, ExecState* exec, JSValue prototype)
+{
+ return methodTable(vm)->setPrototype(this, exec, prototype);
+}
+
bool JSObject::allowsAccessFrom(ExecState* exec)
{
JSGlobalObject* globalObject = this->globalObject();
@@ -1701,6 +1706,12 @@
return obj->isExtensibleImpl();
}
+bool JSObject::isExtensible(ExecState* exec)
+{
+ VM& vm = exec->vm();
+ return methodTable(vm)->isExtensible(this, exec);
+}
+
void JSObject::reifyAllStaticProperties(ExecState* exec)
{
ASSERT(!staticFunctionsReified());
@@ -2863,7 +2874,7 @@
DefineOwnPropertyScope scope(exec);
PropertyDescriptor current;
bool isCurrentDefined = getOwnPropertyDescriptor(exec, propertyName, current);
- bool isExtensible = isExtensibleInline(exec);
+ bool isExtensible = this->isExtensible(exec);
if (UNLIKELY(exec->hadException()))
return false;
return validateAndApplyPropertyDescriptor(exec, this, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException);
Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/JSObject.h 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h 2016-03-03 02:04:49 UTC (rev 197484)
@@ -119,15 +119,8 @@
// This is the fully virtual [[SetPrototypeOf]] internal function defined
// in the ECMAScript 6 specification. Use this when doing a [[SetPrototypeOf]]
// operation as dictated in the specification.
- ALWAYS_INLINE bool setPrototypeOfInline(VM& vm, ExecState* exec, JSValue prototype)
- {
- auto setPrototypeOfMethod = methodTable(vm)->setPrototypeOf;
- if (LIKELY(setPrototypeOfMethod == JSObject::setPrototypeOf))
- return setPrototypeWithCycleCheck(vm, exec, prototype);
-
- return setPrototypeOfMethod(this, exec, prototype);
- }
- JS_EXPORT_PRIVATE static bool setPrototypeOf(JSObject*, ExecState*, JSValue prototype);
+ bool setPrototype(VM&, ExecState*, JSValue prototype);
+ JS_EXPORT_PRIVATE static bool setPrototype(JSObject*, ExecState*, JSValue prototype);
bool mayInterceptIndexedAccesses()
{
@@ -653,15 +646,7 @@
// You should call this when performing [[IsExtensible]] trap in a place
// that is described in the specification. This performs the fully virtual
// [[IsExtensible]] trap.
- ALWAYS_INLINE bool isExtensibleInline(ExecState* exec)
- {
- VM& vm = exec->vm();
- auto isExtensibleMethod = methodTable(vm)->isExtensible;
- if (LIKELY(isExtensibleMethod == JSObject::isExtensible))
- return isExtensibleImpl();
-
- return isExtensibleMethod(this, exec);
- }
+ bool isExtensible(ExecState*);
bool indexingShouldBeSparse()
{
return !isStructureExtensible()
Modified: trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/ObjectConstructor.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -212,14 +212,14 @@
if (object->prototype() == protoValue)
return JSValue::encode(objectValue);
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
if (!isExtensible)
return throwVMError(exec, createTypeError(exec, StrictModeReadonlyPropertyWriteError));
VM& vm = exec->vm();
- bool didSetPrototype = object->setPrototypeOfInline(vm, exec, protoValue);
+ bool didSetPrototype = object->setPrototype(vm, exec, protoValue);
if (vm.exception())
return JSValue::encode(JSValue());
if (!didSetPrototype) {
@@ -623,7 +623,7 @@
// 3. If the [[Extensible]] internal property of O is false, then return true.
// 4. Otherwise, return false.
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
return JSValue::encode(jsBoolean(!isExtensible));
@@ -660,7 +660,7 @@
// 3. If the [[Extensible]] internal property of O is false, then return true.
// 4. Otherwise, return false.
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
return JSValue::encode(jsBoolean(!isExtensible));
@@ -672,7 +672,7 @@
if (!obj.isObject())
return JSValue::encode(jsBoolean(false));
JSObject* object = asObject(obj);
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
return JSValue::encode(jsBoolean(isExtensible));
Modified: trunk/Source/_javascript_Core/runtime/ProxyObject.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/ProxyObject.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/ProxyObject.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -201,7 +201,7 @@
}
// FIXME: this doesn't work if 'target' is another Proxy. We don't have isExtensible implemented in a way that fits w/ Proxys.
// https://bugs.webkit.org/show_bug.cgi?id=154375
- bool isExtensible = target->isExtensibleInline(exec);
+ bool isExtensible = target->isExtensible(exec);
if (exec->hadException())
return false;
if (!isExtensible) {
@@ -215,7 +215,7 @@
return false;
}
- bool isExtensible = target->isExtensibleInline(exec);
+ bool isExtensible = target->isExtensible(exec);
if (exec->hadException())
return false;
PropertyDescriptor trapResultAsDescriptor;
@@ -299,7 +299,7 @@
throwVMTypeError(exec, ASCIILiteral("Proxy 'has' must return 'true' for non-configurable properties."));
return false;
}
- bool isExtensible = target->isExtensibleInline(exec);
+ bool isExtensible = target->isExtensible(exec);
if (exec->hadException())
return false;
if (!isExtensible) {
@@ -637,7 +637,7 @@
return false;
if (trapResultAsBool) {
- bool targetIsExtensible = target->isExtensibleInline(exec);
+ bool targetIsExtensible = target->isExtensible(exec);
if (exec->hadException())
return false;
if (targetIsExtensible) {
@@ -673,7 +673,7 @@
JSObject* target = this->target();
if (isExtensibleMethod.isUndefined())
- return target->isExtensibleInline(exec);
+ return target->isExtensible(exec);
MarkedArgumentBuffer arguments;
arguments.append(target);
@@ -685,7 +685,7 @@
if (exec->hadException())
return false;
- bool isTargetExtensible = target->isExtensibleInline(exec);
+ bool isTargetExtensible = target->isExtensible(exec);
if (exec->hadException())
return false;
Modified: trunk/Source/_javascript_Core/runtime/ReflectObject.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/ReflectObject.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/ReflectObject.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -169,7 +169,7 @@
if (!target.isObject())
return JSValue::encode(throwTypeError(exec, ASCIILiteral("Reflect.isExtensible requires the first argument be an object")));
- bool isExtensible = asObject(target)->isExtensibleInline(exec);
+ bool isExtensible = asObject(target)->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
return JSValue::encode(jsBoolean(isExtensible));
@@ -215,14 +215,14 @@
if (object->prototype() == proto)
return JSValue::encode(jsBoolean(true));
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return JSValue::encode(JSValue());
if (!isExtensible)
return JSValue::encode(jsBoolean(false));
VM& vm = exec->vm();
- bool didSetPrototype = object->setPrototypeOfInline(vm, exec, proto);
+ bool didSetPrototype = object->setPrototype(vm, exec, proto);
if (vm.exception())
return JSValue::encode(JSValue());
return JSValue::encode(jsBoolean(didSetPrototype));
Modified: trunk/Source/_javascript_Core/runtime/StringObject.cpp (197483 => 197484)
--- trunk/Source/_javascript_Core/runtime/StringObject.cpp 2016-03-03 01:29:31 UTC (rev 197483)
+++ trunk/Source/_javascript_Core/runtime/StringObject.cpp 2016-03-03 02:04:49 UTC (rev 197484)
@@ -86,7 +86,7 @@
StringObject* thisObject = jsCast<StringObject*>(object);
if (propertyName == exec->propertyNames().length) {
- bool isExtensible = object->isExtensibleInline(exec);
+ bool isExtensible = object->isExtensible(exec);
if (exec->hadException())
return false;
if (!isExtensible) {