]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tools/CodeProfile.cpp
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tools / CodeProfile.cpp
index de86e52efb6eeb3ec2dbf3551e1f4c4213789fd7..b99df2c663e26426833c77952b75d23392c0b0e5 100644 (file)
@@ -33,7 +33,7 @@
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
-#if PLATFORM(MAC)
+#if OS(DARWIN)
 #include <cxxabi.h>
 #include <dlfcn.h>
 #include <execinfo.h>
@@ -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 "<unknown>";
@@ -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<JSC::Lexer<unsigned char> >::parseInner()")
+        || !strcmp(symbolName, "JSC::Parser<JSC::Lexer<unsigned char>>::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<CodeBlock*>(ownerUID);
-            if (codeBlock->getJITType() == JITCode::DFGJIT)
+            if (codeBlock->jitType() == JITCode::DFGJIT)
                 type = DFGJIT;
-            else if (codeBlock->canCompileWithDFGState() != DFG::CanCompile)
+            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<void**>(*framePointer);