Changeset 239552 in webkit


Ignore:
Timestamp:
Dec 25, 2018 11:52:38 PM (5 years ago)
Author:
Fujii Hironori
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):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r239544 r239552  
     12018-12-25  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [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]
     4        https://bugs.webkit.org/show_bug.cgi?id=193035
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Clang-cl reports a compilation warning for implicit conversion
     9        from -64 size_t to int. Replaced '-maxFrameExtentForSlowPathCall'
     10        with '-static_cast<int32_t>(maxFrameExtentForSlowPathCall)'.
     11
     12        * dfg/DFGJITCompiler.cpp:
     13        (JSC::DFG::JITCompiler::compile):
     14        (JSC::DFG::JITCompiler::compileFunction):
     15        * jit/JIT.cpp:
     16        (JSC::JIT::compileWithoutLinking):
     17        * jit/ThunkGenerators.cpp:
     18        (JSC::slowPathFor):
     19
    1202018-12-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    221
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp

    r236585 r239552  
    388388
    389389    if (maxFrameExtentForSlowPathCall)
    390         addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
     390        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
    391391
    392392    m_speculative->callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
     
    464464
    465465    if (maxFrameExtentForSlowPathCall)
    466         addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
     466        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
    467467
    468468    m_speculative->callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
     
    484484        emitStoreCodeOrigin(CodeOrigin(0));
    485485        if (maxFrameExtentForSlowPathCall)
    486             addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
     486            addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
    487487        m_speculative->callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck, GPRInfo::regT0);
    488488        if (maxFrameExtentForSlowPathCall)
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r239188 r239552  
    730730    m_bytecodeOffset = 0;
    731731    if (maxFrameExtentForSlowPathCall)
    732         addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
     732        addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
    733733    callOperationWithCallFrameRollbackOnException(operationThrowStackOverflowError, m_codeBlock);
    734734
     
    747747
    748748        if (maxFrameExtentForSlowPathCall)
    749             addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
     749            addPtr(TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), stackPointerRegister);
    750750        callOperationWithCallFrameRollbackOnException(m_codeBlock->m_isConstructor ? operationConstructArityCheck : operationCallArityCheck);
    751751        if (maxFrameExtentForSlowPathCall)
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r238439 r239552  
    9191    // Moving the stack down maxFrameExtentForSlowPathCall bytes gives us room for our 3 arguments
    9292    // and space for the 16 byte return area.
    93     jit.addPtr(CCallHelpers::TrustedImm32(-maxFrameExtentForSlowPathCall), CCallHelpers::stackPointerRegister);
     93    jit.addPtr(CCallHelpers::TrustedImm32(-static_cast<int32_t>(maxFrameExtentForSlowPathCall)), CCallHelpers::stackPointerRegister);
    9494    jit.move(GPRInfo::regT2, GPRInfo::argumentGPR2);
    9595    jit.addPtr(CCallHelpers::TrustedImm32(32), CCallHelpers::stackPointerRegister, GPRInfo::argumentGPR0);
Note: See TracChangeset for help on using the changeset viewer.