Chromium Code Reviews| Index: src/profile-generator.h |
| diff --git a/src/profile-generator.h b/src/profile-generator.h |
| index 4f44c4c8abc9ba55ec1411234662307c73734fa0..e8d752d97dee18c7ac55aa360d9c2bbb61b32511 100644 |
| --- a/src/profile-generator.h |
| +++ b/src/profile-generator.h |
| @@ -36,6 +36,17 @@ class JITLineInfoTable : public Malloced { |
| DISALLOW_COPY_AND_ASSIGN(JITLineInfoTable); |
| }; |
| + |
| +struct DeoptInfo { |
| + const char* deopt_reason; |
| + struct Frame { |
| + int script_id; |
| + int position; |
| + }; |
| + std::vector<Frame> stack; |
| +}; |
| + |
| + |
| class CodeEntry { |
| public: |
| // CodeEntry doesn't own name strings, just references them. |
| @@ -72,6 +83,7 @@ class CodeEntry { |
| deopt_position_ = position; |
| pc_offset_ = pc_offset; |
| } |
| + DeoptInfo* GetDeoptInfo(); |
| const char* deopt_reason() const { return deopt_reason_; } |
| SourcePosition deopt_position() const { return deopt_position_; } |
| bool has_deopt_info() const { return !deopt_position_.IsUnknown(); } |
| @@ -88,6 +100,15 @@ class CodeEntry { |
| void set_no_frame_ranges(List<OffsetRange>* ranges) { |
| no_frame_ranges_ = ranges; |
| } |
| + void set_inlined_function_infos(std::vector<InlinedFunctionInfo>* infos) { |
| + DCHECK(!inlined_function_infos_); |
| + inlined_function_infos_ = infos; |
| + } |
| + std::vector<InlinedFunctionInfo>* ReleaseInlinedFunctionInfos() { |
| + std::vector<InlinedFunctionInfo>* tmp = inlined_function_infos_; |
| + inlined_function_infos_ = NULL; |
| + return tmp; |
| + } |
| void SetBuiltinId(Builtins::Name id); |
| Builtins::Name builtin_id() const { |
| @@ -127,6 +148,8 @@ class CodeEntry { |
| JITLineInfoTable* line_info_; |
| Address instruction_start_; |
| + std::vector<InlinedFunctionInfo>* inlined_function_infos_; |
|
alph
2015/03/20 08:28:43
ditto
loislo
2015/03/20 08:53:12
done
|
| + |
| DISALLOW_COPY_AND_ASSIGN(CodeEntry); |
| }; |
| @@ -134,19 +157,9 @@ class CodeEntry { |
| class ProfileTree; |
| class ProfileNode { |
| - private: |
| - struct DeoptInfo { |
| - DeoptInfo(const char* deopt_reason, SourcePosition deopt_position) |
| - : deopt_reason(deopt_reason), deopt_position(deopt_position) {} |
| - DeoptInfo(const DeoptInfo& info) |
| - : deopt_reason(info.deopt_reason), |
| - deopt_position(info.deopt_position) {} |
| - const char* deopt_reason; |
| - SourcePosition deopt_position; |
| - }; |
| - |
| public: |
| inline ProfileNode(ProfileTree* tree, CodeEntry* entry); |
| + ~ProfileNode(); |
| ProfileNode* FindChild(CodeEntry* entry); |
| ProfileNode* FindOrAddChild(CodeEntry* entry); |
| @@ -163,7 +176,7 @@ class ProfileNode { |
| bool GetLineTicks(v8::CpuProfileNode::LineTick* entries, |
| unsigned int length) const; |
| void CollectDeoptInfo(CodeEntry* entry); |
| - const List<DeoptInfo>& deopt_infos() const { return deopt_infos_; } |
| + const std::vector<DeoptInfo*>& deopt_infos() const { return deopt_infos_; } |
| void Print(int indent); |
| @@ -186,7 +199,8 @@ class ProfileNode { |
| unsigned id_; |
| HashMap line_ticks_; |
| - List<DeoptInfo> deopt_infos_; |
| + std::vector<DeoptInfo*> deopt_infos_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ProfileNode); |
| }; |