Unreviewed, rolling in r243843 with the build fix
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2019 05:27:25 +0000 (05:27 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Apr 2019 05:27:25 +0000 (05:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196586

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/RandomizingFuzzerAgent.cpp:
(JSC::RandomizingFuzzerAgent::getPrediction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Options.cpp
Source/JavaScriptCore/runtime/Options.h
Source/JavaScriptCore/runtime/RandomizingFuzzerAgent.cpp

index 185929b..a09d456 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-03  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        Unreviewed, rolling in r243843 with the build fix
+        https://bugs.webkit.org/show_bug.cgi?id=196586
+
+        * runtime/Options.cpp:
+        (JSC::recomputeDependentOptions):
+        * runtime/Options.h:
+        * runtime/RandomizingFuzzerAgent.cpp:
+        (JSC::RandomizingFuzzerAgent::getPrediction):
+
 2019-04-03  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r243843.
index ea8b90a..8e8d3ae 100644 (file)
@@ -451,7 +451,8 @@ static void recomputeDependentOptions()
         || Options::logPhaseTimes()
         || Options::verboseCFA()
         || Options::verboseDFGFailure()
-        || Options::verboseFTLFailure())
+        || Options::verboseFTLFailure()
+        || Options::dumpRandomizingFuzzerAgentPredictions())
         Options::alwaysComputeHash() = true;
     
     if (!Options::useConcurrentGC())
index 9837989..24206e4 100644 (file)
@@ -436,6 +436,7 @@ constexpr bool enableWebAssemblyStreamingApi = false;
     \
     v(bool, useRandomizingFuzzerAgent, false, Normal, nullptr) \
     v(unsigned, seedOfRandomizingFuzzerAgent, 1, Normal, nullptr) \
+    v(bool, dumpRandomizingFuzzerAgentPredictions, false, Normal, nullptr) \
     \
     v(bool, logPhaseTimes, false, Normal, nullptr) \
     v(double, rareBlockPenalty, 0.001, Normal, nullptr) \
index 747ad6a..cfda10b 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "RandomizingFuzzerAgent.h"
 
+#include "CodeBlock.h"
+
 namespace JSC {
 
 RandomizingFuzzerAgent::RandomizingFuzzerAgent(VM&)
@@ -33,13 +35,15 @@ RandomizingFuzzerAgent::RandomizingFuzzerAgent(VM&)
 {
 }
 
-SpeculatedType RandomizingFuzzerAgent::getPrediction(CodeBlock*, int, SpeculatedType)
+SpeculatedType RandomizingFuzzerAgent::getPrediction(CodeBlock* codeBlock, int bytecodeIndex, SpeculatedType original)
 {
     auto locker = holdLock(m_lock);
     uint32_t high = m_random.getUint32();
     uint32_t low = m_random.getUint32();
-    uint64_t result = (static_cast<uint64_t>(high) << 32) | low;
-    return static_cast<SpeculatedType>(result) & SpecFullTop;
+    SpeculatedType generated = static_cast<SpeculatedType>((static_cast<uint64_t>(high) << 32) | low) & SpecFullTop;
+    if (Options::dumpRandomizingFuzzerAgentPredictions())
+        dataLogLn("getPrediction name:(", codeBlock->inferredName(), "#", codeBlock->hashAsStringIfPossible(), "),bytecodeIndex:(", bytecodeIndex, "),original:(", SpeculationDump(original), "),generated:(", SpeculationDump(generated), ")");
+    return generated;
 }
 
 } // namespace JSC