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

Unified Diff: src/profile-generator.cc

Issue 3426008: Show RegExp calls in the profile. (Closed)
Patch Set: 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
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('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 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);
« no previous file with comments | « src/profile-generator.h ('k') | src/profile-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698