From 6ed90e6dd0a7e9f3af53231b39e5f47cefac4edd Mon Sep 17 00:00:00 2001 From: yurys Date: Fri, 11 Sep 2015 09:29:55 -0700 Subject: [PATCH] Profiler code clean-up BUG=None LOG=N Review URL: https://codereview.chromium.org/1332683002 Cr-Commit-Position: refs/heads/master@{#30702} --- src/profile-generator-inl.h | 10 ---------- src/profile-generator.cc | 11 +++-------- src/profile-generator.h | 5 +---- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h index 1e543dda8b..966578ab26 100644 --- a/src/profile-generator-inl.h +++ b/src/profile-generator-inl.h @@ -31,16 +31,6 @@ CodeEntry::CodeEntry(Logger::LogEventsAndTags tag, const char* name, instruction_start_(instruction_start) {} -bool CodeEntry::is_js_function_tag(Logger::LogEventsAndTags tag) { - return tag == Logger::FUNCTION_TAG - || tag == Logger::LAZY_COMPILE_TAG - || tag == Logger::SCRIPT_TAG - || tag == Logger::NATIVE_FUNCTION_TAG - || tag == Logger::NATIVE_LAZY_COMPILE_TAG - || tag == Logger::NATIVE_SCRIPT_TAG; -} - - ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry) : tree_(tree), entry_(entry), diff --git a/src/profile-generator.cc b/src/profile-generator.cc index 3cb3fa40b6..aefc52a96f 100644 --- a/src/profile-generator.cc +++ b/src/profile-generator.cc @@ -405,15 +405,12 @@ void CodeMap::DeleteAllCoveredCode(Address start, Address end) { } -CodeEntry* CodeMap::FindEntry(Address addr, Address* start) { +CodeEntry* CodeMap::FindEntry(Address addr) { CodeTree::Locator locator; if (tree_.FindGreatestLessThan(addr, &locator)) { // locator.key() <= addr. Need to check that addr is within entry. const CodeEntryInfo& entry = locator.value(); if (addr < (locator.key() + entry.size)) { - if (start) { - *start = locator.key(); - } return entry.entry; } } @@ -601,8 +598,7 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { // that a callback calls itself. *entry++ = code_map_.FindEntry(sample.external_callback); } else { - Address start; - CodeEntry* pc_entry = code_map_.FindEntry(sample.pc, &start); + CodeEntry* pc_entry = code_map_.FindEntry(sample.pc); // If there is no pc_entry we're likely in native code. // Find out, if top of stack was pointing inside a JS function // meaning that we have encountered a frameless invocation. @@ -651,8 +647,7 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { *stack_end = stack_pos + sample.frames_count; stack_pos != stack_end; ++stack_pos) { - Address start = NULL; - *entry = code_map_.FindEntry(*stack_pos, &start); + *entry = code_map_.FindEntry(*stack_pos); // Skip unresolved frames (e.g. internal frame) and get source line of // the first JS caller. diff --git a/src/profile-generator.h b/src/profile-generator.h index e1826f742e..73d022559a 100644 --- a/src/profile-generator.h +++ b/src/profile-generator.h @@ -49,7 +49,6 @@ class CodeEntry { Address instruction_start = NULL); ~CodeEntry(); - bool is_js_function() const { return is_js_function_tag(tag()); } const char* name_prefix() const { return name_prefix_; } bool has_name_prefix() const { return name_prefix_[0] != '\0'; } const char* name() const { return name_; } @@ -84,8 +83,6 @@ class CodeEntry { void FillFunctionInfo(SharedFunctionInfo* shared); - static inline bool is_js_function_tag(Logger::LogEventsAndTags tag); - List* no_frame_ranges() const { return no_frame_ranges_; } void set_no_frame_ranges(List* ranges) { no_frame_ranges_ = ranges; @@ -269,7 +266,7 @@ class CodeMap { ~CodeMap(); void AddCode(Address addr, CodeEntry* entry, unsigned size); void MoveCode(Address from, Address to); - CodeEntry* FindEntry(Address addr, Address* start = NULL); + CodeEntry* FindEntry(Address addr); int GetSharedId(Address addr); void Print();