Ignore:
Timestamp:
Sep 17, 2013, 6:04:31 PM (12 years ago)
Author:
[email protected]
Message:

DFG should use the (x & 0x7fffffff) trick for doing overflow and neg-zero checks on negation in one go
https://bugs.webkit.org/show_bug.cgi?id=121520

Reviewed by Oliver Hunt.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileArithNegate):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileArithNegate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r155783 r156016  
    30913091        if (bytecodeCanTruncateInteger(node->arithNodeFlags()))
    30923092            m_jit.neg32(result.gpr());
     3093        else if (bytecodeCanIgnoreNegativeZero(node->arithNodeFlags()))
     3094            speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchNeg32(MacroAssembler::Overflow, result.gpr()));
    30933095        else {
    3094             speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchNeg32(MacroAssembler::Overflow, result.gpr()));
    3095             if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags()))
    3096                 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(MacroAssembler::Zero, result.gpr()));
     3096            speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchTest32(MacroAssembler::Zero, result.gpr(), TrustedImm32(0x7fffffff)));
     3097            m_jit.neg32(result.gpr());
    30973098        }
    30983099
Note: See TracChangeset for help on using the changeset viewer.