X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/6fe7ccc865dc7d7541b93c5bcaf6368d2c98a174..ef99ff287df9046eb88937225e0554eabb00e33c:/tools/CodeProfile.cpp diff --git a/tools/CodeProfile.cpp b/tools/CodeProfile.cpp index beed4b2..b99df2c 100644 --- a/tools/CodeProfile.cpp +++ b/tools/CodeProfile.cpp @@ -33,7 +33,7 @@ #include #include -#if PLATFORM(MAC) +#if OS(DARWIN) #include #include #include @@ -56,7 +56,7 @@ const char* CodeProfile::s_codeTypeNames[CodeProfile::NumberOfCodeTypes] = { // Helper function, find the symbol name for a pc in JSC. static const char* symbolName(void* address) { -#if PLATFORM(MAC) +#if OS(DARWIN) Dl_info info; if (!dladdr(address, &info) || !info.dli_sname) return ""; @@ -74,7 +74,7 @@ static const char* symbolName(void* address) static bool truncateTrace(const char* symbolName) { return !strcmp(symbolName, "JSC::BytecodeGenerator::generate()") - || !strcmp(symbolName, "JSC::Parser >::parseInner()") + || !strcmp(symbolName, "JSC::Parser>::parseInner()") || !strcmp(symbolName, "WTF::fastMalloc(unsigned long)") || !strcmp(symbolName, "WTF::calculateUTCOffset()") || !strcmp(symbolName, "JSC::DFG::ByteCodeParser::parseCodeBlock()"); @@ -105,9 +105,9 @@ void CodeProfile::sample(void* pc, void** framePointer) type = RegExpCode; else { CodeBlock* codeBlock = static_cast(ownerUID); - if (codeBlock->getJITType() == JITCode::DFGJIT) + if (codeBlock->jitType() == JITCode::DFGJIT) type = DFGJIT; - else if (codeBlock->canCompileWithDFGState() == CodeBlock::CompileWithDFGFalse) + else if (!canCompile(codeBlock->capabilityLevelState())) type = BaselineOnly; else if (codeBlock->replacement()) type = BaselineOSR; @@ -123,7 +123,7 @@ void CodeProfile::sample(void* pc, void** framePointer) if (type != EngineFrame) return; -#if PLATFORM(MAC) && CPU(X86_64) +#if OS(DARWIN) && CPU(X86_64) // Walk up the stack. pc = framePointer[1]; framePointer = reinterpret_cast(*framePointer); @@ -133,7 +133,7 @@ void CodeProfile::sample(void* pc, void** framePointer) framePointer = 0; #else // This platform is not yet supported! - ASSERT_NOT_REACHED(); + RELEASE_ASSERT_NOT_REACHED(); #endif } @@ -143,7 +143,7 @@ void CodeProfile::sample(void* pc, void** framePointer) void CodeProfile::report() { - dataLog("\n", m_file.data(), m_lineNo); + dataLogF("\n", m_file.data(), m_lineNo); // How many frames of C-code to print - 0, if not verbose, 1 if verbose, up to 1024 if very verbose. unsigned recursionLimit = CodeProfiling::beVeryVerbose() ? 1024 : CodeProfiling::beVerbose(); @@ -180,13 +180,13 @@ void CodeProfile::report() } // Output the profile tree. - dataLog("Total samples: %lld\n", static_cast(profile.childCount())); + dataLogF("Total samples: %lld\n", static_cast(profile.childCount())); profile.dump(); for (size_t i = 0 ; i < m_children.size(); ++i) m_children[i]->report(); - dataLog("\n", m_file.data(), m_lineNo); + dataLogF("\n", m_file.data(), m_lineNo); } }