Changeset 244764 in webkit for trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
- Timestamp:
- Apr 29, 2019, 8:27:39 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r244088 r244764 181 181 } 182 182 183 void CodeBlock::dumpAssumingJITType(PrintStream& out, JIT Code::JITType jitType) const183 void CodeBlock::dumpAssumingJITType(PrintStream& out, JITType jitType) const 184 184 { 185 185 out.print(inferredName(), "#", hashAsStringIfPossible()); … … 192 192 out.print(specializationKind()); 193 193 out.print(", ", instructionCount()); 194 if (this->jitType() == JIT Code::BaselineJIT && m_shouldAlwaysBeInlined)194 if (this->jitType() == JITType::BaselineJIT && m_shouldAlwaysBeInlined) 195 195 out.print(" (ShouldAlwaysBeInlined)"); 196 196 if (ownerExecutable()->neverInline()) … … 206 206 if (m_didFailJITCompilation) 207 207 out.print(" (JITFail)"); 208 if (this->jitType() == JIT Code::BaselineJIT && m_didFailFTLCompilation)208 if (this->jitType() == JITType::BaselineJIT && m_didFailFTLCompilation) 209 209 out.print(" (FTLFail)"); 210 if (this->jitType() == JIT Code::BaselineJIT && m_hasBeenCompiledWithFTL)210 if (this->jitType() == JITType::BaselineJIT && m_hasBeenCompiledWithFTL) 211 211 out.print(" (HadFTLReplacement)"); 212 212 out.print("]"); … … 930 930 { 931 931 #if ENABLE(FTL_JIT) 932 if (jitType() != JIT Code::DFGJIT)932 if (jitType() != JITType::DFGJIT) 933 933 return 0; 934 934 DFG::JITCode* jitCode = m_jitCode->dfg(); … … 1003 1003 } 1004 1004 1005 static Seconds timeToLive(JIT Code::JITType jitType)1005 static Seconds timeToLive(JITType jitType) 1006 1006 { 1007 1007 if (UNLIKELY(Options::useEagerCodeBlockJettisonTiming())) { 1008 1008 switch (jitType) { 1009 case JIT Code::InterpreterThunk:1009 case JITType::InterpreterThunk: 1010 1010 return 10_ms; 1011 case JIT Code::BaselineJIT:1011 case JITType::BaselineJIT: 1012 1012 return 30_ms; 1013 case JIT Code::DFGJIT:1013 case JITType::DFGJIT: 1014 1014 return 40_ms; 1015 case JIT Code::FTLJIT:1015 case JITType::FTLJIT: 1016 1016 return 120_ms; 1017 1017 default: … … 1021 1021 1022 1022 switch (jitType) { 1023 case JIT Code::InterpreterThunk:1023 case JITType::InterpreterThunk: 1024 1024 return 5_s; 1025 case JIT Code::BaselineJIT:1025 case JITType::BaselineJIT: 1026 1026 // Effectively 10 additional seconds, since BaselineJIT and 1027 1027 // InterpreterThunk share a CodeBlock. 1028 1028 return 15_s; 1029 case JIT Code::DFGJIT:1029 case JITType::DFGJIT: 1030 1030 return 20_s; 1031 case JIT Code::FTLJIT:1031 case JITType::FTLJIT: 1032 1032 return 60_s; 1033 1033 default: … … 1069 1069 VM& vm = *m_vm; 1070 1070 1071 if (jitType() == JIT Code::InterpreterThunk) {1071 if (jitType() == JITType::InterpreterThunk) { 1072 1072 const Vector<InstructionStream::Offset>& propertyAccessInstructions = m_unlinkedCode->propertyAccessInstructions(); 1073 1073 const InstructionStream& instructionStream = instructions(); … … 1631 1631 result = result->alternative(); 1632 1632 RELEASE_ASSERT(result); 1633 RELEASE_ASSERT(JITCode::isBaselineCode(result->jitType()) || result->jitType() == JIT Code::None);1633 RELEASE_ASSERT(JITCode::isBaselineCode(result->jitType()) || result->jitType() == JITType::None); 1634 1634 return result; 1635 1635 #else … … 1641 1641 { 1642 1642 #if ENABLE(JIT) 1643 JIT Code::JITType selfJITType = jitType();1643 JITType selfJITType = jitType(); 1644 1644 if (JITCode::isBaselineCode(selfJITType)) 1645 1645 return this; … … 1655 1655 // This can happen if we're creating the original CodeBlock for an executable. 1656 1656 // Assume that we're the baseline CodeBlock. 1657 RELEASE_ASSERT(selfJITType == JIT Code::None);1657 RELEASE_ASSERT(selfJITType == JITType::None); 1658 1658 return this; 1659 1659 } … … 1668 1668 1669 1669 #if ENABLE(JIT) 1670 bool CodeBlock::hasOptimizedReplacement(JIT Code::JITType typeToReplace)1670 bool CodeBlock::hasOptimizedReplacement(JITType typeToReplace) 1671 1671 { 1672 1672 CodeBlock* replacement = this->replacement(); … … 2148 2148 } 2149 2149 2150 if (callerCodeBlock->jitType() == JIT Code::InterpreterThunk) {2150 if (callerCodeBlock->jitType() == JITType::InterpreterThunk) { 2151 2151 // If the caller is still in the interpreter, then we can't expect inlining to 2152 2152 // happen anytime soon. Assume it's profitable to optimize it separately. This … … 2490 2490 void CodeBlock::setOptimizationThresholdBasedOnCompilationResult(CompilationResult result) 2491 2491 { 2492 JIT Code::JITType type = jitType();2493 if (type != JIT Code::BaselineJIT) {2492 JITType type = jitType(); 2493 if (type != JITType::BaselineJIT) { 2494 2494 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)); 2496 2496 } 2497 2497 … … 2724 2724 { 2725 2725 ASSERT(JITCode::isOptimizingJIT(jitType())); 2726 ASSERT(alternative()->jitType() == JIT Code::BaselineJIT);2726 ASSERT(alternative()->jitType() == JITType::BaselineJIT); 2727 2727 2728 2728 CodeBlock* profiledBlock = alternative(); 2729 2729 2730 2730 switch (jitType()) { 2731 case JIT Code::DFGJIT: {2731 case JITType::DFGJIT: { 2732 2732 DFG::JITCode* jitCode = m_jitCode->dfg(); 2733 2733 for (auto& exit : jitCode->osrExit) … … 2737 2737 2738 2738 #if ENABLE(FTL_JIT) 2739 case JIT Code::FTLJIT: {2739 case JITType::FTLJIT: { 2740 2740 // There is no easy way to avoid duplicating this code since the FTL::JITCode::osrExit 2741 2741 // vector contains a totally different type, that just so happens to behave like … … 2825 2825 { 2826 2826 switch (jitType()) { 2827 case JIT Code::InterpreterThunk:2827 case JITType::InterpreterThunk: 2828 2828 return LLInt::frameRegisterCountFor(this); 2829 2829 2830 2830 #if ENABLE(JIT) 2831 case JIT Code::BaselineJIT:2831 case JITType::BaselineJIT: 2832 2832 return JIT::frameRegisterCountFor(this); 2833 2833 #endif // ENABLE(JIT) 2834 2834 2835 2835 #if ENABLE(DFG_JIT) 2836 case JIT Code::DFGJIT:2837 case JIT Code::FTLJIT:2836 case JITType::DFGJIT: 2837 case JITType::FTLJIT: 2838 2838 return jitCode()->dfgCommon()->frameRegisterCount; 2839 2839 #endif // ENABLE(DFG_JIT) … … 3176 3176 { 3177 3177 Optional<unsigned> bytecodeOffset; 3178 JIT Code::JITType jitType = this->jitType();3179 if (jitType == JIT Code::InterpreterThunk || jitType == JITCode::BaselineJIT) {3178 JITType jitType = this->jitType(); 3179 if (jitType == JITType::InterpreterThunk || jitType == JITType::BaselineJIT) { 3180 3180 #if USE(JSVALUE64) 3181 3181 bytecodeOffset = callSiteIndex.bits(); … … 3184 3184 bytecodeOffset = this->bytecodeOffset(instruction); 3185 3185 #endif 3186 } else if (jitType == JIT Code::DFGJIT || jitType == JITCode::FTLJIT) {3186 } else if (jitType == JITType::DFGJIT || jitType == JITType::FTLJIT) { 3187 3187 #if ENABLE(DFG_JIT) 3188 3188 RELEASE_ASSERT(canGetCodeOrigin(callSiteIndex));
Note:
See TracChangeset
for help on using the changeset viewer.