Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(976)

Unified Diff: src/profile-generator.cc

Issue 3417019: Provide more functions to CPU profiler (fix issue 858). (Closed)
Patch Set: Hooked on MC/MS also Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/log.cc ('K') | « src/profile-generator.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index a7cb7a238ca165335be8bc6bf0f7ba9791191fd3..525dea2fbaa0cf71a010c316e6b58309250ad866 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -134,10 +134,13 @@ void CodeEntry::CopyData(const CodeEntry& source) {
uint32_t CodeEntry::GetCallUid() const {
uint32_t hash = ComputeIntegerHash(tag_);
- hash ^= static_cast<int32_t>(reinterpret_cast<intptr_t>(name_prefix_));
- hash ^= static_cast<int32_t>(reinterpret_cast<intptr_t>(name_));
- hash ^= static_cast<int32_t>(reinterpret_cast<intptr_t>(resource_name_));
- hash ^= static_cast<int32_t>(line_number_);
+ hash ^= ComputeIntegerHash(
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_prefix_)));
+ hash ^= ComputeIntegerHash(
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name_)));
+ hash ^= ComputeIntegerHash(
+ static_cast<uint32_t>(reinterpret_cast<uintptr_t>(resource_name_)));
+ hash ^= ComputeIntegerHash(line_number_);
return hash;
}
@@ -442,9 +445,10 @@ void CodeMap::AddAlias(Address start, CodeEntry* entry, Address code_start) {
CodeTree::Locator locator;
if (tree_.Find(code_start, &locator)) {
const CodeEntryInfo& code_info = locator.value();
- entry->CopyData(*code_info.entry);
- tree_.Insert(start, &locator);
- locator.set_value(CodeEntryInfo(entry, code_info.size));
+ if (tree_.Insert(start, &locator)) {
+ entry->CopyData(*code_info.entry);
+ locator.set_value(CodeEntryInfo(entry, code_info.size));
+ }
}
}
« src/log.cc ('K') | « src/profile-generator.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698