Ignore:
Timestamp:
May 23, 2012, 5:05:21 PM (13 years ago)
Author:
[email protected]
Message:

DFG should be able to optimize foo.apply(bar, arguments)
https://bugs.webkit.org/show_bug.cgi?id=86306

Reviewed by Gavin Barraclough.

Merge r116912 from dfgopt.

Enables compilation of op_jneq_ptr and some forms of op_call_varargs.

Also includes a bunch of bug fixes that were made necessary by the increased
pressure on the CFG simplifier.

This is a 1-2% win on V8.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::printCallOp):
(JSC::CodeBlock::CodeBlock):
(JSC::ProgramCodeBlock::canCompileWithDFGInternal):
(JSC::EvalCodeBlock::canCompileWithDFGInternal):
(JSC::FunctionCodeBlock::canCompileWithDFGInternal):

  • bytecode/CodeBlock.h:

(CodeBlock):
(JSC::CodeBlock::canCompileWithDFG):
(JSC::CodeBlock::canCompileWithDFGState):
(ProgramCodeBlock):
(EvalCodeBlock):
(FunctionCodeBlock):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::processPhiStack):
(JSC::DFG::ByteCodeParser::parse):

  • dfg/DFGCFGSimplificationPhase.cpp:

(JSC::DFG::CFGSimplificationPhase::run):
(JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
(JSC::DFG::CFGSimplificationPhase::fixTailOperand):
(JSC::DFG::CFGSimplificationPhase::mergeBlocks):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::getLocalLoadElimination):
(CSEPhase):
(JSC::DFG::CSEPhase::setReplacement):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGCapabilities.cpp:

(JSC::DFG::debugFail):
(DFG):
(JSC::DFG::canHandleOpcodes):
(JSC::DFG::canCompileOpcodes):
(JSC::DFG::canInlineOpcodes):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canCompileOpcode):
(JSC::DFG::canInlineOpcode):
(DFG):
(JSC::DFG::canCompileOpcodes):
(JSC::DFG::canCompileEval):
(JSC::DFG::canCompileProgram):
(JSC::DFG::canCompileFunctionForCall):
(JSC::DFG::canCompileFunctionForConstruct):

  • dfg/DFGCommon.h:
  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGSpeculativeJIT32_64.cpp:

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

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGValidate.cpp:

(Validate):
(JSC::DFG::Validate::validate):
(JSC::DFG::Validate::checkOperand):
(JSC::DFG::Validate::reportValidationContext):

  • jit/JIT.cpp:

(JSC::JIT::emitOptimizationCheck):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::privateCompile):

  • jit/JIT.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::compileBinaryArithOp):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::privateCompilePutByIdTransition):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::privateCompilePutByIdTransition):

  • tools/CodeProfile.cpp:

(JSC::CodeProfile::sample):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r117198 r118270  
    9797void JIT::emitOptimizationCheck(OptimizationCheckKind kind)
    9898{
    99     if (!shouldEmitProfiling())
     99    if (!canBeOptimized())
    100100        return;
    101101   
     
    418418#if ENABLE(VALUE_PROFILER)
    419419        RareCaseProfile* rareCaseProfile = 0;
    420         if (m_canBeOptimized)
     420        if (shouldEmitProfiling())
    421421            rareCaseProfile = m_codeBlock->addRareCaseProfile(m_bytecodeOffset);
    422422#endif
     
    498498       
    499499#if ENABLE(VALUE_PROFILER)
    500         if (m_canBeOptimized)
     500        if (shouldEmitProfiling())
    501501            add32(TrustedImm32(1), AbsoluteAddress(&rareCaseProfile->m_counter));
    502502#endif
     
    566566   
    567567#if ENABLE(VALUE_PROFILER)
    568     m_canBeOptimized = m_codeBlock->canCompileWithDFG();
     568    DFG::CapabilityLevel level = m_codeBlock->canCompileWithDFG();
     569    switch (level) {
     570    case DFG::CannotCompile:
     571        m_canBeOptimized = false;
     572        m_shouldEmitProfiling = false;
     573        break;
     574    case DFG::ShouldProfile:
     575        m_canBeOptimized = false;
     576        m_shouldEmitProfiling = true;
     577        break;
     578    case DFG::CanCompile:
     579        m_canBeOptimized = true;
     580        m_shouldEmitProfiling = true;
     581        break;
     582    default:
     583        ASSERT_NOT_REACHED();
     584        break;
     585    }
    569586#endif
    570587
     
    620637   
    621638#if ENABLE(VALUE_PROFILER)
    622     if (m_canBeOptimized)
     639    if (canBeOptimized())
    623640        add32(TrustedImm32(1), AbsoluteAddress(&m_codeBlock->m_executionEntryCount));
    624641#endif
Note: See TracChangeset for help on using the changeset viewer.