Any exit from any JIT due to profiling for an inline cache should force all future compilations to be wary
https://bugs.webkit.org/show_bug.cgi?id=145496
Reviewed by Geoffrey Garen.
This pessimizes compilation a bit, but it reduces the likelihood of exiting from FTL. I
couldn't find any convincing reason not to do this, and we know from Speedometer that this
change is necessary for weirder code.
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::computeExitSiteData):
(JSC::CallLinkStatus::computeDFGStatuses):
* bytecode/CallLinkStatus.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::appendVariant):
(JSC::GetByIdStatus::hasExitSite):
(JSC::GetByIdStatus::computeFor):
* bytecode/GetByIdStatus.h:
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::appendVariant):
(JSC::PutByIdStatus::hasExitSite):
(JSC::PutByIdStatus::computeFor):
* bytecode/PutByIdStatus.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@185103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
index ef02892..1f74c1d 100644
--- a/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
@@ -101,17 +101,16 @@
}
CallLinkStatus::ExitSiteData CallLinkStatus::computeExitSiteData(
- const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex,
- ExitingJITType exitingJITType)
+ const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
{
ExitSiteData exitSiteData;
#if ENABLE(DFG_JIT)
exitSiteData.m_takesSlowPath =
- profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadType, exitingJITType))
- || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadExecutable, exitingJITType));
+ profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadType))
+ || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadExecutable));
exitSiteData.m_badFunction =
- profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCell, exitingJITType));
+ profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCell));
#else
UNUSED_PARAM(locker);
UNUSED_PARAM(profiledBlock);
@@ -265,7 +264,7 @@
{
ConcurrentJITLocker locker(currentBaseline->m_lock);
exitSiteData = computeExitSiteData(
- locker, currentBaseline, codeOrigin.bytecodeIndex, ExitFromFTL);
+ locker, currentBaseline, codeOrigin.bytecodeIndex);
}
{
diff --git a/Source/JavaScriptCore/bytecode/CallLinkStatus.h b/Source/JavaScriptCore/bytecode/CallLinkStatus.h
index 3ae2316..c0c0fe8 100644
--- a/Source/JavaScriptCore/bytecode/CallLinkStatus.h
+++ b/Source/JavaScriptCore/bytecode/CallLinkStatus.h
@@ -81,7 +81,7 @@
bool m_takesSlowPath;
bool m_badFunction;
};
- static ExitSiteData computeExitSiteData(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex, ExitingJITType = ExitFromAnything);
+ static ExitSiteData computeExitSiteData(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
#if ENABLE(JIT)
// Computes the status assuming that we never took slow path and never previously
diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
index 30c2204..50e5260 100644
--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
@@ -59,10 +59,10 @@
}
#if ENABLE(DFG_JIT)
-bool GetByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex, ExitingJITType jitType)
+bool GetByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
{
- return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache, jitType))
- || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache, jitType));
+ return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache))
+ || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache));
}
#endif
@@ -232,7 +232,7 @@
{
ConcurrentJITLocker locker(profiledBlock->m_lock);
exitSiteData = CallLinkStatus::computeExitSiteData(
- locker, profiledBlock, codeOrigin.bytecodeIndex, ExitFromFTL);
+ locker, profiledBlock, codeOrigin.bytecodeIndex);
}
GetByIdStatus result;
@@ -247,7 +247,7 @@
{
ConcurrentJITLocker locker(profiledBlock->m_lock);
- if (hasExitSite(locker, profiledBlock, codeOrigin.bytecodeIndex, ExitFromFTL))
+ if (hasExitSite(locker, profiledBlock, codeOrigin.bytecodeIndex))
return GetByIdStatus(TakesSlowPath, true);
}
diff --git a/Source/JavaScriptCore/bytecode/GetByIdStatus.h b/Source/JavaScriptCore/bytecode/GetByIdStatus.h
index 7d4ebb2..32372cd 100644
--- a/Source/JavaScriptCore/bytecode/GetByIdStatus.h
+++ b/Source/JavaScriptCore/bytecode/GetByIdStatus.h
@@ -92,7 +92,7 @@
private:
#if ENABLE(DFG_JIT)
- static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex, ExitingJITType = ExitFromAnything);
+ static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
#endif
#if ENABLE(JIT)
static GetByIdStatus computeForStubInfo(
diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
index 24d7b44..04399c1 100644
--- a/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
+++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
@@ -54,10 +54,10 @@
}
#if ENABLE(DFG_JIT)
-bool PutByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex, ExitingJITType exitType)
+bool PutByIdStatus::hasExitSite(const ConcurrentJITLocker& locker, CodeBlock* profiledBlock, unsigned bytecodeIndex)
{
- return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache, exitType))
- || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache, exitType));
+ return profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadCache))
+ || profiledBlock->hasExitSite(locker, DFG::FrequentExitSite(bytecodeIndex, BadConstantCache));
}
#endif
@@ -281,10 +281,10 @@
CallLinkStatus::ExitSiteData exitSiteData;
{
ConcurrentJITLocker locker(baselineBlock->m_lock);
- if (hasExitSite(locker, baselineBlock, codeOrigin.bytecodeIndex, ExitFromFTL))
+ if (hasExitSite(locker, baselineBlock, codeOrigin.bytecodeIndex))
return PutByIdStatus(TakesSlowPath);
exitSiteData = CallLinkStatus::computeExitSiteData(
- locker, baselineBlock, codeOrigin.bytecodeIndex, ExitFromFTL);
+ locker, baselineBlock, codeOrigin.bytecodeIndex);
}
PutByIdStatus result;
diff --git a/Source/JavaScriptCore/bytecode/PutByIdStatus.h b/Source/JavaScriptCore/bytecode/PutByIdStatus.h
index 0461dc4..652ccc1 100644
--- a/Source/JavaScriptCore/bytecode/PutByIdStatus.h
+++ b/Source/JavaScriptCore/bytecode/PutByIdStatus.h
@@ -92,7 +92,7 @@
private:
#if ENABLE(DFG_JIT)
- static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex, ExitingJITType = ExitFromAnything);
+ static bool hasExitSite(const ConcurrentJITLocker&, CodeBlock*, unsigned bytecodeIndex);
#endif
#if ENABLE(JIT)
static PutByIdStatus computeForStubInfo(