Index: src/profile-generator.cc |
diff --git a/src/profile-generator.cc b/src/profile-generator.cc |
index f8fa23de46d5e3cb1e9552845bb25a6990474c69..a7cb7a238ca165335be8bc6bf0f7ba9791191fd3 100644 |
--- a/src/profile-generator.cc |
+++ b/src/profile-generator.cc |
@@ -121,11 +121,9 @@ const char* StringsStorage::GetName(String* name) { |
const char* CodeEntry::kEmptyNamePrefix = ""; |
-unsigned CodeEntry::next_call_uid_ = 1; |
void CodeEntry::CopyData(const CodeEntry& source) { |
- call_uid_ = source.call_uid_; |
tag_ = source.tag_; |
name_prefix_ = source.name_prefix_; |
name_ = source.name_; |
@@ -134,6 +132,26 @@ 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_); |
+ return hash; |
+} |
+ |
+ |
+bool CodeEntry::IsSameAs(CodeEntry* entry) const { |
+ return this == entry |
+ || (tag_ == entry->tag_ |
+ && name_prefix_ == entry->name_prefix_ |
+ && name_ == entry->name_ |
+ && resource_name_ == entry->resource_name_ |
+ && line_number_ == entry->line_number_); |
+} |
+ |
+ |
ProfileNode* ProfileNode::FindChild(CodeEntry* entry) { |
HashMap::Entry* map_entry = |
children_.Lookup(entry, CodeEntryHash(entry), false); |