Ignore:
Timestamp:
Apr 29, 2019, 8:27:39 PM (6 years ago)
Author:
[email protected]
Message:

Make JITType an enum class
https://bugs.webkit.org/show_bug.cgi?id=197394

Reviewed by Yusuke Suzuki.

This makes the code more easily searchable.

  • bytecode/CallLinkStatus.cpp:

(JSC::CallLinkStatus::computeFor):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpAssumingJITType const):
(JSC::CodeBlock::specialOSREntryBlockOrNull):
(JSC::timeToLive):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::baselineAlternative):
(JSC::CodeBlock::baselineVersion):
(JSC::CodeBlock::hasOptimizedReplacement):
(JSC::CodeBlock::noticeIncomingCall):
(JSC::CodeBlock::setOptimizationThresholdBasedOnCompilationResult):
(JSC::CodeBlock::tallyFrequentExitSites):
(JSC::CodeBlock::frameRegisterCount):
(JSC::CodeBlock::bytecodeOffsetFromCallSiteIndex):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::jitType const):
(JSC::CodeBlock::hasBaselineJITProfiling const):

  • bytecode/CodeBlockWithJITType.h:

(JSC::CodeBlockWithJITType::CodeBlockWithJITType):

  • bytecode/DeferredSourceDump.cpp:

(JSC::DeferredSourceDump::DeferredSourceDump):

  • bytecode/DeferredSourceDump.h:
  • bytecode/ExitingJITType.h:

(JSC::exitingJITTypeFor):

  • bytecode/InlineCallFrame.h:

(JSC::baselineCodeBlockForOriginAndBaselineCodeBlock):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseCodeBlock):

  • dfg/DFGDisassembler.cpp:

(JSC::DFG::Disassembler::dumpHeader):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compileImpl):

  • dfg/DFGGraph.cpp:

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

  • dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::JITCode):
(JSC::DFG::JITCode::checkIfOptimizationThresholdReached):
(JSC::DFG::JITCode::optimizeNextInvocation):
(JSC::DFG::JITCode::dontOptimizeAnytimeSoon):
(JSC::DFG::JITCode::optimizeAfterWarmUp):
(JSC::DFG::JITCode::optimizeSoon):
(JSC::DFG::JITCode::forceOptimizationSlowPathConcurrently):
(JSC::DFG::JITCode::setOptimizationThresholdBasedOnCompilationResult):

  • dfg/DFGJITFinalizer.cpp:

(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):
(JSC::DFG::prepareCatchOSREntry):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::executeOSRExit):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::OSRExit::compileOSRExit):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::handleExitCounts):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):

  • dfg/DFGOSRExitCompilerCommon.h:

(JSC::DFG::adjustFrameAndStackInOSRExitCompilerThunk):

  • dfg/DFGOperations.cpp:
  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitGenerationThunkGenerator):

  • dfg/DFGVariableEventStream.cpp:

(JSC::DFG::VariableEventStream::reconstruct const):

  • ftl/FTLCompile.cpp:

(JSC::FTL::compile):

  • ftl/FTLJITCode.cpp:

(JSC::FTL::JITCode::JITCode):

  • ftl/FTLJITFinalizer.cpp:

(JSC::FTL::JITFinalizer::finalizeCommon):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileFTLOSRExit):

  • ftl/FTLThunks.cpp:

(JSC::FTL::genericGenerationThunkGenerator):

  • interpreter/CallFrame.cpp:

(JSC::CallFrame::callSiteBitsAreBytecodeOffset const):
(JSC::CallFrame::callSiteBitsAreCodeOriginIndex const):

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::dump const):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::AssemblyHelpers):

  • jit/JIT.cpp:

(JSC::JIT::link):

  • jit/JITCode.cpp:

(JSC::JITCode::typeName):
(WTF::printInternal):

  • jit/JITCode.h:

(JSC::JITCode::bottomTierJIT):
(JSC::JITCode::topTierJIT):
(JSC::JITCode::nextTierJIT):
(JSC::JITCode::isExecutableScript):
(JSC::JITCode::couldBeInterpreted):
(JSC::JITCode::isJIT):
(JSC::JITCode::isOptimizingJIT):
(JSC::JITCode::isBaselineCode):
(JSC::JITCode::jitTypeFor):

  • jit/JITDisassembler.cpp:

(JSC::JITDisassembler::dumpHeader):

  • jit/JITOperations.cpp:
  • jit/JITThunks.cpp:

(JSC::JITThunks::hostFunctionStub):

  • jit/JITToDFGDeferredCompilationCallback.cpp:

(JSC::JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously):
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):

  • jit/JITWorklist.cpp:

(JSC::JITWorklist::compileLater):
(JSC::JITWorklist::compileNow):

  • jit/Repatch.cpp:

(JSC::readPutICCallTarget):
(JSC::ftlThunkAwareRepatchCall):

  • llint/LLIntEntrypoint.cpp:

(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
(JSC::LLInt::setModuleProgramEntrypoint):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::processUnverifiedStackTraces):

  • runtime/SamplingProfiler.h:
  • runtime/VM.cpp:

(JSC::jitCodeForCallTrampoline):
(JSC::jitCodeForConstructTrampoline):

  • tools/CodeProfile.cpp:

(JSC::CodeProfile::sample):

  • tools/JSDollarVM.cpp:

(JSC::CallerFrameJITTypeFunctor::CallerFrameJITTypeFunctor):
(JSC::CallerFrameJITTypeFunctor::jitType):
(JSC::functionLLintTrue):
(JSC::functionJITTrue):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r244088 r244764  
    181181}
    182182
    183 void CodeBlock::dumpAssumingJITType(PrintStream& out, JITCode::JITType jitType) const
     183void CodeBlock::dumpAssumingJITType(PrintStream& out, JITType jitType) const
    184184{
    185185    out.print(inferredName(), "#", hashAsStringIfPossible());
     
    192192        out.print(specializationKind());
    193193    out.print(", ", instructionCount());
    194     if (this->jitType() == JITCode::BaselineJIT && m_shouldAlwaysBeInlined)
     194    if (this->jitType() == JITType::BaselineJIT && m_shouldAlwaysBeInlined)
    195195        out.print(" (ShouldAlwaysBeInlined)");
    196196    if (ownerExecutable()->neverInline())
     
    206206    if (m_didFailJITCompilation)
    207207        out.print(" (JITFail)");
    208     if (this->jitType() == JITCode::BaselineJIT && m_didFailFTLCompilation)
     208    if (this->jitType() == JITType::BaselineJIT && m_didFailFTLCompilation)
    209209        out.print(" (FTLFail)");
    210     if (this->jitType() == JITCode::BaselineJIT && m_hasBeenCompiledWithFTL)
     210    if (this->jitType() == JITType::BaselineJIT && m_hasBeenCompiledWithFTL)
    211211        out.print(" (HadFTLReplacement)");
    212212    out.print("]");
     
    930930{
    931931#if ENABLE(FTL_JIT)
    932     if (jitType() != JITCode::DFGJIT)
     932    if (jitType() != JITType::DFGJIT)
    933933        return 0;
    934934    DFG::JITCode* jitCode = m_jitCode->dfg();
     
    10031003}
    10041004
    1005 static Seconds timeToLive(JITCode::JITType jitType)
     1005static Seconds timeToLive(JITType jitType)
    10061006{
    10071007    if (UNLIKELY(Options::useEagerCodeBlockJettisonTiming())) {
    10081008        switch (jitType) {
    1009         case JITCode::InterpreterThunk:
     1009        case JITType::InterpreterThunk:
    10101010            return 10_ms;
    1011         case JITCode::BaselineJIT:
     1011        case JITType::BaselineJIT:
    10121012            return 30_ms;
    1013         case JITCode::DFGJIT:
     1013        case JITType::DFGJIT:
    10141014            return 40_ms;
    1015         case JITCode::FTLJIT:
     1015        case JITType::FTLJIT:
    10161016            return 120_ms;
    10171017        default:
     
    10211021
    10221022    switch (jitType) {
    1023     case JITCode::InterpreterThunk:
     1023    case JITType::InterpreterThunk:
    10241024        return 5_s;
    1025     case JITCode::BaselineJIT:
     1025    case JITType::BaselineJIT:
    10261026        // Effectively 10 additional seconds, since BaselineJIT and
    10271027        // InterpreterThunk share a CodeBlock.
    10281028        return 15_s;
    1029     case JITCode::DFGJIT:
     1029    case JITType::DFGJIT:
    10301030        return 20_s;
    1031     case JITCode::FTLJIT:
     1031    case JITType::FTLJIT:
    10321032        return 60_s;
    10331033    default:
     
    10691069    VM& vm = *m_vm;
    10701070
    1071     if (jitType() == JITCode::InterpreterThunk) {
     1071    if (jitType() == JITType::InterpreterThunk) {
    10721072        const Vector<InstructionStream::Offset>& propertyAccessInstructions = m_unlinkedCode->propertyAccessInstructions();
    10731073        const InstructionStream& instructionStream = instructions();
     
    16311631        result = result->alternative();
    16321632    RELEASE_ASSERT(result);
    1633     RELEASE_ASSERT(JITCode::isBaselineCode(result->jitType()) || result->jitType() == JITCode::None);
     1633    RELEASE_ASSERT(JITCode::isBaselineCode(result->jitType()) || result->jitType() == JITType::None);
    16341634    return result;
    16351635#else
     
    16411641{
    16421642#if ENABLE(JIT)
    1643     JITCode::JITType selfJITType = jitType();
     1643    JITType selfJITType = jitType();
    16441644    if (JITCode::isBaselineCode(selfJITType))
    16451645        return this;
     
    16551655            // This can happen if we're creating the original CodeBlock for an executable.
    16561656            // Assume that we're the baseline CodeBlock.
    1657             RELEASE_ASSERT(selfJITType == JITCode::None);
     1657            RELEASE_ASSERT(selfJITType == JITType::None);
    16581658            return this;
    16591659        }
     
    16681668
    16691669#if ENABLE(JIT)
    1670 bool CodeBlock::hasOptimizedReplacement(JITCode::JITType typeToReplace)
     1670bool CodeBlock::hasOptimizedReplacement(JITType typeToReplace)
    16711671{
    16721672    CodeBlock* replacement = this->replacement();
     
    21482148    }
    21492149
    2150     if (callerCodeBlock->jitType() == JITCode::InterpreterThunk) {
     2150    if (callerCodeBlock->jitType() == JITType::InterpreterThunk) {
    21512151        // If the caller is still in the interpreter, then we can't expect inlining to
    21522152        // happen anytime soon. Assume it's profitable to optimize it separately. This
     
    24902490void CodeBlock::setOptimizationThresholdBasedOnCompilationResult(CompilationResult result)
    24912491{
    2492     JITCode::JITType type = jitType();
    2493     if (type != JITCode::BaselineJIT) {
     2492    JITType type = jitType();
     2493    if (type != JITType::BaselineJIT) {
    24942494        dataLog(*this, ": expected to have baseline code but have ", type, "\n");
    2495         CRASH_WITH_INFO(bitwise_cast<uintptr_t>(jitCode().get()), type);
     2495        CRASH_WITH_INFO(bitwise_cast<uintptr_t>(jitCode().get()), static_cast<uint8_t>(type));
    24962496    }
    24972497   
     
    27242724{
    27252725    ASSERT(JITCode::isOptimizingJIT(jitType()));
    2726     ASSERT(alternative()->jitType() == JITCode::BaselineJIT);
     2726    ASSERT(alternative()->jitType() == JITType::BaselineJIT);
    27272727   
    27282728    CodeBlock* profiledBlock = alternative();
    27292729   
    27302730    switch (jitType()) {
    2731     case JITCode::DFGJIT: {
     2731    case JITType::DFGJIT: {
    27322732        DFG::JITCode* jitCode = m_jitCode->dfg();
    27332733        for (auto& exit : jitCode->osrExit)
     
    27372737
    27382738#if ENABLE(FTL_JIT)
    2739     case JITCode::FTLJIT: {
     2739    case JITType::FTLJIT: {
    27402740        // There is no easy way to avoid duplicating this code since the FTL::JITCode::osrExit
    27412741        // vector contains a totally different type, that just so happens to behave like
     
    28252825{
    28262826    switch (jitType()) {
    2827     case JITCode::InterpreterThunk:
     2827    case JITType::InterpreterThunk:
    28282828        return LLInt::frameRegisterCountFor(this);
    28292829
    28302830#if ENABLE(JIT)
    2831     case JITCode::BaselineJIT:
     2831    case JITType::BaselineJIT:
    28322832        return JIT::frameRegisterCountFor(this);
    28332833#endif // ENABLE(JIT)
    28342834
    28352835#if ENABLE(DFG_JIT)
    2836     case JITCode::DFGJIT:
    2837     case JITCode::FTLJIT:
     2836    case JITType::DFGJIT:
     2837    case JITType::FTLJIT:
    28382838        return jitCode()->dfgCommon()->frameRegisterCount;
    28392839#endif // ENABLE(DFG_JIT)
     
    31763176{
    31773177    Optional<unsigned> bytecodeOffset;
    3178     JITCode::JITType jitType = this->jitType();
    3179     if (jitType == JITCode::InterpreterThunk || jitType == JITCode::BaselineJIT) {
     3178    JITType jitType = this->jitType();
     3179    if (jitType == JITType::InterpreterThunk || jitType == JITType::BaselineJIT) {
    31803180#if USE(JSVALUE64)
    31813181        bytecodeOffset = callSiteIndex.bits();
     
    31843184        bytecodeOffset = this->bytecodeOffset(instruction);
    31853185#endif
    3186     } else if (jitType == JITCode::DFGJIT || jitType == JITCode::FTLJIT) {
     3186    } else if (jitType == JITType::DFGJIT || jitType == JITType::FTLJIT) {
    31873187#if ENABLE(DFG_JIT)
    31883188        RELEASE_ASSERT(canGetCodeOrigin(callSiteIndex));
Note: See TracChangeset for help on using the changeset viewer.