diff options
Diffstat (limited to 'JavaScriptCore/profiler/CallIdentifier.h')
| -rw-r--r-- | JavaScriptCore/profiler/CallIdentifier.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/JavaScriptCore/profiler/CallIdentifier.h b/JavaScriptCore/profiler/CallIdentifier.h index ba48c55..76c1470 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 { @@ -44,7 +46,7 @@ namespace JSC { CallIdentifier(const UString& name, const UString& url, int lineNumber) : m_name(name) - , m_url(url) + , m_url(!url.isNull() ? url : "") , m_lineNumber(lineNumber) { } @@ -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 WTF::StringHasher::createBlobHash<sizeof(hashCodes)>(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().c_str(); } + const char* c_str() const { return m_name.utf8().data(); } #endif }; |
