Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Binding] Use unchekcedArgument if argumentCount is already checked
https://bugs.webkit.org/show_bug.cgi?id=162502 Reviewed by Geoffrey Garen. It is not necessary to use `exec->argument(n)` after checking the argument exists. This patch changes `argument(n)` to `uncheckedArgument(n)` if we already proved that the argument exists. This change drops branches generated by `exec->argument(n)`. And it is good for small DOM operations in which DOM binding code occupies large part of entire processing. This patch and another small patch[1] offer roughly 5% improvement in Dromaeo dom-attr's getAttribute and setAttribute tests. [1]: https://bugs.webkit.org/show_bug.cgi?id=162503 * bindings/scripts/CodeGeneratorJS.pm: (GenerateParametersCheck): GenerateParameterCheck requires GenerateArgumentsCountCheck. As a result, existence of mandatory arguments are already checked. We can use `uncheckedArgument(n)` for mandatory arguments. * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItem): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1): (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::construct): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1): (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString): (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter): (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod): (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg): (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionPrivateMethod): (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod): (WebCore::jsTestObjPrototypeFunctionAddEventListener): (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg): (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp): (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence): (WebCore::jsTestObjPrototypeFunctionStringArrayFunction): (WebCore::jsTestObjPrototypeFunctionDomStringListFunction): (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence): (WebCore::jsTestObjPrototypeFunctionGetElementById): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionConvert2): (WebCore::jsTestObjPrototypeFunctionConvert3): (WebCore::jsTestObjPrototypeFunctionConvert4): (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod): (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod): (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod): (WebCore::jsTestObjPrototypeFunctionAny): (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise): (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): (WebCore::jsTestObjPrototypeFunctionConditionalOverload1): (WebCore::jsTestObjPrototypeFunctionConditionalOverload2): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1): (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2): (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::constructJSTestOverloadedConstructors1): (WebCore::constructJSTestOverloadedConstructors2): (WebCore::constructJSTestOverloadedConstructors3): (WebCore::constructJSTestOverloadedConstructors4): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::constructJSTestOverloadedConstructorsWithSequence2): * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::construct): (WebCore::jsTestTypedefsPrototypeFunctionSetShadow): (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg): (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg): (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction): (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2): (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude): Canonical link: https://commits.webkit.org/180467@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information