diff options
Diffstat (limited to 'JavaScriptCore/profiler/ProfileNode.cpp')
| -rw-r--r-- | JavaScriptCore/profiler/ProfileNode.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp index fb126b3..8f20bbe 100644 --- a/JavaScriptCore/profiler/ProfileNode.cpp +++ b/JavaScriptCore/profiler/ProfileNode.cpp @@ -32,6 +32,7 @@ #include "Profiler.h" #include <stdio.h> #include <wtf/DateMath.h> +#include <wtf/text/StringHash.h> #if OS(WINDOWS) #include <windows.h> @@ -44,7 +45,7 @@ namespace JSC { static double getCount() { #if OS(WINDOWS) - static LARGE_INTEGER frequency = {0}; + static LARGE_INTEGER frequency; if (!frequency.QuadPart) QueryPerformanceFrequency(&frequency); LARGE_INTEGER counter; @@ -55,8 +56,9 @@ static double getCount() #endif } -ProfileNode::ProfileNode(const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode) - : m_callIdentifier(callIdentifier) +ProfileNode::ProfileNode(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* headNode, ProfileNode* parentNode) + : m_callerCallFrame(callerCallFrame) + , m_callIdentifier(callIdentifier) , m_head(headNode) , m_parent(parentNode) , m_nextSibling(0) @@ -71,8 +73,9 @@ ProfileNode::ProfileNode(const CallIdentifier& callIdentifier, ProfileNode* head startTimer(); } -ProfileNode::ProfileNode(ProfileNode* headNode, ProfileNode* nodeToCopy) - : m_callIdentifier(nodeToCopy->callIdentifier()) +ProfileNode::ProfileNode(ExecState* callerCallFrame, ProfileNode* headNode, ProfileNode* nodeToCopy) + : m_callerCallFrame(callerCallFrame) + , m_callIdentifier(nodeToCopy->callIdentifier()) , m_head(headNode) , m_parent(nodeToCopy->parent()) , m_nextSibling(0) @@ -86,7 +89,7 @@ ProfileNode::ProfileNode(ProfileNode* headNode, ProfileNode* nodeToCopy) { } -ProfileNode* ProfileNode::willExecute(const CallIdentifier& callIdentifier) +ProfileNode* ProfileNode::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier) { for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { if ((*currentChild)->callIdentifier() == callIdentifier) { @@ -95,7 +98,7 @@ ProfileNode* ProfileNode::willExecute(const CallIdentifier& callIdentifier) } } - RefPtr<ProfileNode> newChild = ProfileNode::create(callIdentifier, m_head ? m_head : this, this); // If this ProfileNode has no head it is the head. + RefPtr<ProfileNode> newChild = ProfileNode::create(callerCallFrame, callIdentifier, m_head ? m_head : this, this); // If this ProfileNode has no head it is the head. if (m_children.size()) m_children.last()->setNextSibling(newChild.get()); m_children.append(newChild.release()); @@ -293,11 +296,11 @@ void ProfileNode::debugPrintData(int indentLevel) const printf(" "); printf("Function Name %s %d SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% VSelf %.3fms VTotal %.3fms Visible %s Next Sibling %s\n", - functionName().UTF8String().c_str(), + functionName().utf8().data(), m_numberOfCalls, m_actualSelfTime, selfPercent(), m_actualTotalTime, totalPercent(), m_visibleSelfTime, m_visibleTotalTime, (m_visible ? "True" : "False"), - m_nextSibling ? m_nextSibling->functionName().UTF8String().c_str() : ""); + m_nextSibling ? m_nextSibling->functionName().utf8().data() : ""); ++indentLevel; @@ -312,13 +315,13 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC printf(" "); // Print function names - const char* name = functionName().UTF8String().c_str(); + const char* name = functionName().utf8().data(); double sampleCount = m_actualTotalTime * 1000; if (indentLevel) { for (int i = 0; i < indentLevel; ++i) printf(" "); - countedFunctions.add(functionName().rep()); + countedFunctions.add(functionName().impl()); printf("%.0f %s\n", sampleCount ? sampleCount : 1, name); } else @@ -338,7 +341,7 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC while (indentLevel--) printf(" "); - printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().c_str()); + printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data()); } return m_actualTotalTime; |
