Ignore:
Timestamp:
Dec 13, 2011, 5:46:36 PM (13 years ago)
Author:
[email protected]
Message:

DFG OSR exit for UInt32ToNumber should roll forward, not roll backward
https://bugs.webkit.org/show_bug.cgi?id=74463

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

Implements roll-forward OSR exit for UInt32ToNumber, which requires ValueRecoveries knowing
how to execute the slow path of UInt32ToNumber.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::lastOSRExit):

  • bytecode/CodeOrigin.h:

(JSC::CodeOrigin::operator!=):

  • bytecode/ValueRecovery.h:

(JSC::ValueRecovery::uint32InGPR):
(JSC::ValueRecovery::gpr):
(JSC::ValueRecovery::dump):

  • dfg/DFGAssemblyHelpers.cpp:
  • dfg/DFGAssemblyHelpers.h:
  • dfg/DFGOSRExit.h:

(JSC::DFG::OSRExit::valueRecoveryForOperand):

  • dfg/DFGOSRExitCompiler32_64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::nonSpeculativeUInt32ToNumber):
(JSC::DFG::SpeculativeJIT::compile):

LayoutTests:

Reviewed by Gavin Barraclough.

  • fast/js/dfg-uint32-to-number-expected.txt: Added.
  • fast/js/dfg-uint32-to-number.html: Added.
  • fast/js/script-tests/dfg-uint32-to-number.js: Added.

(foo):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/ValueRecovery.h

    r102706 r102723  
    5656#endif
    5757    InFPR,
     58    UInt32InGPR,
    5859    // It's in the register file, but at a different location.
    5960    DisplacedInRegisterFile,
     
    119120    }
    120121   
     122    static ValueRecovery uint32InGPR(MacroAssembler::RegisterID gpr)
     123    {
     124        ValueRecovery result;
     125        result.m_technique = UInt32InGPR;
     126        result.m_source.gpr = gpr;
     127        return result;
     128    }
     129   
    121130#if USE(JSVALUE32_64)
    122131    static ValueRecovery inPair(MacroAssembler::RegisterID tagGPR, MacroAssembler::RegisterID payloadGPR)
     
    187196    MacroAssembler::RegisterID gpr() const
    188197    {
    189         ASSERT(m_technique == InGPR || m_technique == UnboxedInt32InGPR || m_technique == UnboxedBooleanInGPR);
     198        ASSERT(m_technique == InGPR || m_technique == UnboxedInt32InGPR || m_technique == UnboxedBooleanInGPR || m_technique == UInt32InGPR);
    190199        return m_source.gpr;
    191200    }
     
    248257            fprintf(out, "bool(%%r%d)", gpr());
    249258            break;
     259        case UInt32InGPR:
     260            fprintf(out, "uint32(%%r%d)", gpr());
     261            break;
    250262        case InFPR:
    251             fprintf(out, "%%r%d", fpr());
     263            fprintf(out, "%%fr%d", fpr());
    252264            break;
    253265#if USE(JSVALUE32_64)
Note: See TracChangeset for help on using the changeset viewer.