X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..4be4e30906bcb8ee30b4d189205cb70bad6707ce:/bytecode/DFGExitProfile.cpp diff --git a/bytecode/DFGExitProfile.cpp b/bytecode/DFGExitProfile.cpp index 69fdc37..d36878f 100644 --- a/bytecode/DFGExitProfile.cpp +++ b/bytecode/DFGExitProfile.cpp @@ -55,6 +55,33 @@ bool ExitProfile::add(const FrequentExitSite& site) return true; } +Vector ExitProfile::exitSitesFor(unsigned bytecodeIndex) +{ + Vector result; + + if (!m_frequentExitSites) + return result; + + for (unsigned i = 0; i < m_frequentExitSites->size(); ++i) { + if (m_frequentExitSites->at(i).bytecodeOffset() == bytecodeIndex) + result.append(m_frequentExitSites->at(i)); + } + + return result; +} + +bool ExitProfile::hasExitSite(const FrequentExitSite& site) const +{ + if (!m_frequentExitSites) + return false; + + for (unsigned i = m_frequentExitSites->size(); i--;) { + if (m_frequentExitSites->at(i) == site) + return true; + } + return false; +} + QueryableExitProfile::QueryableExitProfile(const ExitProfile& profile) { if (!profile.m_frequentExitSites)