Commit 0895b9c5 authored by yurys@chromium.org's avatar yurys@chromium.org

profile-generator.* code clean-up

* Removed unused CodeEntry::CopyData
* Removed unnecessary INLINE macros

BUG=None
R=loislo@chromium.org, yangguo@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ef3867b1
...@@ -79,25 +79,6 @@ ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry) ...@@ -79,25 +79,6 @@ ProfileNode::ProfileNode(ProfileTree* tree, CodeEntry* entry)
children_(CodeEntriesMatch), children_(CodeEntriesMatch),
id_(tree->next_node_id()) { } id_(tree->next_node_id()) { }
CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
switch (tag) {
case GC:
return gc_entry_;
case JS:
case COMPILER:
// DOM events handlers are reported as OTHER / EXTERNAL entries.
// To avoid confusing people, let's put all these entries into
// one bucket.
case OTHER:
case EXTERNAL:
return program_entry_;
case IDLE:
return idle_entry_;
default: return NULL;
}
}
} } // namespace v8::internal } } // namespace v8::internal
#endif // V8_PROFILE_GENERATOR_INL_H_ #endif // V8_PROFILE_GENERATOR_INL_H_
...@@ -141,15 +141,6 @@ CodeEntry::~CodeEntry() { ...@@ -141,15 +141,6 @@ CodeEntry::~CodeEntry() {
} }
void CodeEntry::CopyData(const CodeEntry& source) {
tag_ = source.tag_;
name_prefix_ = source.name_prefix_;
name_ = source.name_;
resource_name_ = source.resource_name_;
line_number_ = source.line_number_;
}
uint32_t CodeEntry::GetCallUid() const { uint32_t CodeEntry::GetCallUid() const {
uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed); uint32_t hash = ComputeIntegerHash(tag_, v8::internal::kZeroHashSeed);
if (shared_id_ != 0) { if (shared_id_ != 0) {
...@@ -662,4 +653,22 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { ...@@ -662,4 +653,22 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
} }
CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
switch (tag) {
case GC:
return gc_entry_;
case JS:
case COMPILER:
// DOM events handlers are reported as OTHER / EXTERNAL entries.
// To avoid confusing people, let's put all these entries into
// one bucket.
case OTHER:
case EXTERNAL:
return program_entry_;
case IDLE:
return idle_entry_;
default: return NULL;
}
}
} } // namespace v8::internal } } // namespace v8::internal
...@@ -56,7 +56,7 @@ class StringsStorage { ...@@ -56,7 +56,7 @@ class StringsStorage {
private: private:
static const int kMaxNameSize = 1024; static const int kMaxNameSize = 1024;
INLINE(static bool StringsMatch(void* key1, void* key2)) { static bool StringsMatch(void* key1, void* key2) {
return strcmp(reinterpret_cast<char*>(key1), return strcmp(reinterpret_cast<char*>(key1),
reinterpret_cast<char*>(key2)) == 0; reinterpret_cast<char*>(key2)) == 0;
} }
...@@ -73,31 +73,30 @@ class StringsStorage { ...@@ -73,31 +73,30 @@ class StringsStorage {
class CodeEntry { class CodeEntry {
public: public:
// CodeEntry doesn't own name strings, just references them. // CodeEntry doesn't own name strings, just references them.
INLINE(CodeEntry(Logger::LogEventsAndTags tag, inline CodeEntry(Logger::LogEventsAndTags tag,
const char* name, const char* name,
const char* name_prefix = CodeEntry::kEmptyNamePrefix, const char* name_prefix = CodeEntry::kEmptyNamePrefix,
const char* resource_name = CodeEntry::kEmptyResourceName, const char* resource_name = CodeEntry::kEmptyResourceName,
int line_number = v8::CpuProfileNode::kNoLineNumberInfo, int line_number = v8::CpuProfileNode::kNoLineNumberInfo,
int column_number = int column_number = v8::CpuProfileNode::kNoColumnNumberInfo);
v8::CpuProfileNode::kNoColumnNumberInfo));
~CodeEntry(); ~CodeEntry();
INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } bool is_js_function() const { return is_js_function_tag(tag_); }
INLINE(const char* name_prefix() const) { return name_prefix_; } const char* name_prefix() const { return name_prefix_; }
INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } bool has_name_prefix() const { return name_prefix_[0] != '\0'; }
INLINE(const char* name() const) { return name_; } const char* name() const { return name_; }
INLINE(const char* resource_name() const) { return resource_name_; } const char* resource_name() const { return resource_name_; }
INLINE(int line_number() const) { return line_number_; } int line_number() const { return line_number_; }
int column_number() const { return column_number_; } int column_number() const { return column_number_; }
INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } void set_shared_id(int shared_id) { shared_id_ = shared_id; }
INLINE(int script_id() const) { return script_id_; } int script_id() const { return script_id_; }
INLINE(void set_script_id(int script_id)) { script_id_ = script_id; } void set_script_id(int script_id) { script_id_ = script_id; }
INLINE(void set_bailout_reason(const char* bailout_reason)) { void set_bailout_reason(const char* bailout_reason) {
bailout_reason_ = bailout_reason; bailout_reason_ = bailout_reason;
} }
INLINE(const char* bailout_reason() const) { return bailout_reason_; } const char* bailout_reason() const { return bailout_reason_; }
INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); static inline bool is_js_function_tag(Logger::LogEventsAndTags tag);
List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; }
void set_no_frame_ranges(List<OffsetRange>* ranges) { void set_no_frame_ranges(List<OffsetRange>* ranges) {
...@@ -107,7 +106,6 @@ class CodeEntry { ...@@ -107,7 +106,6 @@ class CodeEntry {
void SetBuiltinId(Builtins::Name id); void SetBuiltinId(Builtins::Name id);
Builtins::Name builtin_id() const { return builtin_id_; } Builtins::Name builtin_id() const { return builtin_id_; }
void CopyData(const CodeEntry& source);
uint32_t GetCallUid() const; uint32_t GetCallUid() const;
bool IsSameAs(CodeEntry* entry) const; bool IsSameAs(CodeEntry* entry) const;
...@@ -136,27 +134,27 @@ class ProfileTree; ...@@ -136,27 +134,27 @@ class ProfileTree;
class ProfileNode { class ProfileNode {
public: public:
INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry)); inline ProfileNode(ProfileTree* tree, CodeEntry* entry);
ProfileNode* FindChild(CodeEntry* entry); ProfileNode* FindChild(CodeEntry* entry);
ProfileNode* FindOrAddChild(CodeEntry* entry); ProfileNode* FindOrAddChild(CodeEntry* entry);
INLINE(void IncrementSelfTicks()) { ++self_ticks_; } void IncrementSelfTicks() { ++self_ticks_; }
INLINE(void IncreaseSelfTicks(unsigned amount)) { self_ticks_ += amount; } void IncreaseSelfTicks(unsigned amount) { self_ticks_ += amount; }
INLINE(CodeEntry* entry() const) { return entry_; } CodeEntry* entry() const { return entry_; }
INLINE(unsigned self_ticks() const) { return self_ticks_; } unsigned self_ticks() const { return self_ticks_; }
INLINE(const List<ProfileNode*>* children() const) { return &children_list_; } const List<ProfileNode*>* children() const { return &children_list_; }
unsigned id() const { return id_; } unsigned id() const { return id_; }
void Print(int indent); void Print(int indent);
private: private:
INLINE(static bool CodeEntriesMatch(void* entry1, void* entry2)) { static bool CodeEntriesMatch(void* entry1, void* entry2) {
return reinterpret_cast<CodeEntry*>(entry1)->IsSameAs( return reinterpret_cast<CodeEntry*>(entry1)->IsSameAs(
reinterpret_cast<CodeEntry*>(entry2)); reinterpret_cast<CodeEntry*>(entry2));
} }
INLINE(static uint32_t CodeEntryHash(CodeEntry* entry)) { static uint32_t CodeEntryHash(CodeEntry* entry) {
return entry->GetCallUid(); return entry->GetCallUid();
} }
...@@ -336,7 +334,7 @@ class ProfileGenerator { ...@@ -336,7 +334,7 @@ class ProfileGenerator {
void RecordTickSample(const TickSample& sample); void RecordTickSample(const TickSample& sample);
INLINE(CodeMap* code_map()) { return &code_map_; } CodeMap* code_map() { return &code_map_; }
static const char* const kAnonymousFunctionName; static const char* const kAnonymousFunctionName;
static const char* const kProgramEntryName; static const char* const kProgramEntryName;
...@@ -347,7 +345,7 @@ class ProfileGenerator { ...@@ -347,7 +345,7 @@ class ProfileGenerator {
static const char* const kUnresolvedFunctionName; static const char* const kUnresolvedFunctionName;
private: private:
INLINE(CodeEntry* EntryForVMState(StateTag tag)); CodeEntry* EntryForVMState(StateTag tag);
CpuProfilesCollection* profiles_; CpuProfilesCollection* profiles_;
CodeMap code_map_; CodeMap code_map_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment