summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/profiler
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/profiler')
-rw-r--r--JavaScriptCore/profiler/CallIdentifier.h10
-rw-r--r--JavaScriptCore/profiler/Profile.cpp4
-rw-r--r--JavaScriptCore/profiler/ProfileGenerator.cpp8
-rw-r--r--JavaScriptCore/profiler/ProfileNode.cpp10
-rw-r--r--JavaScriptCore/profiler/ProfileNode.h5
-rw-r--r--JavaScriptCore/profiler/Profiler.cpp1
6 files changed, 21 insertions, 17 deletions
diff --git a/JavaScriptCore/profiler/CallIdentifier.h b/JavaScriptCore/profiler/CallIdentifier.h
index f2d04fc..5487209 100644
--- a/JavaScriptCore/profiler/CallIdentifier.h
+++ b/JavaScriptCore/profiler/CallIdentifier.h
@@ -29,6 +29,8 @@
#include <runtime/UString.h>
#include "FastAllocBase.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/StringHash.h>
namespace JSC {
@@ -56,11 +58,11 @@ namespace JSC {
static unsigned hash(const CallIdentifier& key)
{
unsigned hashCodes[3] = {
- key.m_name.rep()->hash(),
- key.m_url.rep()->hash(),
+ key.m_name.impl()->hash(),
+ key.m_url.impl()->hash(),
key.m_lineNumber
};
- return UString::Rep::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes));
+ return StringImpl::computeHash(reinterpret_cast<char*>(hashCodes), sizeof(hashCodes));
}
static bool equal(const CallIdentifier& a, const CallIdentifier& b) { return a == b; }
@@ -71,7 +73,7 @@ namespace JSC {
#ifndef NDEBUG
operator const char*() const { return c_str(); }
- const char* c_str() const { return m_name.UTF8String().data(); }
+ const char* c_str() const { return m_name.utf8().data(); }
#endif
};
diff --git a/JavaScriptCore/profiler/Profile.cpp b/JavaScriptCore/profiler/Profile.cpp
index 126e6f6..bc239b3 100644
--- a/JavaScriptCore/profiler/Profile.cpp
+++ b/JavaScriptCore/profiler/Profile.cpp
@@ -106,7 +106,7 @@ void Profile::debugPrintData() const
m_head->debugPrintData(0);
}
-typedef pair<UString::Rep*, unsigned> NameCountPair;
+typedef pair<StringImpl*, unsigned> NameCountPair;
static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b)
{
@@ -127,7 +127,7 @@ void Profile::debugPrintDataSampleStyle() const
std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
- printf(" %-12d%s\n", (*it).second, UString((*it).first).UTF8String().data());
+ printf(" %-12d%s\n", (*it).second, UString((*it).first).utf8().data());
printf("\nSort by top of stack, same collapsed (when >= 5):\n");
}
diff --git a/JavaScriptCore/profiler/ProfileGenerator.cpp b/JavaScriptCore/profiler/ProfileGenerator.cpp
index bdfa27b..1d916ea 100644
--- a/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ b/JavaScriptCore/profiler/ProfileGenerator.cpp
@@ -75,8 +75,8 @@ const UString& ProfileGenerator::title() const
void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_WILL_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
JAVASCRIPTCORE_PROFILE_WILL_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
@@ -90,8 +90,8 @@ void ProfileGenerator::willExecute(const CallIdentifier& callIdentifier)
void ProfileGenerator::didExecute(const CallIdentifier& callIdentifier)
{
if (JAVASCRIPTCORE_PROFILE_DID_EXECUTE_ENABLED()) {
- CString name = callIdentifier.m_name.UTF8String();
- CString url = callIdentifier.m_url.UTF8String();
+ CString name = callIdentifier.m_name.utf8();
+ CString url = callIdentifier.m_url.utf8();
JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.data()), const_cast<char*>(url.data()), callIdentifier.m_lineNumber);
}
diff --git a/JavaScriptCore/profiler/ProfileNode.cpp b/JavaScriptCore/profiler/ProfileNode.cpp
index 1391f99..bfcfcbe 100644
--- a/JavaScriptCore/profiler/ProfileNode.cpp
+++ b/JavaScriptCore/profiler/ProfileNode.cpp
@@ -294,11 +294,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().data(),
+ 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().data() : "");
+ m_nextSibling ? m_nextSibling->functionName().utf8().data() : "");
++indentLevel;
@@ -313,13 +313,13 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
printf(" ");
// Print function names
- const char* name = functionName().UTF8String().data();
+ 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
@@ -339,7 +339,7 @@ double ProfileNode::debugPrintDataSampleStyle(int indentLevel, FunctionCallHashC
while (indentLevel--)
printf(" ");
- printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().UTF8String().data());
+ printf("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data());
}
return m_actualTotalTime;
diff --git a/JavaScriptCore/profiler/ProfileNode.h b/JavaScriptCore/profiler/ProfileNode.h
index 2b5a936..eafeea6 100644
--- a/JavaScriptCore/profiler/ProfileNode.h
+++ b/JavaScriptCore/profiler/ProfileNode.h
@@ -30,16 +30,17 @@
#define ProfileNode_h
#include "CallIdentifier.h"
-#include <wtf/Vector.h>
+#include <wtf/HashCountedSet.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace JSC {
class ProfileNode;
typedef Vector<RefPtr<ProfileNode> >::const_iterator StackIterator;
- typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
+ typedef HashCountedSet<StringImpl*> FunctionCallHashCount;
class ProfileNode : public RefCounted<ProfileNode> {
public:
diff --git a/JavaScriptCore/profiler/Profiler.cpp b/JavaScriptCore/profiler/Profiler.cpp
index 94e46a4..021ecff 100644
--- a/JavaScriptCore/profiler/Profiler.cpp
+++ b/JavaScriptCore/profiler/Profiler.cpp
@@ -39,6 +39,7 @@
#include "Profile.h"
#include "ProfileGenerator.h"
#include "ProfileNode.h"
+#include "StringConcatenate.h"
#include <stdio.h>
namespace JSC {