Title: [121218] trunk/Source/_javascript_Core
Revision
121218
Author
[email protected]
Date
2012-06-25 19:53:39 -0700 (Mon, 25 Jun 2012)

Log Message

JSC should try to make profiling deterministic because otherwise reproducing failures is
nearly impossible
https://bugs.webkit.org/show_bug.cgi?id=89940

Rubber stamped by Gavin Barraclough.
        
This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
artificially low (and statically predetermined!) value. This gives most of the benefit of
threshold randomization without actually making the system behave completely differently on
each invocation.

* bytecode/ExecutionCounter.cpp:
(JSC::ExecutionCounter::setThreshold):
* runtime/Options.cpp:
(Options):
(JSC::Options::initializeOptions):
* runtime/Options.h:
(Options):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (121217 => 121218)


--- trunk/Source/_javascript_Core/ChangeLog	2012-06-26 02:52:11 UTC (rev 121217)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-06-26 02:53:39 UTC (rev 121218)
@@ -1,3 +1,25 @@
+2012-06-25  Filip Pizlo  <[email protected]>
+
+        JSC should try to make profiling deterministic because otherwise reproducing failures is
+        nearly impossible
+        https://bugs.webkit.org/show_bug.cgi?id=89940
+
+        Rubber stamped by Gavin Barraclough.
+        
+        This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
+        into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
+        artificially low (and statically predetermined!) value. This gives most of the benefit of
+        threshold randomization without actually making the system behave completely differently on
+        each invocation.
+
+        * bytecode/ExecutionCounter.cpp:
+        (JSC::ExecutionCounter::setThreshold):
+        * runtime/Options.cpp:
+        (Options):
+        (JSC::Options::initializeOptions):
+        * runtime/Options.h:
+        (Options):
+
 2012-06-22  Filip Pizlo  <[email protected]>
 
         Value profiling should use tier-up threshold randomization to get more coverage

Modified: trunk/Source/_javascript_Core/bytecode/ExecutionCounter.cpp (121217 => 121218)


--- trunk/Source/_javascript_Core/bytecode/ExecutionCounter.cpp	2012-06-26 02:52:11 UTC (rev 121217)
+++ trunk/Source/_javascript_Core/bytecode/ExecutionCounter.cpp	2012-06-26 02:53:39 UTC (rev 121218)
@@ -144,8 +144,11 @@
         return true;
     }
 
-    int32_t maxThreshold =
-        codeBlock->globalObject()->weakRandomInteger() % Options::maximumExecutionCountsBetweenCheckpoints;
+    int32_t maxThreshold;
+    if (Options::randomizeExecutionCountsBetweenCheckpoints)
+        maxThreshold = codeBlock->globalObject()->weakRandomInteger() % Options::maximumExecutionCountsBetweenCheckpoints;
+    else
+        maxThreshold = Options::maximumExecutionCountsBetweenCheckpoints;
     if (threshold > maxThreshold)
         threshold = maxThreshold;
     

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (121217 => 121218)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2012-06-26 02:52:11 UTC (rev 121217)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2012-06-26 02:53:39 UTC (rev 121218)
@@ -67,6 +67,7 @@
 int32_t executionCounterIncrementForLoop;
 int32_t executionCounterIncrementForReturn;
 
+bool randomizeExecutionCountsBetweenCheckpoints;
 int32_t maximumExecutionCountsBetweenCheckpoints;
 
 unsigned desiredSpeculativeSuccessFailRatio;
@@ -190,6 +191,7 @@
     SET(executionCounterIncrementForLoop,   1);
     SET(executionCounterIncrementForReturn, 15);
     
+    SET(randomizeExecutionCountsBetweenCheckpoints, false);
     SET(maximumExecutionCountsBetweenCheckpoints, 1000);
 
     SET(desiredSpeculativeSuccessFailRatio, 6);

Modified: trunk/Source/_javascript_Core/runtime/Options.h (121217 => 121218)


--- trunk/Source/_javascript_Core/runtime/Options.h	2012-06-26 02:52:11 UTC (rev 121217)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2012-06-26 02:53:39 UTC (rev 121218)
@@ -53,6 +53,7 @@
 extern int32_t executionCounterIncrementForLoop;
 extern int32_t executionCounterIncrementForReturn;
 
+extern bool randomizeExecutionCountsBetweenCheckpoints;
 extern int32_t maximumExecutionCountsBetweenCheckpoints;
 
 extern unsigned desiredSpeculativeSuccessFailRatio;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to