Profiler code clean-up

BUG=None
LOG=N

Review URL: https://codereview.chromium.org/1332683002

Cr-Commit-Position: refs/heads/master@{#30702}
This commit is contained in:
yurys 2015-09-11 09:29:55 -07:00 committed by Commit bot
parent a4605ef9b0
commit 6ed90e6dd0
3 changed files with 4 additions and 22 deletions

View File

@ -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),

View File

@ -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.

View File

@ -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<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; }
void set_no_frame_ranges(List<OffsetRange>* 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();