diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp index 07e027b60868..b1454175db72 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp @@ -1282,15 +1282,15 @@ static Seconds NODELETE timeToLive(JITType jitType) switch (jitType) { case JITType::InterpreterThunk: - return 5_s; + return Seconds(Options::interpreterThunkTimeToLiveSeconds()); case JITType::BaselineJIT: // Effectively 10 additional seconds, since BaselineJIT and // InterpreterThunk share a CodeBlock. - return 15_s; + return Seconds(Options::baselineJITTimeToLiveSeconds()); case JITType::DFGJIT: - return 20_s; + return Seconds(Options::dfgJITTimeToLiveSeconds()); case JITType::FTLJIT: - return 60_s; + return Seconds(Options::ftlJITTimeToLiveSeconds()); default: return Seconds::infinity(); } diff --git a/Source/JavaScriptCore/runtime/OptionsList.h b/Source/JavaScriptCore/runtime/OptionsList.h index 631571757017..d9b39d6971d3 100644 --- a/Source/JavaScriptCore/runtime/OptionsList.h +++ b/Source/JavaScriptCore/runtime/OptionsList.h @@ -436,6 +436,10 @@ bool hasCapacityToUseLargeGigacage(); v(Bool, dumpHeapOnLowMemory, false, Normal, "Dump a heap dump when the memory handler is triggered. Use alongside $vm.triggerMemoryPressure() and enableStrongRefTracker."_s) \ v(Bool, forceCodeBlockToJettisonDueToOldAge, false, Normal, "If true, this means that anytime we can jettison a CodeBlock due to old age, we do."_s) \ v(Bool, useEagerCodeBlockJettisonTiming, false, Normal, "If true, the time slices for jettisoning a CodeBlock due to old age are shrunk significantly."_s) \ + v(Double, interpreterThunkTimeToLiveSeconds, 5.0, Normal, "Seconds before an InterpreterThunk CodeBlock is eligible for old-age jettison."_s) \ + v(Double, baselineJITTimeToLiveSeconds, 15.0, Normal, "Seconds before a BaselineJIT CodeBlock is eligible for old-age jettison."_s) \ + v(Double, dfgJITTimeToLiveSeconds, 20.0, Normal, "Seconds before a DFGJIT CodeBlock is eligible for old-age jettison."_s) \ + v(Double, ftlJITTimeToLiveSeconds, 60.0, Normal, "Seconds before an FTLJIT CodeBlock is eligible for old-age jettison."_s) \ \ v(Bool, useTypeProfiler, false, Normal, nullptr) \ v(Bool, useControlFlowProfiler, false, Normal, nullptr) \