|
47 | 47 | #include "DFGCommon.h" |
48 | 48 | #include "DFGJITCode.h" |
49 | 49 | #include "EvalCodeBlock.h" |
50 | | -#include "FullCodeOrigin.h" |
51 | 50 | #include "FunctionCodeBlock.h" |
52 | 51 | #include "FunctionExecutableDump.h" |
53 | 52 | #include "GetPutInfo.h" |
|
80 | 79 | #include "ReduceWhitespace.h" |
81 | 80 | #include "SlotVisitorInlines.h" |
82 | 81 | #include "SourceProvider.h" |
83 | | -#include "StackVisitor.h" |
84 | 82 | #include "SymbolTableInlines.h" |
85 | 83 | #include "TypeLocationCache.h" |
86 | 84 | #include "TypeProfiler.h" |
@@ -191,8 +189,6 @@ void CodeBlock::dumpAssumingJITType(PrintStream& out, JITType jitType) const |
191 | 189 | if (codeType() == FunctionCode) |
192 | 190 | out.print(specializationKind()); |
193 | 191 | out.print(", ", instructionsSize()); |
194 | | - if (this->jitType() == JITType::BaselineJIT && m_shouldAlwaysBeInlined) |
195 | | - out.print(" (ShouldAlwaysBeInlined)"); |
196 | 192 | if (ownerExecutable()->neverInline()) |
197 | 193 | out.print(" (NeverInline)"); |
198 | 194 | if (ownerExecutable()->neverOptimize()) |
@@ -291,7 +287,6 @@ class PutToScopeFireDetail final : public FireDetail { |
291 | 287 | CodeBlock::CodeBlock(VM& vm, Structure* structure, CopyParsedBlockTag, CodeBlock& other) |
292 | 288 | : JSCell(vm, structure) |
293 | 289 | , m_globalObject(other.m_globalObject) |
294 | | - , m_shouldAlwaysBeInlined(true) |
295 | 290 | #if ENABLE(JIT) |
296 | 291 | , m_capabilityLevelState(DFG::CapabilityLevelNotSet) |
297 | 292 | #endif |
@@ -347,7 +342,6 @@ void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other) |
347 | 342 | CodeBlock::CodeBlock(VM& vm, Structure* structure, ScriptExecutable* ownerExecutable, UnlinkedCodeBlock* unlinkedCodeBlock, JSScope* scope) |
348 | 343 | : JSCell(vm, structure) |
349 | 344 | , m_globalObject(scope->realm(), WriteBarrierEarlyInit) |
350 | | - , m_shouldAlwaysBeInlined(true) |
351 | 345 | #if ENABLE(JIT) |
352 | 346 | , m_capabilityLevelState(DFG::CapabilityLevelNotSet) |
353 | 347 | #endif |
@@ -866,19 +860,6 @@ void CodeBlock::setupWithUnlinkedBaselineCode(Ref<BaselineJITCode> jitCode) |
866 | 860 | optimizeAfterWarmUp(); |
867 | 861 | } |
868 | 862 |
|
869 | | - switch (codeType()) { |
870 | | - case GlobalCode: |
871 | | - case ModuleCode: |
872 | | - case EvalCode: |
873 | | - m_shouldAlwaysBeInlined = false; |
874 | | - break; |
875 | | - case FunctionCode: |
876 | | - // We could have already set it to false because we detected an uninlineable call. |
877 | | - // Don't override that observation. |
878 | | - m_shouldAlwaysBeInlined &= canInline(capabilityLevel()) && DFG::mightInlineFunction(JITType::FTLJIT, this); |
879 | | - break; |
880 | | - } |
881 | | - |
882 | 863 | if (jitCode->m_isShareable && !unlinkedCodeBlock()->m_unlinkedBaselineCode && Options::useBaselineJITCodeSharing()) |
883 | 864 | unlinkedCodeBlock()->m_unlinkedBaselineCode = WTF::move(jitCode); |
884 | 865 | } |
@@ -2460,117 +2441,13 @@ JSGlobalObject* CodeBlock::globalObjectFor(CodeOrigin codeOrigin) |
2460 | 2441 | return inlineCallFrame->baselineCodeBlock->globalObject(); |
2461 | 2442 | } |
2462 | 2443 |
|
2463 | | -class RecursionCheckFunctor { |
2464 | | -public: |
2465 | | - RecursionCheckFunctor(CallFrame* startCallFrame, CodeBlock* codeBlock, unsigned depthToCheck) |
2466 | | - : m_startCallFrame(startCallFrame) |
2467 | | - , m_codeBlock(codeBlock) |
2468 | | - , m_depthToCheck(depthToCheck) |
2469 | | - , m_foundStartCallFrame(false) |
2470 | | - , m_didRecurse(false) |
2471 | | - { } |
2472 | | - |
2473 | | - IterationStatus NODELETE operator()(StackVisitor& visitor) const |
2474 | | - { |
2475 | | - CallFrame* currentCallFrame = visitor->callFrame(); |
2476 | | - |
2477 | | - if (currentCallFrame == m_startCallFrame) |
2478 | | - m_foundStartCallFrame = true; |
2479 | | - |
2480 | | - if (m_foundStartCallFrame) { |
2481 | | - if (visitor->codeBlock() == m_codeBlock) { |
2482 | | - m_didRecurse = true; |
2483 | | - return IterationStatus::Done; |
2484 | | - } |
2485 | | - |
2486 | | - if (!m_depthToCheck--) |
2487 | | - return IterationStatus::Done; |
2488 | | - } |
2489 | | - |
2490 | | - return IterationStatus::Continue; |
2491 | | - } |
2492 | | - |
2493 | | - bool NODELETE didRecurse() const { return m_didRecurse; } |
2494 | | - |
2495 | | -private: |
2496 | | - CallFrame* const m_startCallFrame; |
2497 | | - CodeBlock* const m_codeBlock; |
2498 | | - mutable unsigned m_depthToCheck; |
2499 | | - mutable bool m_foundStartCallFrame; |
2500 | | - mutable bool m_didRecurse; |
2501 | | -}; |
2502 | | - |
2503 | 2444 | void CodeBlock::noticeIncomingCall(JSCell* caller) |
2504 | 2445 | { |
2505 | 2446 | RELEASE_ASSERT(!m_isJettisoned); |
2506 | 2447 |
|
2507 | 2448 | CodeBlock* callerCodeBlock = dynamicDowncast<CodeBlock>(caller); |
2508 | 2449 |
|
2509 | 2450 | dataLogLnIf(Options::verboseCallLink(), "Noticing call link from ", pointerDump(callerCodeBlock), " to ", *this); |
2510 | | - |
2511 | | -#if ENABLE(DFG_JIT) |
2512 | | - if (!m_shouldAlwaysBeInlined) |
2513 | | - return; |
2514 | | - |
2515 | | - if (!callerCodeBlock) { |
2516 | | - m_shouldAlwaysBeInlined = false; |
2517 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI because caller is native."); |
2518 | | - return; |
2519 | | - } |
2520 | | - |
2521 | | - if (!hasBaselineJITProfiling()) |
2522 | | - return; |
2523 | | - |
2524 | | - if (!DFG::mightInlineFunction(JITType::FTLJIT, this)) |
2525 | | - return; |
2526 | | - |
2527 | | - if (!canInline(capabilityLevelState())) |
2528 | | - return; |
2529 | | - |
2530 | | - if (!DFG::isSmallEnoughToInlineCodeInto(callerCodeBlock)) { |
2531 | | - m_shouldAlwaysBeInlined = false; |
2532 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI because caller is too large."); |
2533 | | - return; |
2534 | | - } |
2535 | | - |
2536 | | - if (callerCodeBlock->jitType() == JITType::InterpreterThunk) { |
2537 | | - // If the caller is still in the interpreter, then we can't expect inlining to |
2538 | | - // happen anytime soon. Assume it's profitable to optimize it separately. This |
2539 | | - // ensures that a function is SABI only if it is called no more frequently than |
2540 | | - // any of its callers. |
2541 | | - m_shouldAlwaysBeInlined = false; |
2542 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI because caller is in LLInt."); |
2543 | | - return; |
2544 | | - } |
2545 | | - |
2546 | | - if (JSC::JITCode::isOptimizingJIT(callerCodeBlock->jitType())) { |
2547 | | - m_shouldAlwaysBeInlined = false; |
2548 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI bcause caller was already optimized."); |
2549 | | - return; |
2550 | | - } |
2551 | | - |
2552 | | - if (callerCodeBlock->codeType() != FunctionCode) { |
2553 | | - // If the caller is either eval or global code, assume that that won't be |
2554 | | - // optimized anytime soon. For eval code this is particularly true since we |
2555 | | - // delay eval optimization by a *lot*. |
2556 | | - m_shouldAlwaysBeInlined = false; |
2557 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI because caller is not a function."); |
2558 | | - return; |
2559 | | - } |
2560 | | - |
2561 | | - // Recursive calls won't be inlined. |
2562 | | - if (callerCodeBlock->capabilityLevelState() == DFG::CapabilityLevelNotSet) { |
2563 | | - dataLog("In call from ", FullCodeOrigin(callerCodeBlock, CodeOrigin { }), " to ", *this, ": caller's DFG capability level is not set.\n"); |
2564 | | - CRASH(); |
2565 | | - } |
2566 | | - |
2567 | | - if (canCompile(callerCodeBlock->capabilityLevelState())) |
2568 | | - return; |
2569 | | - |
2570 | | - dataLogLnIf(Options::verboseCallLink(), " Clearing SABI because the caller is not a DFG candidate."); |
2571 | | - |
2572 | | - m_shouldAlwaysBeInlined = false; |
2573 | | -#endif |
2574 | 2451 | } |
2575 | 2452 |
|
2576 | 2453 | unsigned CodeBlock::reoptimizationRetryCounter() const |
|
0 commit comments