Diff
Modified: trunk/Source/WebCore/ChangeLog (200285 => 200286)
--- trunk/Source/WebCore/ChangeLog 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/ChangeLog 2016-04-30 04:48:34 UTC (rev 200286)
@@ -1,3 +1,106 @@
+2016-04-29 Chris Dumez <[email protected]>
+
+ Use LIKELY() / UNLIKELY() hints when suitable in the _javascript_ bindings
+ https://bugs.webkit.org/show_bug.cgi?id=157210
+
+ Reviewed by Darin Adler.
+
+ Use LIKELY() / UNLIKELY() hints when suitable in the _javascript_ bindings.
+ We already make use of them in the JS bindings but they are some cases
+ where we don't and they may be useful.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateOverloadedFunction):
+ (GenerateImplementation):
+ (GenerateParametersCheck):
+ (GenerateImplementationFunctionCall):
+ (GenerateOverloadedConstructorDefinition):
+ (GenerateConstructorDefinition):
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+ (WebCore::jsTestActiveDOMObjectConstructor):
+ (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
+ * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
+ (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
+ * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+ (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
+ * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+ (WebCore::jsTestCustomNamedGetterConstructor):
+ * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+ (WebCore::jsTestEventConstructorConstructor):
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+ (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
+ (WebCore::jsTestEventTargetConstructor):
+ * bindings/scripts/test/JS/JSTestException.cpp:
+ (WebCore::jsTestExceptionConstructor):
+ * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
+ (WebCore::jsTestGenerateIsReachableConstructor):
+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+ (WebCore::jsTestGlobalObjectConstructor):
+ (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ (WebCore::JSTestInterfaceConstructor::construct):
+ (WebCore::jsTestInterfaceConstructor):
+ (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
+ (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+ * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+ (WebCore::jsTestJSBuiltinConstructorConstructor):
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+ (WebCore::jsTestMediaQueryListListenerConstructor):
+ (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
+ * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+ (WebCore::JSTestNamedConstructorNamedConstructor::construct):
+ (WebCore::jsTestNamedConstructorConstructor):
+ * bindings/scripts/test/JS/JSTestNode.cpp:
+ (WebCore::jsTestNodeConstructor):
+ * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+ (WebCore::jsTestNondeterministicConstructor):
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::JSTestObjConstructor::construct):
+ (WebCore::JSTestObj::getOwnPropertySlotByIndex):
+ (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
+ (WebCore::jsTestObjConstructor):
+ (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
+ (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
+ (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
+ (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
+ (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
+ (WebCore::jsTestObjPrototypeFunctionConvert1):
+ (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
+ (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
+ (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
+ (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
+ (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
+ (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
+ (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+ (WebCore::constructJSTestOverloadedConstructors1):
+ (WebCore::constructJSTestOverloadedConstructors3):
+ (WebCore::JSTestOverloadedConstructorsConstructor::construct):
+ (WebCore::jsTestOverloadedConstructorsConstructor):
+ * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+ (WebCore::jsTestOverrideBuiltinsConstructor):
+ * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+ (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
+ * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+ (WebCore::JSTestTypedefsConstructor::construct):
+ (WebCore::jsTestTypedefsConstructor):
+ * bindings/scripts/test/JS/JSattribute.cpp:
+ (WebCore::jsattributeConstructor):
+ * bindings/scripts/test/JS/JSreadonly.cpp:
+ (WebCore::jsreadonlyConstructor):
+
2016-04-29 Ryosuke Niwa <[email protected]>
Rename getAssignedNodes to assignedNodes and support flattened option
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-30 04:48:34 UTC (rev 200286)
@@ -1612,7 +1612,7 @@
}
if ($leastNumMandatoryParams >= 1) {
- push(@implContent, " if (argsCount < $leastNumMandatoryParams)\n");
+ push(@implContent, " if (UNLIKELY(argsCount < $leastNumMandatoryParams))\n");
push(@implContent, " return throwVMError(state, createNotEnoughArgumentsError(state));\n");
}
push(@implContent, <<END);
@@ -2290,9 +2290,9 @@
if ($indexedGetterFunction) {
if ($indexedGetterFunction->signature->type eq "DOMString") {
- push(@implContent, " if (index <= MAX_ARRAY_INDEX) {\n");
+ push(@implContent, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
} else {
- push(@implContent, " if (index < thisObject->wrapped().length()) {\n");
+ push(@implContent, " if (LIKELY(index < thisObject->wrapped().length())) {\n");
}
# Assume that if there's a setter, the index will be writable
if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
@@ -2402,7 +2402,7 @@
AddToImplIncludes("Frame.h");
AddToImplIncludes("Settings.h");
my $enable_function = ToMethodName($attribute->signature->extendedAttributes->{"EnabledBySetting"}) . "Enabled";
- push(@implContent, " if (!castedThis->wrapped().frame())\n");
+ push(@implContent, " if (UNLIKELY(!castedThis->wrapped().frame()))\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
push(@implContent, " Settings& settings = castedThis->wrapped().frame()->settings();\n");
push(@implContent, " if (!settings.$enable_function())\n");
@@ -2558,7 +2558,7 @@
push(@implContent, "EncodedJSValue ${constructorFunctionName}(ExecState* state, EncodedJSValue thisValue, PropertyName)\n");
push(@implContent, "{\n");
push(@implContent, " ${className}Prototype* domObject = jsDynamicCast<${className}Prototype*>(JSValue::decode(thisValue));\n");
- push(@implContent, " if (!domObject)\n");
+ push(@implContent, " if (UNLIKELY(!domObject))\n");
push(@implContent, " return throwVMTypeError(state);\n");
if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
@@ -2619,7 +2619,7 @@
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
- push(@implContent, " if (index <= MAX_ARRAY_INDEX) {\n");
+ push(@implContent, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
push(@implContent, " thisObject->indexSetter(state, index, value);\n");
push(@implContent, " return true;\n");
push(@implContent, " }\n");
@@ -2785,7 +2785,7 @@
}
if ($attribute->signature->type eq "double" or $attribute->signature->type eq "float") {
- push(@implContent, " if (!std::isfinite(nativeValue)) {\n");
+ push(@implContent, " if (UNLIKELY(!std::isfinite(nativeValue))) {\n");
push(@implContent, " throwVMTypeError(state);\n");
push(@implContent, " return false;\n");
push(@implContent, " }\n");
@@ -2810,10 +2810,10 @@
}
if ($svgPropertyType) {
if ($setterRaisesExceptionWithMessage) {
- push(@implContent, " if (!ec.code)\n");
+ push(@implContent, " if (LIKELY(!ec.code))\n");
push(@implContent, " impl.commitChange();\n");
} elsif ($setterRaisesException) {
- push(@implContent, " if (!ec)\n");
+ push(@implContent, " if (LIKELY(!ec))\n");
push(@implContent, " impl.commitChange();\n");
} else {
push(@implContent, " impl.commitChange();\n");
@@ -3536,9 +3536,9 @@
push(@$outputArray, " }\n");
} else {
if ($codeGenerator->IsFunctionOnlyCallbackInterface($argType)) {
- push(@$outputArray, " if (!state->argument($argsIndex).isFunction())\n");
+ push(@$outputArray, " if (UNLIKELY(!state->argument($argsIndex).isFunction()))\n");
} else {
- push(@$outputArray, " if (!state->argument($argsIndex).isObject())\n");
+ push(@$outputArray, " if (UNLIKELY(!state->argument($argsIndex).isObject()))\n");
}
push(@$outputArray, " return throwArgumentMustBeFunctionError(*state, $argsIndex, \"$name\", \"$interfaceName\", $quotedFunctionName);\n");
if ($function->isStatic) {
@@ -3624,7 +3624,7 @@
my $argValue = "state->argument($argsIndex)";
if ($codeGenerator->IsWrapperType($argType)) {
- push(@$outputArray, " if (!${argValue}.isUndefinedOrNull() && !${argValue}.inherits(JS${argType}::info()))\n");
+ push(@$outputArray, " if (UNLIKELY(!${argValue}.isUndefinedOrNull() && !${argValue}.inherits(JS${argType}::info())))\n");
push(@$outputArray, " return throwArgumentTypeError(*state, $argsIndex, \"$name\", \"$interfaceName\", $quotedFunctionName, \"$argType\");\n");
}
}
@@ -3681,13 +3681,13 @@
my $isTearOff = $codeGenerator->IsSVGTypeNeedingTearOff($argType) && $interfaceName !~ /List$/;
if ($isTearOff or ShouldPassWrapperByReference($parameter, $interface)) {
- push(@$outputArray, " if (!$name)\n");
+ push(@$outputArray, " if (UNLIKELY(!$name))\n");
push(@$outputArray, " return throwVMTypeError(state);\n");
$value = $isTearOff ? "$name->propertyReference()" : "*$name";
}
if ($argType eq "double" or $argType eq "float") {
- push(@$outputArray, " if (!std::isfinite($name))\n");
+ push(@$outputArray, " if (UNLIKELY(!std::isfinite($name)))\n");
push(@$outputArray, " return throwVMTypeError(state);\n");
}
@@ -4020,10 +4020,10 @@
if ($svgPropertyType and !$function->isStatic) {
if ($raisesExceptionWithMessage) {
- push(@implContent, $indent . "if (!ec.code)\n");
+ push(@implContent, $indent . "if (LIKELY(!ec.code))\n");
push(@implContent, $indent . " impl.commitChange();\n");
} elsif ($raisesException) {
- push(@implContent, $indent . "if (!ec)\n");
+ push(@implContent, $indent . "if (LIKELY(!ec))\n");
push(@implContent, $indent . " impl.commitChange();\n");
} else {
push(@implContent, $indent . "impl.commitChange();\n");
@@ -4908,7 +4908,7 @@
}
if ($leastNumMandatoryParams >= 1) {
- push(@$outputArray, " if (argsCount < $leastNumMandatoryParams)\n");
+ push(@$outputArray, " if (UNLIKELY(argsCount < $leastNumMandatoryParams))\n");
push(@$outputArray, " return throwVMError(state, createNotEnoughArgumentsError(state));\n");
}
push(@$outputArray, <<END);
@@ -5053,14 +5053,14 @@
if ($codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{"ConstructorCallWith"}, "ScriptExecutionContext")) {
push(@constructorArgList, "*context");
push(@$outputArray, " ScriptExecutionContext* context = castedThis->scriptExecutionContext();\n");
- push(@$outputArray, " if (!context)\n");
+ push(@$outputArray, " if (UNLIKELY(!context))\n");
push(@$outputArray, " return throwConstructorDocumentUnavailableError(*state, \"${interfaceName}\");\n");
}
if ($codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{"ConstructorCallWith"}, "Document")) {
$implIncludes{"Document.h"} = 1;
push(@constructorArgList, "document");
push(@$outputArray, " ScriptExecutionContext* context = castedThis->scriptExecutionContext();\n");
- push(@$outputArray, " if (!context)\n");
+ push(@$outputArray, " if (UNLIKELY(!context))\n");
push(@$outputArray, " return throwConstructorDocumentUnavailableError(*state, \"${interfaceName}\");\n");
push(@$outputArray, " ASSERT(context->isDocument());\n");
push(@$outputArray, " auto& document = downcast<Document>(*context);\n");
@@ -5091,7 +5091,7 @@
}
if ($interface->extendedAttributes->{"ConstructorRaisesException"}) {
- push(@$outputArray, " if (ec) {\n");
+ push(@$outputArray, " if (UNLIKELY(ec)) {\n");
push(@$outputArray, " setDOMException(state, ec);\n");
push(@$outputArray, " return JSValue::encode(JSValue());\n");
push(@$outputArray, " }\n");
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -169,7 +169,7 @@
EncodedJSValue jsTestActiveDOMObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestActiveDOMObjectPrototype* domObject = jsDynamicCast<JSTestActiveDOMObjectPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestActiveDOMObject::getConstructor(state->vm(), domObject->globalObject()));
}
@@ -206,7 +206,7 @@
Node* nextChild = JSNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!nextChild)
+ if (UNLIKELY(!nextChild))
return throwVMTypeError(state);
impl.excitingFunction(*nextChild);
return JSValue::encode(jsUndefined());
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -124,7 +124,7 @@
EncodedJSValue jsTestClassWithJSBuiltinConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestClassWithJSBuiltinConstructorPrototype* domObject = jsDynamicCast<JSTestClassWithJSBuiltinConstructorPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestClassWithJSBuiltinConstructor::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -123,7 +123,7 @@
EncodedJSValue jsTestCustomConstructorWithNoInterfaceObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestCustomConstructorWithNoInterfaceObjectPrototype* domObject = jsDynamicCast<JSTestCustomConstructorWithNoInterfaceObjectPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
JSValue constructor = JSTestCustomConstructorWithNoInterfaceObjectConstructor::create(state->vm(), JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure(state->vm(), *domObject->globalObject(), domObject->globalObject()->objectPrototype()), *jsCast<JSDOMGlobalObject*>(domObject->globalObject()));
// Shadowing constructor property to ensure reusing the same constructor object
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -161,7 +161,7 @@
EncodedJSValue jsTestCustomNamedGetterConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestCustomNamedGetterPrototype* domObject = jsDynamicCast<JSTestCustomNamedGetterPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestCustomNamedGetter::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -226,7 +226,7 @@
EncodedJSValue jsTestEventConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestEventConstructorPrototype* domObject = jsDynamicCast<JSTestEventConstructorPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestEventConstructor::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -149,7 +149,7 @@
{
auto* thisObject = jsCast<JSTestEventTarget*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (index < thisObject->wrapped().length()) {
+ if (LIKELY(index < thisObject->wrapped().length())) {
unsigned attributes = DontDelete | ReadOnly;
slot.setValue(thisObject, attributes, toJS(state, thisObject->globalObject(), thisObject->wrapped().item(index)));
return true;
@@ -160,7 +160,7 @@
EncodedJSValue jsTestEventTargetConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestEventTargetPrototype* domObject = jsDynamicCast<JSTestEventTargetPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestEventTarget::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -159,7 +159,7 @@
EncodedJSValue jsTestExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestExceptionPrototype* domObject = jsDynamicCast<JSTestExceptionPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestException::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -118,7 +118,7 @@
EncodedJSValue jsTestGenerateIsReachableConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestGenerateIsReachablePrototype* domObject = jsDynamicCast<JSTestGenerateIsReachablePrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestGenerateIsReachable::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -188,7 +188,7 @@
EncodedJSValue jsTestGlobalObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestGlobalObjectPrototype* domObject = jsDynamicCast<JSTestGlobalObjectPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestGlobalObject::getConstructor(state->vm(), domObject->globalObject()));
}
@@ -316,7 +316,7 @@
return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state);
#endif
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -235,10 +235,10 @@
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
ScriptExecutionContext* context = castedThis->scriptExecutionContext();
- if (!context)
+ if (UNLIKELY(!context))
return throwConstructorDocumentUnavailableError(*state, "TestInterface");
RefPtr<TestInterface> object = TestInterface::create(*context, str1, str2, ec);
- if (ec) {
+ if (UNLIKELY(ec)) {
setDOMException(state, ec);
return JSValue::encode(JSValue());
}
@@ -589,7 +589,7 @@
EncodedJSValue jsTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestInterfacePrototype* domObject = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestInterface::getConstructor(state->vm(), domObject->globalObject()));
}
@@ -801,7 +801,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, strArg, *objArg, ec)));
@@ -869,7 +869,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, strArg, *objArg, ec)));
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -161,7 +161,7 @@
EncodedJSValue jsTestJSBuiltinConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestJSBuiltinConstructorPrototype* domObject = jsDynamicCast<JSTestJSBuiltinConstructorPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestJSBuiltinConstructor::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -126,7 +126,7 @@
EncodedJSValue jsTestMediaQueryListListenerConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestMediaQueryListListenerPrototype* domObject = jsDynamicCast<JSTestMediaQueryListListenerPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestMediaQueryListListener::getConstructor(state->vm(), domObject->globalObject()));
}
@@ -158,7 +158,7 @@
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isFunction())
+ if (UNLIKELY(!state->argument(0).isFunction()))
return throwArgumentMustBeFunctionError(*state, 0, "listener", "TestMediaQueryListListener", "method");
RefPtr<MediaQueryListListener> listener = JSMediaQueryListListener::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
impl.method(WTFMove(listener));
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -96,7 +96,7 @@
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
RefPtr<TestNamedConstructor> object = TestNamedConstructor::createForJSConstructor(*castedThis->document(), str1, str2, str3, ec);
- if (ec) {
+ if (UNLIKELY(ec)) {
setDOMException(state, ec);
return JSValue::encode(JSValue());
}
@@ -159,7 +159,7 @@
EncodedJSValue jsTestNamedConstructorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestNamedConstructorPrototype* domObject = jsDynamicCast<JSTestNamedConstructorPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestNamedConstructor::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -139,7 +139,7 @@
EncodedJSValue jsTestNodeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestNodePrototype* domObject = jsDynamicCast<JSTestNodePrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestNode::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -326,7 +326,7 @@
EncodedJSValue jsTestNondeterministicConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestNondeterministicPrototype* domObject = jsDynamicCast<JSTestNondeterministicPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestNondeterministic::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -527,10 +527,10 @@
auto* castedThis = jsCast<JSTestObjConstructor*>(state->callee());
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isObject())
+ if (UNLIKELY(!state->argument(0).isObject()))
return throwArgumentMustBeFunctionError(*state, 0, "testCallback", "TestObj", nullptr);
RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
- if (!state->argument(1).isFunction())
+ if (UNLIKELY(!state->argument(1).isFunction()))
return throwArgumentMustBeFunctionError(*state, 1, "testCallbackFunction", "TestObj", nullptr);
RefPtr<TestCallbackFunction> testCallbackFunction = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
RefPtr<TestObj> object = TestObj::create(*testCallback, *testCallbackFunction);
@@ -878,7 +878,7 @@
{
auto* thisObject = jsCast<JSTestObj*>(object);
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
- if (index <= MAX_ARRAY_INDEX) {
+ if (LIKELY(index <= MAX_ARRAY_INDEX)) {
unsigned attributes = DontDelete | ReadOnly;
slot.setValue(thisObject, attributes, jsStringOrUndefined(state, thisObject->wrapped().item(index)));
return true;
@@ -971,7 +971,7 @@
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, "TestObj", "TestSubObjEnabledBySetting");
}
- if (!castedThis->wrapped().frame())
+ if (UNLIKELY(!castedThis->wrapped().frame()))
return JSValue::encode(jsUndefined());
Settings& settings = castedThis->wrapped().frame()->settings();
if (!settings.testSettingEnabled())
@@ -2185,7 +2185,7 @@
EncodedJSValue jsTestObjConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestObjPrototype* domObject = jsDynamicCast<JSTestObjPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestObj::getConstructor(state->vm(), domObject->globalObject()));
}
@@ -3417,7 +3417,7 @@
return jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2(state);
#endif
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
@@ -3453,7 +3453,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
impl.voidMethodWithArgs(longArg, strArg, *objArg);
return JSValue::encode(jsUndefined());
@@ -3490,7 +3490,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = jsNumber(impl.byteMethodWithArgs(byteArg, strArg, *objArg));
return JSValue::encode(result);
@@ -3527,7 +3527,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = jsNumber(impl.octetMethodWithArgs(octetArg, strArg, *objArg));
return JSValue::encode(result);
@@ -3564,7 +3564,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = jsNumber(impl.longMethodWithArgs(longArg, strArg, *objArg));
return JSValue::encode(result);
@@ -3601,7 +3601,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(2));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.objMethodWithArgs(longArg, strArg, *objArg)));
return JSValue::encode(result);
@@ -3765,7 +3765,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(1));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.methodThatRequiresAllArgsAndThrows(strArg, *objArg, ec)));
@@ -4487,7 +4487,7 @@
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isObject())
+ if (UNLIKELY(!state->argument(0).isObject()))
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackArg");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
impl.methodWithCallbackArg(WTFMove(callback));
@@ -4507,7 +4507,7 @@
int nonCallback = toInt32(state, state->argument(0), NormalConversion);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!state->argument(1).isObject())
+ if (UNLIKELY(!state->argument(1).isObject()))
return throwArgumentMustBeFunctionError(*state, 1, "callback", "TestObj", "methodWithNonCallbackArgAndCallbackArg");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
impl.methodWithNonCallbackArgAndCallbackArg(nonCallback, WTFMove(callback));
@@ -4542,7 +4542,7 @@
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isFunction())
+ if (UNLIKELY(!state->argument(0).isFunction()))
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "methodWithCallbackFunctionArg");
RefPtr<TestCallbackFunction> callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
impl.methodWithCallbackFunctionArg(WTFMove(callback));
@@ -4562,7 +4562,7 @@
int nonCallback = toInt32(state, state->argument(0), NormalConversion);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!state->argument(1).isFunction())
+ if (UNLIKELY(!state->argument(1).isFunction()))
return throwArgumentMustBeFunctionError(*state, 1, "callback", "TestObj", "methodWithNonCallbackArgAndCallbackFunctionArg");
RefPtr<TestCallbackFunction> callback = JSTestCallbackFunction::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
impl.methodWithNonCallbackArgAndCallbackFunctionArg(nonCallback, WTFMove(callback));
@@ -4603,7 +4603,7 @@
{
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isObject())
+ if (UNLIKELY(!state->argument(0).isObject()))
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "staticMethodWithCallbackArg");
RefPtr<TestCallback> callback = createFunctionOnlyCallback<JSTestCallback>(state, jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject()), state->uncheckedArgument(0));
TestObj::staticMethodWithCallbackArg(WTFMove(callback));
@@ -4739,7 +4739,7 @@
auto& impl = castedThis->wrapped();
if (UNLIKELY(state->argumentCount() < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
- if (!state->argument(0).isObject())
+ if (UNLIKELY(!state->argument(0).isObject()))
return throwArgumentMustBeFunctionError(*state, 0, "callback", "TestObj", "overloadedMethod");
RefPtr<TestCallback> callback = JSTestCallback::create(asObject(state->uncheckedArgument(0)), castedThis->globalObject());
impl.overloadedMethod(WTFMove(callback));
@@ -4793,7 +4793,7 @@
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
impl.overloadedMethod(*objArg);
return JSValue::encode(jsUndefined());
@@ -4897,7 +4897,7 @@
return jsTestObjPrototypeFunctionOverloadedMethod11(state);
if ()
return jsTestObjPrototypeFunctionOverloadedMethod12(state);
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
@@ -4951,7 +4951,7 @@
return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1(state);
if ((argsCount == 1 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))) || (argsCount == 2 && (arg0.isNull() || (arg0.isObject() && asObject(arg0)->inherits(JSTestObj::info())))))
return jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2(state);
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
@@ -5020,7 +5020,7 @@
return jsTestObjConstructorFunctionOverloadedMethod12(state);
#endif
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
@@ -5192,7 +5192,7 @@
TestNode* value = JSTestNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!value)
+ if (UNLIKELY(!value))
return throwVMTypeError(state);
impl.convert1(*value);
return JSValue::encode(jsUndefined());
@@ -5322,12 +5322,12 @@
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, createNotEnoughArgumentsError(state));
ExceptionCode ec = 0;
- if (!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info()))
+ if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithSequence", "TestObj");
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
Vector<unsigned> a = toNativeArray<unsigned>(state, state->argument(1));
if (UNLIKELY(state->hadException()))
@@ -5349,12 +5349,12 @@
if (UNLIKELY(state->argumentCount() < 2))
return throwVMError(state, createNotEnoughArgumentsError(state));
ExceptionCode ec = 0;
- if (!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info()))
+ if (UNLIKELY(!state->argument(0).isUndefinedOrNull() && !state->argument(0).inherits(JSTestObj::info())))
return throwArgumentTypeError(*state, 0, "objArg", "TestObj", "strictFunctionWithArray", "TestObj");
TestObj* objArg = JSTestObj::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!objArg)
+ if (UNLIKELY(!objArg))
return throwVMTypeError(state);
Vector<int> array = toNativeArray<int>(state, state->argument(1));
if (UNLIKELY(state->hadException()))
@@ -5418,7 +5418,7 @@
Node* head = JSNode::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!head)
+ if (UNLIKELY(!head))
return throwVMTypeError(state);
Vector<Node*> tail;
for (unsigned i = 1, count = state->argumentCount(); i < count; ++i) {
@@ -5487,7 +5487,7 @@
float a = state->argument(0).toFloat(state);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!std::isfinite(a))
+ if (UNLIKELY(!std::isfinite(a)))
return throwVMTypeError(state);
impl.testPromiseFunctionWithFloatArgument(a, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
@@ -5553,7 +5553,7 @@
float a = state->argument(0).toFloat(state);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!std::isfinite(a))
+ if (UNLIKELY(!std::isfinite(a)))
return throwVMTypeError(state);
impl.testPromiseOverloadedFunction(a, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
@@ -5578,7 +5578,7 @@
FetchRequest* request = JSFetchRequest::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!request)
+ if (UNLIKELY(!request))
return throwVMTypeError(state);
impl.testPromiseOverloadedFunction(*request, DeferredWrapper(state, castedThis->globalObject(), promiseDeferred));
return JSValue::encode(jsUndefined());
@@ -5592,7 +5592,7 @@
JSValue arg0(state->argument(0));
if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info())))))
return jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2(state);
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -73,7 +73,7 @@
ArrayBuffer* arrayBuffer = toArrayBuffer(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!arrayBuffer)
+ if (UNLIKELY(!arrayBuffer))
return throwVMTypeError(state);
RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*arrayBuffer);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
@@ -99,7 +99,7 @@
Blob* blob = JSBlob::toWrapped(state->argument(0));
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!blob)
+ if (UNLIKELY(!blob))
return throwVMTypeError(state);
RefPtr<TestOverloadedConstructors> object = TestOverloadedConstructors::create(*blob);
return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
@@ -141,7 +141,7 @@
return constructJSTestOverloadedConstructors4(state);
if ()
return constructJSTestOverloadedConstructors5(state);
- if (argsCount < 1)
+ if (UNLIKELY(argsCount < 1))
return throwVMError(state, createNotEnoughArgumentsError(state));
return throwVMTypeError(state);
}
@@ -202,7 +202,7 @@
EncodedJSValue jsTestOverloadedConstructorsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestOverloadedConstructorsPrototype* domObject = jsDynamicCast<JSTestOverloadedConstructorsPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestOverloadedConstructors::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -159,7 +159,7 @@
EncodedJSValue jsTestOverrideBuiltinsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestOverrideBuiltinsPrototype* domObject = jsDynamicCast<JSTestOverrideBuiltinsPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestOverrideBuiltins::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -218,7 +218,7 @@
EncodedJSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestSerializedScriptValueInterfacePrototype* domObject = jsDynamicCast<JSTestSerializedScriptValueInterfacePrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestSerializedScriptValueInterface::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -131,7 +131,7 @@
String hello = state->argument(0).toString(state)->value(state);
if (UNLIKELY(state->hadException()))
return JSValue::encode(jsUndefined());
- if (!state->argument(1).isObject())
+ if (UNLIKELY(!state->argument(1).isObject()))
return throwArgumentMustBeFunctionError(*state, 1, "testCallback", "TestTypedefs", nullptr);
RefPtr<TestCallback> testCallback = JSTestCallback::create(asObject(state->uncheckedArgument(1)), castedThis->globalObject());
RefPtr<TestTypedefs> object = TestTypedefs::create(hello, *testCallback);
@@ -327,7 +327,7 @@
EncodedJSValue jsTestTypedefsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSTestTypedefsPrototype* domObject = jsDynamicCast<JSTestTypedefsPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSTestTypedefs::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -159,7 +159,7 @@
EncodedJSValue jsattributeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSattributePrototype* domObject = jsDynamicCast<JSattributePrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSattribute::getConstructor(state->vm(), domObject->globalObject()));
}
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp (200285 => 200286)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp 2016-04-30 04:19:00 UTC (rev 200285)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp 2016-04-30 04:48:34 UTC (rev 200286)
@@ -118,7 +118,7 @@
EncodedJSValue jsreadonlyConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
JSreadonlyPrototype* domObject = jsDynamicCast<JSreadonlyPrototype*>(JSValue::decode(thisValue));
- if (!domObject)
+ if (UNLIKELY(!domObject))
return throwVMTypeError(state);
return JSValue::encode(JSreadonly::getConstructor(state->vm(), domObject->globalObject()));
}