Unreviewed, roll out unintended JSC change from https://trac.webkit.org/changeset...
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 22:13:19 +0000 (22:13 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jun 2015 22:13:19 +0000 (22:13 +0000)
* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasExitSite):
(JSC::CodeBlock::exitProfile):
(JSC::CodeBlock::numberOfExitSites): Deleted.
* bytecode/DFGExitProfile.cpp:
(JSC::DFG::ExitProfile::add):
* bytecode/DFGExitProfile.h:
(JSC::DFG::ExitProfile::hasExitSite):
(JSC::DFG::ExitProfile::size): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::inliningCost):
* runtime/Options.h:

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/DFGExitProfile.cpp
Source/JavaScriptCore/bytecode/DFGExitProfile.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/runtime/Options.h

index e144516..3fddc5e 100644 (file)
@@ -1,3 +1,20 @@
+2015-06-16  Filip Pizlo  <fpizlo@apple.com>
+
+        Unreviewed, roll out unintended JSC change from https://trac.webkit.org/changeset/185425.
+
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::hasExitSite):
+        (JSC::CodeBlock::exitProfile):
+        (JSC::CodeBlock::numberOfExitSites): Deleted.
+        * bytecode/DFGExitProfile.cpp:
+        (JSC::DFG::ExitProfile::add):
+        * bytecode/DFGExitProfile.h:
+        (JSC::DFG::ExitProfile::hasExitSite):
+        (JSC::DFG::ExitProfile::size): Deleted.
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::inliningCost):
+        * runtime/Options.h:
+
 2015-06-16  Mark Lam  <mark.lam@apple.com>
 
         Use NakedPtr<Exception>& to return exception results.
index 287c122..65dab95 100644 (file)
@@ -537,12 +537,6 @@ public:
         ConcurrentJITLocker locker(m_lock);
         return hasExitSite(locker, site);
     }
-    
-    size_t numberOfExitSites() const
-    {
-        ConcurrentJITLocker locker(m_lock);
-        return m_exitProfile.size();
-    }
 
     DFG::ExitProfile& exitProfile() { return m_exitProfile; }
 
index 42caa3a..40a25ce 100644 (file)
@@ -44,9 +44,15 @@ bool ExitProfile::add(const ConcurrentJITLocker&, const FrequentExitSite& site)
         m_frequentExitSites->append(site);
         return true;
     }
-
-    // Always add even if it's a duplicate. The side-effect of doing this is it gives us a
-    // complete count of the number of times we've exited here. 
+    
+    // Don't add it if it's already there. This is O(n), but that's OK, because we
+    // know that the total number of places where code exits tends to not be large,
+    // and this code is only used when recompilation is triggered.
+    for (unsigned i = 0; i < m_frequentExitSites->size(); ++i) {
+        if (m_frequentExitSites->at(i) == site)
+            return false;
+    }
+    
     m_frequentExitSites->append(site);
     return true;
 }
index 4a46ab6..cdecbaf 100644 (file)
@@ -179,13 +179,6 @@ public:
         return hasExitSite(locker, FrequentExitSite(bytecodeIndex, kind));
     }
     
-    size_t size() const
-    {
-        if (!m_frequentExitSites)
-            return 0;
-        return m_frequentExitSites->size();
-    }
-    
 private:
     friend class QueryableExitProfile;
     
index a7d9b0f..2c8b0c5 100644 (file)
@@ -1273,7 +1273,7 @@ unsigned ByteCodeParser::inliningCost(CallVariant callee, int argumentCountInclu
         dataLog("    Inlining should be possible.\n");
     
     // It might be possible to inline.
-    return codeBlock->instructionCount() * pow(1 + codeBlock->numberOfExitSites(), Options::exitSitePowerForInlineCost());
+    return codeBlock->instructionCount();
 }
 
 template<typename ChecksFunctor>
index a0a3fc3..fd1682c 100644 (file)
@@ -204,14 +204,12 @@ typedef const char* optionString;
     \
     v(unsigned, maximumOptimizationCandidateInstructionCount, 100000, nullptr) \
     \
-    v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 250, nullptr) \
-    v(unsigned, maximumFunctionForClosureCallInlineCandidateInstructionCount, 180, nullptr) \
-    v(unsigned, maximumFunctionForConstructInlineCandidateInstructionCount, 180, nullptr) \
+    v(unsigned, maximumFunctionForCallInlineCandidateInstructionCount, 180, nullptr) \
+    v(unsigned, maximumFunctionForClosureCallInlineCandidateInstructionCount, 100, nullptr) \
+    v(unsigned, maximumFunctionForConstructInlineCandidateInstructionCount, 100, nullptr) \
     \
     v(unsigned, maximumFTLCandidateInstructionCount, 20000, nullptr) \
     \
-    v(double, exitSitePowerForInlineCost, 0.5, nullptr) \
-    \
     /* Depth of inline stack, so 1 = no inlining, 2 = one level, etc. */ \
     v(unsigned, maximumInliningDepth, 5, "maximum allowed inlining depth.  Depth of 1 means no inlining") \
     v(unsigned, maximumInliningRecursion, 2, nullptr) \