Rationalize JSXXConstructor class definition
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 13:44:42 +0000 (13:44 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 13:44:42 +0000 (13:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149923

Reviewed by Darin Adler.

Declaration of JSXXConstructor::construct and JSXXConstructor::getConstructData
as long as JSXX is constructable from JavaScript.

Previously, JSXXConstructor::construct was not generated in case of CustomConstructor.
It is now generated and directly calls the custom constructor function.

getConstructData was declared conditionally with #if in case of ConstructorConditional.
The #if are now within getConstructData body.

Covered by binding tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDeclaration):
(GenerateOverloadedConstructorDefinition):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(GenerateConstructorDefinitions):.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
(WebCore::JSTestEventConstructorConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
(WebCore::JSTestInterfaceConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::construct):
(WebCore::JSTestJSBuiltinConstructorConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
(WebCore::JSTestNamedConstructorNamedConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::construct):
(WebCore::JSTestNodeConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
(WebCore::JSTestObjConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors3):
(WebCore::constructJSTestOverloadedConstructors4):
(WebCore::constructJSTestOverloadedConstructors5):
(WebCore::JSTestOverloadedConstructorsConstructor::construct):
(WebCore::JSTestOverloadedConstructorsConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
(WebCore::JSTestTypedefsConstructor::getConstructData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190785 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

index aab7d90..8ab468b 100644 (file)
@@ -1,3 +1,61 @@
+2015-10-09  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Rationalize JSXXConstructor class definition
+        https://bugs.webkit.org/show_bug.cgi?id=149923
+
+        Reviewed by Darin Adler.
+
+        Declaration of JSXXConstructor::construct and JSXXConstructor::getConstructData
+        as long as JSXX is constructable from JavaScript.
+
+        Previously, JSXXConstructor::construct was not generated in case of CustomConstructor.
+        It is now generated and directly calls the custom constructor function.
+
+        getConstructData was declared conditionally with #if in case of ConstructorConditional.
+        The #if are now within getConstructData body.
+
+        Covered by binding tests.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateConstructorDeclaration):
+        (GenerateOverloadedConstructorDefinition):
+        (GenerateConstructorDefinition):
+        (GenerateConstructorHelperMethods):
+        (GenerateConstructorDefinitions):.
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):.
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        (WebCore::JSTestEventConstructorConstructor::construct):
+        (WebCore::JSTestEventConstructorConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterfaceConstructor::construct):
+        (WebCore::JSTestInterfaceConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+        (WebCore::JSTestJSBuiltinConstructorConstructor::construct):
+        (WebCore::JSTestJSBuiltinConstructorConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
+        (WebCore::JSTestNamedConstructorNamedConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::JSTestNodeConstructor::construct):
+        (WebCore::JSTestNodeConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObjConstructor::construct):
+        (WebCore::JSTestObjConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        (WebCore::constructJSTestOverloadedConstructors1):
+        (WebCore::constructJSTestOverloadedConstructors2):
+        (WebCore::constructJSTestOverloadedConstructors3):
+        (WebCore::constructJSTestOverloadedConstructors4):
+        (WebCore::constructJSTestOverloadedConstructors5):
+        (WebCore::JSTestOverloadedConstructorsConstructor::construct):
+        (WebCore::JSTestOverloadedConstructorsConstructor::getConstructData):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::JSTestTypedefsConstructor::construct):
+        (WebCore::JSTestTypedefsConstructor::getConstructData):
+
 2015-10-07  Sergio Villar Senin  <svillar@igalia.com>
 
         [css-grid] Include freeSpace in GridSizingData struct
index 0a9b5e7..5f0b151 100644 (file)
@@ -4626,22 +4626,9 @@ sub GenerateConstructorDeclaration
     push(@$outputArray, "    }\n");
 
     if (IsConstructable($interface) && !$interface->extendedAttributes->{"NamedConstructor"}) {
-        if (!HasCustomConstructor($interface)) {
-            push(@$outputArray, "protected:\n");
-            push(@$outputArray, "    static JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState*);\n");
-            my @constructors = @{$interface->constructors};
-            if (@constructors > 1) {
-                foreach my $constructor (@constructors) {
-                    my $overloadedIndex = "" . $constructor->{overloadedIndex};
-                    push(@$outputArray, "    static JSC::EncodedJSValue JSC_HOST_CALL construct${className}${overloadedIndex}(JSC::ExecState*);\n");
-                }
-            }
-        }
-
-        my $conditionalString = $codeGenerator->GenerateConstructorConditionalString($interface);
-        push(@$outputArray, "#if $conditionalString\n") if $conditionalString;
+        push(@$outputArray, "protected:\n");
+        push(@$outputArray, "    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);\n");
         push(@$outputArray, "    static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);\n");
-        push(@$outputArray, "#endif // $conditionalString\n") if $conditionalString;
     }
     push(@$outputArray, "};\n\n");
 
@@ -4667,7 +4654,7 @@ public:
 
 private:
     JS${interfaceName}NamedConstructor(JSC::Structure*, JSDOMGlobalObject&);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJS${interfaceName}(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
     void finishCreation(JSC::VM&, JSDOMGlobalObject&);
 };
@@ -4709,13 +4696,11 @@ sub GenerateOverloadedConstructorDefinition
     my $className = shift;
     my $interface = shift;
 
-    my $functionName = "${className}Constructor::construct${className}";
-
     # FIXME: Implement support for overloaded constructors with variadic arguments.
     my $lengthOfLongestOverloadedConstructorParameterList = LengthOfLongestFunctionParameterList($interface->constructors);
 
     push(@$outputArray, <<END);
-EncodedJSValue JSC_HOST_CALL ${functionName}(ExecState* state)
+EncodedJSValue JSC_HOST_CALL ${className}Constructor::construct(ExecState* state)
 {
     size_t argsCount = std::min<size_t>($lengthOfLongestOverloadedConstructorParameterList, state->argumentCount());
 END
@@ -4725,6 +4710,7 @@ END
 
     my @constructors = @{$interface->constructors};
     foreach my $overload (@constructors) {
+        my $functionName = "construct${className}";
         my ($numMandatoryParams, $parametersCheck, @neededArguments) = GenerateFunctionParametersCheck($overload);
         $leastNumMandatoryParams = $numMandatoryParams if ($numMandatoryParams < $leastNumMandatoryParams);
 
@@ -4768,7 +4754,7 @@ sub GenerateConstructorDefinition
             $implIncludes{"<runtime/Error.h>"} = 1;
 
             push(@$outputArray, <<END);
-EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(ExecState* state)
+EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(ExecState* state)
 {
     auto* jsConstructor = jsCast<${constructorClassName}*>(state->callee());
 
@@ -4832,8 +4818,13 @@ END
 }
 
 END
-        } elsif ($interface->extendedAttributes->{"JSBuiltinConstructor"}) {
-            push(@$outputArray, "JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}(JSC::ExecState* state)\n");
+         } elsif ($interface->extendedAttributes->{"CustomConstructor"}) {
+            push(@$outputArray, "JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* state)\n");
+            push(@$outputArray, "{\n");
+            push(@$outputArray, "    return construct${className}(state);\n");
+            push(@$outputArray, "}\n\n");
+         } elsif ($interface->extendedAttributes->{"JSBuiltinConstructor"}) {
+            push(@$outputArray, "JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* state)\n");
             push(@$outputArray, "{\n");
 
             push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(state->callee());\n");
@@ -4841,12 +4832,13 @@ END
 
             push(@$outputArray, "}\n\n");
         } elsif (!HasCustomConstructor($interface) && (!$interface->extendedAttributes->{"NamedConstructor"} || $generatingNamedConstructor)) {
-            my $overloadedIndexString = "";
             if ($function->{overloadedIndex} && $function->{overloadedIndex} > 0) {
-                $overloadedIndexString .= $function->{overloadedIndex};
+                push(@$outputArray, "static inline EncodedJSValue construct${className}$function->{overloadedIndex}(ExecState* state)\n");
+            }
+            else {
+                push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(ExecState* state)\n");
             }
 
-            push(@$outputArray, "EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct${className}${overloadedIndexString}(ExecState* state)\n");
             push(@$outputArray, "{\n");
             push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(state->callee());\n");
 
@@ -5017,13 +5009,20 @@ sub GenerateConstructorHelperMethods
     if (IsConstructable($interface)) {
         if (!$interface->extendedAttributes->{"NamedConstructor"} || $generatingNamedConstructor) {
             my $conditionalString = $codeGenerator->GenerateConstructorConditionalString($interface);
-            push(@$outputArray, "#if $conditionalString\n") if $conditionalString;
             push(@$outputArray, "ConstructType ${constructorClassName}::getConstructData(JSCell*, ConstructData& constructData)\n");
             push(@$outputArray, "{\n");
-            push(@$outputArray, "    constructData.native.function = construct${className};\n");
-            push(@$outputArray, "    return ConstructTypeHost;\n");
+            if ($conditionalString) {
+                push(@$outputArray, "#if $conditionalString\n");
+                push(@$outputArray, "    constructData.native.function = construct;\n");
+                push(@$outputArray, "    return ConstructTypeHost;\n");
+                push(@$outputArray, "#else\n");
+                push(@$outputArray, "    return Base::getConstructData(cell, constructData);\n");
+                push(@$outputArray, "#endif\n");
+            } else {
+                push(@$outputArray, "    constructData.native.function = construct;\n");
+                push(@$outputArray, "    return ConstructTypeHost;\n");
+            }
             push(@$outputArray, "}\n");
-            push(@$outputArray, "#endif // $conditionalString\n") if $conditionalString;
             push(@$outputArray, "\n");
         }
     }
index 7ac42e7..c267023 100644 (file)
@@ -76,9 +76,16 @@ public:
     {
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
+protected:
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
+JSC::EncodedJSValue JSC_HOST_CALL JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct(JSC::ExecState* state)
+{
+    return constructJSTestCustomConstructorWithNoInterfaceObject(state);
+}
+
 const ClassInfo JSTestCustomConstructorWithNoInterfaceObjectConstructor::s_info = { "TestCustomConstructorWithNoInterfaceObjectConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCustomConstructorWithNoInterfaceObjectConstructor) };
 
 JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor(Structure* structure, JSDOMGlobalObject& globalObject)
@@ -97,7 +104,7 @@ void JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation(VM&
 
 ConstructType JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestCustomConstructorWithNoInterfaceObject;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index 146de69..ac8eeed 100644 (file)
@@ -83,11 +83,11 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestEventConstructor(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
-EncodedJSValue JSC_HOST_CALL JSTestEventConstructorConstructor::constructJSTestEventConstructor(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestEventConstructorConstructor::construct(ExecState* state)
 {
     auto* jsConstructor = jsCast<JSTestEventConstructorConstructor*>(state->callee());
 
@@ -146,7 +146,7 @@ void JSTestEventConstructorConstructor::finishCreation(VM& vm, JSDOMGlobalObject
 
 ConstructType JSTestEventConstructorConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestEventConstructor;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index 2960f72..1a0eb15 100644 (file)
@@ -163,10 +163,8 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*);
-#if ENABLE(TEST_INTERFACE)
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
-#endif // ENABLE(TEST_INTERFACE)
 };
 
 /* Hash table */
@@ -264,7 +262,7 @@ COMPILE_ASSERT(1 == TestSupplemental::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSU
 COMPILE_ASSERT(2 == TestSupplemental::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
 #endif
 
-EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::construct(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestInterfaceConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -304,13 +302,15 @@ void JSTestInterfaceConstructor::finishCreation(VM& vm, JSDOMGlobalObject& globa
     reifyStaticProperties(vm, JSTestInterfaceConstructorTableValues, *this);
 }
 
-#if ENABLE(TEST_INTERFACE)
 ConstructType JSTestInterfaceConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestInterface;
+#if ENABLE(TEST_INTERFACE)
+    constructData.native.function = construct;
     return ConstructTypeHost;
+#else
+    return Base::getConstructData(cell, constructData);
+#endif
 }
-#endif // ENABLE(TEST_INTERFACE)
 
 /* Hash table for prototype */
 
index 4663b0b..aaf68d7 100644 (file)
@@ -78,11 +78,11 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestJSBuiltinConstructor(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
-JSC::EncodedJSValue JSC_HOST_CALL JSTestJSBuiltinConstructorConstructor::constructJSTestJSBuiltinConstructor(JSC::ExecState* state)
+JSC::EncodedJSValue JSC_HOST_CALL JSTestJSBuiltinConstructorConstructor::construct(JSC::ExecState* state)
 {
     auto* castedThis = jsCast<JSTestJSBuiltinConstructorConstructor*>(state->callee());
     return createJSBuiltin<JSTestJSBuiltinConstructor>(*state, *castedThis->initializeFunction(), *castedThis->globalObject());
@@ -107,7 +107,7 @@ void JSTestJSBuiltinConstructorConstructor::finishCreation(VM& vm, JSDOMGlobalOb
 
 ConstructType JSTestJSBuiltinConstructorConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestJSBuiltinConstructor;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index dc95211..92eb131 100644 (file)
@@ -101,7 +101,7 @@ public:
 
 private:
     JSTestNamedConstructorNamedConstructor(JSC::Structure*, JSDOMGlobalObject&);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestNamedConstructor(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
     void finishCreation(JSC::VM&, JSDOMGlobalObject&);
 };
@@ -122,7 +122,7 @@ void JSTestNamedConstructorConstructor::finishCreation(VM& vm, JSDOMGlobalObject
     putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor::construct(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestNamedConstructorNamedConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -163,7 +163,7 @@ void JSTestNamedConstructorNamedConstructor::finishCreation(VM& vm, JSDOMGlobalO
 
 ConstructType JSTestNamedConstructorNamedConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestNamedConstructor;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index 0dfefbd..ff7bc4d 100644 (file)
@@ -83,11 +83,11 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestNode(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
-EncodedJSValue JSC_HOST_CALL JSTestNodeConstructor::constructJSTestNode(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestNodeConstructor::construct(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestNodeConstructor*>(state->callee());
     RefPtr<TestNode> object = TestNode::create();
@@ -112,7 +112,7 @@ void JSTestNodeConstructor::finishCreation(VM& vm, JSDOMGlobalObject& globalObje
 
 ConstructType JSTestNodeConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestNode;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index 415b2dd..be20378 100644 (file)
@@ -365,7 +365,7 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestObj(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
@@ -468,7 +468,7 @@ COMPILE_ASSERT(0x1abc == TestObj::CONST_VALUE_14, TestObjEnumCONST_VALUE_14IsWro
 COMPILE_ASSERT(15 == TestObj::CONST_IMPL, TestObjEnumCONST_IMPLIsWrongUseDoNotCheckConstants);
 COMPILE_ASSERT(0 == TestObj::readonly, TestObjEnumreadonlyIsWrongUseDoNotCheckConstants);
 
-EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::constructJSTestObj(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::construct(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestObjConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 2))
@@ -502,7 +502,7 @@ void JSTestObjConstructor::finishCreation(VM& vm, JSDOMGlobalObject& globalObjec
 
 ConstructType JSTestObjConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestObj;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index 6ac5fa3..167e475 100644 (file)
@@ -80,16 +80,11 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors(JSC::ExecState*);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors1(JSC::ExecState*);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors2(JSC::ExecState*);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors3(JSC::ExecState*);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors4(JSC::ExecState*);
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestOverloadedConstructors5(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors1(ExecState* state)
+static inline EncodedJSValue constructJSTestOverloadedConstructors1(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -101,7 +96,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors2(ExecState* state)
+static inline EncodedJSValue constructJSTestOverloadedConstructors2(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -113,7 +108,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors3(ExecState* state)
+static inline EncodedJSValue constructJSTestOverloadedConstructors3(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -125,7 +120,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4(ExecState* state)
+static inline EncodedJSValue constructJSTestOverloadedConstructors4(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 1))
@@ -137,7 +132,7 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5(ExecState* state)
+static inline EncodedJSValue constructJSTestOverloadedConstructors5(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(state->callee());
     Vector<int> longArgs = toNativeArguments<int>(state, 0);
@@ -147,20 +142,20 @@ EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJ
     return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get())));
 }
 
-EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::construct(ExecState* state)
 {
     size_t argsCount = std::min<size_t>(1, state->argumentCount());
     JSValue arg0(state->argument(0));
     if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSArrayBuffer::info())))))
-        return JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors1(state);
+        return constructJSTestOverloadedConstructors1(state);
     if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSArrayBufferView::info())))))
-        return JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors2(state);
+        return constructJSTestOverloadedConstructors2(state);
     if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSBlob::info())))))
-        return JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors3(state);
+        return constructJSTestOverloadedConstructors3(state);
     if (argsCount == 1)
-        return JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4(state);
+        return constructJSTestOverloadedConstructors4(state);
     if ()
-        return JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors5(state);
+        return constructJSTestOverloadedConstructors5(state);
     if (argsCount < 1)
         return throwVMError(state, createNotEnoughArgumentsError(state));
     return throwVMTypeError(state);
@@ -184,7 +179,7 @@ void JSTestOverloadedConstructorsConstructor::finishCreation(VM& vm, JSDOMGlobal
 
 ConstructType JSTestOverloadedConstructorsConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestOverloadedConstructors;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }
 
index dc459f9..bcb99d9 100644 (file)
@@ -117,7 +117,7 @@ public:
         return JSC::Structure::create(vm, &globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 protected:
-    static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestTypedefs(JSC::ExecState*);
+    static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
     static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
 };
 
@@ -142,7 +142,7 @@ static const HashTableValue JSTestTypedefsConstructorTableValues[] =
     { "TestSubObj", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestTypedefsConstructorTestSubObj), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
 };
 
-EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::constructJSTestTypedefs(ExecState* state)
+EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::construct(ExecState* state)
 {
     auto* castedThis = jsCast<JSTestTypedefsConstructor*>(state->callee());
     if (UNLIKELY(state->argumentCount() < 2))
@@ -176,7 +176,7 @@ void JSTestTypedefsConstructor::finishCreation(VM& vm, JSDOMGlobalObject& global
 
 ConstructType JSTestTypedefsConstructor::getConstructData(JSCell*, ConstructData& constructData)
 {
-    constructData.native.function = constructJSTestTypedefs;
+    constructData.native.function = construct;
     return ConstructTypeHost;
 }