Title: [195550] trunk/Source/_javascript_Core
Revision
195550
Author
[email protected]
Date
2016-01-25 13:04:28 -0800 (Mon, 25 Jan 2016)

Log Message

Restore CodeBlock jettison code Geoff accidentally removed
https://bugs.webkit.org/show_bug.cgi?id=151241

Rubber-stamped by Geoffrey Garen.

Geoff meant to add this back in <http://trac.webkit.org/changeset/190827>
but missed.

Then he added it back in, but it was rolled out due to a crash on Animometer.
I can no longer produce a crash on Animometer, either with today's version of
the benchmark, or the one that existed at the time of the rollout.

Given this, let's roll it back in and see how it goes.

* bytecode/CodeBlock.cpp:
(JSC::timeToLive):
(JSC::CodeBlock::shouldJettisonDueToOldAge):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (195549 => 195550)


--- trunk/Source/_javascript_Core/ChangeLog	2016-01-25 20:47:18 UTC (rev 195549)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-01-25 21:04:28 UTC (rev 195550)
@@ -1,3 +1,23 @@
+2016-01-25  Andreas Kling  <[email protected]>
+
+        Restore CodeBlock jettison code Geoff accidentally removed
+        https://bugs.webkit.org/show_bug.cgi?id=151241
+
+        Rubber-stamped by Geoffrey Garen.
+
+        Geoff meant to add this back in <http://trac.webkit.org/changeset/190827>
+        but missed.
+
+        Then he added it back in, but it was rolled out due to a crash on Animometer.
+        I can no longer produce a crash on Animometer, either with today's version of
+        the benchmark, or the one that existed at the time of the rollout.
+
+        Given this, let's roll it back in and see how it goes.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::timeToLive):
+        (JSC::CodeBlock::shouldJettisonDueToOldAge):
+
 2016-01-22  Filip Pizlo  <[email protected]>
 
         mandreel should run just as fast in FTL B3 as FTL LLVM

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (195549 => 195550)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2016-01-25 20:47:18 UTC (rev 195549)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2016-01-25 21:04:28 UTC (rev 195550)
@@ -81,6 +81,28 @@
 
 namespace JSC {
 
+static std::chrono::milliseconds timeToLive(JITCode::JITType jitType)
+{
+    switch (jitType) {
+    case JITCode::InterpreterThunk:
+        return std::chrono::duration_cast<std::chrono::milliseconds>(
+            std::chrono::seconds(5));
+    case JITCode::BaselineJIT:
+        // Effectively 10 additional seconds, since BaselineJIT and
+        // InterpreterThunk share a CodeBlock.
+        return std::chrono::duration_cast<std::chrono::milliseconds>(
+            std::chrono::seconds(15));
+    case JITCode::DFGJIT:
+        return std::chrono::duration_cast<std::chrono::milliseconds>(
+            std::chrono::seconds(20));
+    case JITCode::FTLJIT:
+        return std::chrono::duration_cast<std::chrono::milliseconds>(
+            std::chrono::seconds(60));
+    default:
+        return std::chrono::milliseconds::max();
+    }
+}
+
 const ClassInfo CodeBlock::s_info = {
     "CodeBlock", 0, 0,
     CREATE_METHOD_TABLE(CodeBlock)
@@ -2530,7 +2552,13 @@
 
 bool CodeBlock::shouldJettisonDueToOldAge()
 {
-    return false;
+    if (Heap::isMarked(this))
+        return false;
+
+    if (timeSinceCreation() < timeToLive(jitType()))
+        return false;
+
+    return true;
 }
 
 #if ENABLE(DFG_JIT)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to