Title: [147480] trunk/Source/WebCore
Revision
147480
Author
[email protected]
Date
2013-04-02 11:54:53 -0700 (Tue, 02 Apr 2013)

Log Message

Unreviewed, rolling out r147464.
http://trac.webkit.org/changeset/147464
https://bugs.webkit.org/show_bug.cgi?id=113812

JSSQLResultSet.cpp:131:24: error: implicit conversion loses
integer precision: 'int64_t' (aka 'long long') to 'int'
[-Werror,-Wshorten-64-to-32] (Requested by xenon on #webkit).

Patch by Sheriff Bot <[email protected]> on 2013-04-02

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjAttrWithGetterException):
(WebCore::jsTestObjStringAttrWithGetterException):
(WebCore::jsTestObjWithScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjNullableDoubleAttribute):
(WebCore::jsTestObjNullableLongAttribute):
(WebCore::jsTestObjNullableBooleanAttribute):
(WebCore::jsTestObjNullableStringAttribute):
(WebCore::jsTestObjNullableLongSettableAttribute):
(WebCore::jsTestObjNullableStringValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsAttrWithGetterException):
(WebCore::jsTestTypedefsStringAttrWithGetterException):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (147479 => 147480)


--- trunk/Source/WebCore/ChangeLog	2013-04-02 18:42:10 UTC (rev 147479)
+++ trunk/Source/WebCore/ChangeLog	2013-04-02 18:54:53 UTC (rev 147480)
@@ -1,3 +1,31 @@
+2013-04-02  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r147464.
+        http://trac.webkit.org/changeset/147464
+        https://bugs.webkit.org/show_bug.cgi?id=113812
+
+        JSSQLResultSet.cpp:131:24: error: implicit conversion loses
+        integer precision: 'int64_t' (aka 'long long') to 'int'
+        [-Werror,-Wshorten-64-to-32] (Requested by xenon on #webkit).
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjAttrWithGetterException):
+        (WebCore::jsTestObjStringAttrWithGetterException):
+        (WebCore::jsTestObjWithScriptStateAttributeRaises):
+        (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
+        (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+        (WebCore::jsTestObjNullableDoubleAttribute):
+        (WebCore::jsTestObjNullableLongAttribute):
+        (WebCore::jsTestObjNullableBooleanAttribute):
+        (WebCore::jsTestObjNullableStringAttribute):
+        (WebCore::jsTestObjNullableLongSettableAttribute):
+        (WebCore::jsTestObjNullableStringValue):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsAttrWithGetterException):
+        (WebCore::jsTestTypedefsStringAttrWithGetterException):
+
 2013-04-02  Andrey Lushnikov  <[email protected]>
 
         Web Inspector: Make Source Frame & status bar a layout boundary

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (147479 => 147480)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-04-02 18:42:10 UTC (rev 147479)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-04-02 18:54:53 UTC (rev 147480)
@@ -1823,7 +1823,6 @@
                 my $name = $attribute->signature->name;
                 my $type = $attribute->signature->type;
                 my $isNullable = $attribute->signature->isNullable;
-                my $isCachedAttribute = $attribute->signature->extendedAttributes->{"CachedAttribute"};
                 $codeGenerator->AssertNotSequenceType($type);
                 my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $attribute);
                 my $implGetterFunctionName = $codeGenerator->WK_lcfirst($name);
@@ -1840,7 +1839,7 @@
                     push(@implContent, "    UNUSED_PARAM(slotBase);\n");
                 }
 
-                if ($isCachedAttribute) {
+                if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
                     $needsMarkChildren = 1;
                 }
 
@@ -1889,7 +1888,7 @@
                     push(@implContent, "    bool isNull = false;\n") if $isNullable;
 
                     my $cacheIndex = 0;
-                    if ($isCachedAttribute) {
+                    if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
                         $cacheIndex = $currentCachedAttribute;
                         $currentCachedAttribute++;
                         push(@implContent, "    if (JSValue cachedValue = castedThis->m_" . $attribute->signature->name . ".get())\n");
@@ -1897,7 +1896,6 @@
                     }
 
                     my @callWithArgs = GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()");
-                    my $returnValue = "result";
 
                     if ($svgListPropertyType) {
                         push(@implContent, "    JSValue result =  " . NativeToJSValue($attribute->signature, 0, $interfaceName, "castedThis->impl()->$implGetterFunctionName(" . (join ", ", @callWithArgs) . ")", "castedThis") . ";\n");
@@ -1925,30 +1923,23 @@
 
                         unshift(@arguments, @callWithArgs);
 
+                        my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
                         push(@implContent, "    $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n") if !$attribute->isStatic;
+                        if ($codeGenerator->IsSVGAnimatedType($type)) {
+                            push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
+                            push(@implContent, "    JSValue result =  toJS(exec, castedThis->globalObject(), obj.get());\n");
+                        } else {
+                            push(@implContent, "    JSValue result = $jsType;\n");
+                        }
+
                         if ($isNullable) {
-                            my $nativeType = GetNativeType($type);
-                            push(@implContent, "    $nativeType nativeResult = " . NativeValueToLocal("$functionName(" . join(", ", @arguments) . ")", $nativeType) . ";\n");
                             push(@implContent, "    if (isNull)\n");
                             push(@implContent, "        return jsNull();\n");
-                            if ($isCachedAttribute) {
-                                push(@implContent, "    JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "nativeResult", "castedThis") . ";\n");
-                            } else {
-                                $returnValue = NativeToJSValue($attribute->signature, 0, $interfaceName, "nativeResult", "castedThis");
-                            }
-                        } else {
-                            my $jsType = NativeToJSValue($attribute->signature, 0, $interfaceName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
-                            if ($codeGenerator->IsSVGAnimatedType($type)) {
-                                push(@implContent, "    RefPtr<$type> obj = $jsType;\n");
-                                push(@implContent, "    JSValue result = toJS(exec, castedThis->globalObject(), obj.get());\n");
-                            } else {
-                                push(@implContent, "    JSValue result = $jsType;\n");
-                            }
                         }
                     }
 
-                    push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if $isCachedAttribute;
-                    push(@implContent, "    return $returnValue;\n");
+                    push(@implContent, "    castedThis->m_" . $attribute->signature->name . ".set(exec->globalData(), castedThis, result);\n") if ($attribute->signature->extendedAttributes->{"CachedAttribute"});
+                    push(@implContent, "    return result;\n");
 
                 } else {
                     my @arguments = ("ec");
@@ -1960,14 +1951,13 @@
                     }
 
                     unshift(@arguments, GenerateCallWith($attribute->signature->extendedAttributes->{"CallWith"}, \@implContent, "jsUndefined()"));
-                    my $nativeType = GetNativeType($type);
 
                     if ($svgPropertyOrListPropertyType) {
                         push(@implContent, "    $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
-                        push(@implContent, "    $nativeType nativeResult = " . NativeValueToLocal("impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", $nativeType) . ";\n");
+                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
                     } else {
                         push(@implContent, "    $interfaceName* impl = static_cast<$interfaceName*>(castedThis->impl());\n");
-                        push(@implContent, "    $nativeType nativeResult = " . NativeValueToLocal("impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", $nativeType) . ";\n");
+                        push(@implContent, "    JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $interfaceName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
                     }
 
                     if ($isNullable) {
@@ -1976,7 +1966,7 @@
                     }
 
                     push(@implContent, "    setDOMException(exec, ec);\n");
-                    push(@implContent, "    return " . NativeToJSValue($attribute->signature, 0, $interfaceName, "nativeResult", "castedThis") . ";\n");
+                    push(@implContent, "    return result;\n");
                 }
 
                 push(@implContent, "}\n\n");
@@ -3207,15 +3197,6 @@
     return exists $nativeType{$type};
 }
 
-sub NativeValueToLocal
-{
-    my $value = shift;
-    my $type = shift;
-
-    return "WTF::getPtr($value)" if $type =~ /\*$/;
-    return $value;
-}
-
 sub JSValueToNative
 {
     my $signature = shift;

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (147479 => 147480)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2013-04-02 18:42:10 UTC (rev 147479)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2013-04-02 18:54:53 UTC (rev 147480)
@@ -657,9 +657,9 @@
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    int nativeResult = impl->attrWithGetterException(ec);
+    JSC::JSValue result = jsNumber(impl->attrWithGetterException(ec));
     setDOMException(exec, ec);
-    return jsNumber(nativeResult);
+    return result;
 }
 
 
@@ -678,9 +678,9 @@
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    const String& nativeResult = impl->stringAttrWithGetterException(ec);
+    JSC::JSValue result = jsStringWithCache(exec, impl->stringAttrWithGetterException(ec));
     setDOMException(exec, ec);
-    return jsStringWithCache(exec, nativeResult);
+    return result;
 }
 
 
@@ -727,9 +727,9 @@
     JSTestObj* castedThis = jsCast<JSTestObj*>(asObject(slotBase));
     ExceptionCode ec = 0;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    TestObj* nativeResult = WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec)));
     setDOMException(exec, ec);
-    return toJS(exec, castedThis->globalObject(), WTF::getPtr(nativeResult));
+    return result;
 }
 
 
@@ -741,9 +741,9 @@
     if (!scriptContext)
         return jsUndefined();
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    TestObj* nativeResult = WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec)));
     setDOMException(exec, ec);
-    return toJS(exec, castedThis->globalObject(), WTF::getPtr(nativeResult));
+    return result;
 }
 
 
@@ -767,9 +767,9 @@
     if (!scriptContext)
         return jsUndefined();
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    TestObj* nativeResult = WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec));
+    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAndScriptStateAttributeRaises(exec, scriptContext, ec)));
     setDOMException(exec, ec);
-    return toJS(exec, castedThis->globalObject(), WTF::getPtr(nativeResult));
+    return result;
 }
 
 
@@ -987,10 +987,10 @@
     UNUSED_PARAM(exec);
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    double nativeResult = impl->nullableDoubleAttribute(isNull);
+    JSValue result = jsNumber(impl->nullableDoubleAttribute(isNull));
     if (isNull)
         return jsNull();
-    return jsNumber(nativeResult);
+    return result;
 }
 
 
@@ -1000,10 +1000,10 @@
     UNUSED_PARAM(exec);
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    int nativeResult = impl->nullableLongAttribute(isNull);
+    JSValue result = jsNumber(impl->nullableLongAttribute(isNull));
     if (isNull)
         return jsNull();
-    return jsNumber(nativeResult);
+    return result;
 }
 
 
@@ -1013,10 +1013,10 @@
     UNUSED_PARAM(exec);
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    bool nativeResult = impl->nullableBooleanAttribute(isNull);
+    JSValue result = jsBoolean(impl->nullableBooleanAttribute(isNull));
     if (isNull)
         return jsNull();
-    return jsBoolean(nativeResult);
+    return result;
 }
 
 
@@ -1026,10 +1026,10 @@
     UNUSED_PARAM(exec);
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    const String& nativeResult = impl->nullableStringAttribute(isNull);
+    JSValue result = jsStringWithCache(exec, impl->nullableStringAttribute(isNull));
     if (isNull)
         return jsNull();
-    return jsStringWithCache(exec, nativeResult);
+    return result;
 }
 
 
@@ -1039,10 +1039,10 @@
     UNUSED_PARAM(exec);
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    int nativeResult = impl->nullableLongSettableAttribute(isNull);
+    JSValue result = jsNumber(impl->nullableLongSettableAttribute(isNull));
     if (isNull)
         return jsNull();
-    return jsNumber(nativeResult);
+    return result;
 }
 
 
@@ -1052,11 +1052,11 @@
     ExceptionCode ec = 0;
     bool isNull = false;
     TestObj* impl = static_cast<TestObj*>(castedThis->impl());
-    int nativeResult = impl->nullableStringValue(isNull, ec);
+    JSC::JSValue result = jsNumber(impl->nullableStringValue(isNull, ec));
     if (isNull)
         return jsNull();
     setDOMException(exec, ec);
-    return jsNumber(nativeResult);
+    return result;
 }
 
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (147479 => 147480)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp	2013-04-02 18:42:10 UTC (rev 147479)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp	2013-04-02 18:54:53 UTC (rev 147480)
@@ -225,9 +225,9 @@
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(asObject(slotBase));
     ExceptionCode ec = 0;
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    int nativeResult = impl->attrWithGetterException(ec);
+    JSC::JSValue result = jsNumber(impl->attrWithGetterException(ec));
     setDOMException(exec, ec);
-    return jsNumber(nativeResult);
+    return result;
 }
 
 
@@ -246,9 +246,9 @@
     JSTestTypedefs* castedThis = jsCast<JSTestTypedefs*>(asObject(slotBase));
     ExceptionCode ec = 0;
     TestTypedefs* impl = static_cast<TestTypedefs*>(castedThis->impl());
-    const String& nativeResult = impl->stringAttrWithGetterException(ec);
+    JSC::JSValue result = jsStringWithCache(exec, impl->stringAttrWithGetterException(ec));
     setDOMException(exec, ec);
-    return jsStringWithCache(exec, nativeResult);
+    return result;
 }
 
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to