Title: [239552] trunk/Source/_javascript_Core
Revision
239552
Author
[email protected]
Date
2018-12-25 23:52:38 -0800 (Tue, 25 Dec 2018)

Log Message

[JSC][Win][Clang] warning: implicit conversion from 'size_t' (aka 'unsigned long long') to 'int32_t' (aka 'int') changes value from 18446744073709551552 to -64 [-Wconstant-conversion]
https://bugs.webkit.org/show_bug.cgi?id=193035

Reviewed by Yusuke Suzuki.

Clang-cl reports a compilation warning for implicit conversion
from -64 size_t to int. Replaced '-maxFrameExtentForSlowPathCall'
with '-static_cast<int32_t>(maxFrameExtentForSlowPathCall)'.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/ThunkGenerators.cpp:
(JSC::slowPathFor):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (239551 => 239552)


--- trunk/Source/_javascript_Core/ChangeLog	2018-12-25 04:40:16 UTC (rev 239551)
+++ trunk/Source/_javascript_Core/ChangeLog	2018-12-26 07:52:38 UTC (rev 239552)
@@ -1,3 +1,22 @@
+2018-12-25  Fujii Hironori  <[email protected]>
+
+        [JSC][Win][Clang] warning: implicit conversion from 'size_t' (aka 'unsigned long long') to 'int32_t' (aka 'int') changes value from 18446744073709551552 to -64 [-Wconstant-conversion]
+        https://bugs.webkit.org/show_bug.cgi?id=193035
+
+        Reviewed by Yusuke Suzuki.
+
+        Clang-cl reports a compilation warning for implicit conversion
+        from -64 size_t to int. Replaced '-maxFrameExtentForSlowPathCall'
+        with '-static_cast<int32_t>(maxFrameExtentForSlowPathCall)'.
+
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::compile):
+        (JSC::DFG::JITCompiler::compileFunction):
+        * jit/JIT.cpp:
+        (JSC::JIT::compileWithoutLinking):
+        * jit/ThunkGenerators.cpp:
+        (JSC::slowPathFor):
+
 2018-12-13  Yusuke Suzuki  <[email protected]>
 
         [BigInt] Support BigInt in JSON.stringify

Modified: trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (239551 => 239552)


--- trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-12-25 04:40:16 UTC (rev 239551)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp	2018-12-26 07:52:38 UTC (rev 239552)
@@ -387,7 +387,7 @@
     emitStoreCodeOrigin(CodeOrigin(0));
 
     if (maxFrameExtentForSlowPathCall)
-        addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
 
     m_speculative->callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
 
@@ -463,7 +463,7 @@
     emitStoreCodeOrigin(CodeOrigin(0));
 
     if (maxFrameExtentForSlowPathCall)
-        addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
 
     m_speculative->callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
     
@@ -483,7 +483,7 @@
         branch32(AboveOrEqual, GPRInfo::regT1, TrustedImm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this);
         emitStoreCodeOrigin(CodeOrigin(0));
         if (maxFrameExtentForSlowPathCall)
-            addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+            addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
         m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::regT0);
         if (maxFrameExtentForSlowPathCall)
             addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister);

Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (239551 => 239552)


--- trunk/Source/_javascript_Core/jit/JIT.cpp	2018-12-25 04:40:16 UTC (rev 239551)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp	2018-12-26 07:52:38 UTC (rev 239552)
@@ -729,7 +729,7 @@
     stackOverflow.link(this);
     m_bytecodeOffset = 0;
     if (maxFrameExtentForSlowPathCall)
-        addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
     callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
 
     // If the number of parameters is 1, we never require arity fixup.
@@ -746,7 +746,7 @@
         m_bytecodeOffset = 0;
 
         if (maxFrameExtentForSlowPathCall)
-            addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
+            addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
         callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck);
         if (maxFrameExtentForSlowPathCall)
             addPtr(TrustedImm32(maxFrameExtentForSlowPathCall), stackPointerRegister);

Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (239551 => 239552)


--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2018-12-25 04:40:16 UTC (rev 239551)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2018-12-26 07:52:38 UTC (rev 239552)
@@ -90,7 +90,7 @@
     // Other argument values are shift by 1. Use space on the stack for our two return values.
     // Moving the stack down maxFrameExtentForSlowPathCall bytes gives us room for our 3 arguments
     // and space for the 16 byte return area.
-    jit.addPtr(CCallHelpers::TrustedImm32(-maxFrameExtentForSlowPathCall), CCallHelpers::stackPointerRegister);
+    jit.addPtr(CCallHelpers::TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), CCallHelpers::stackPointerRegister);
     jit.move(GPRInfo::regT2, GPRInfo::argumentGPR2);
     jit.addPtr(CCallHelpers::TrustedImm32(32), CCallHelpers::stackPointerRegister, GPRInfo::argumentGPR0);
     jit.move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to