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

Unified Diff: src/profile-generator.h

Issue 1013143003: CpuProfiler: push the collected information about deopts to cpu profiler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: another try Created 5 years, 9 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
Index: src/profile-generator.h
diff --git a/src/profile-generator.h b/src/profile-generator.h
index 4f44c4c8abc9ba55ec1411234662307c73734fa0..6db434541aeddca065a378ecad324068bd581dc2 100644
--- a/src/profile-generator.h
+++ b/src/profile-generator.h
@@ -36,6 +36,21 @@ class JITLineInfoTable : public Malloced {
DISALLOW_COPY_AND_ASSIGN(JITLineInfoTable);
};
+
+struct DeoptInfo {
alph 2015/03/18 18:15:19 turn it into a class?
loislo 2015/03/19 08:16:12 done
+ const char* deopt_reason;
+ struct Frame {
+ int script_id;
+ int position;
+ };
+ std::vector<Frame> stack;
+ void AddInlineFrame(int script_id, int position) {
+ Frame frame = {script_id, position};
+ stack.push_back(frame);
+ }
+};
+
+
class CodeEntry {
public:
// CodeEntry doesn't own name strings, just references them.
@@ -72,6 +87,7 @@ class CodeEntry {
deopt_position_ = position;
pc_offset_ = pc_offset;
}
+ DeoptInfo GetDeoptInfo();
alph 2015/03/18 18:15:19 seems to be quite a big object to return by value
loislo 2015/03/19 08:16:12 done
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 +104,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 +152,8 @@ class CodeEntry {
JITLineInfoTable* line_info_;
Address instruction_start_;
+ std::vector<InlinedFunctionInfo>* inlined_function_infos_;
+
DISALLOW_COPY_AND_ASSIGN(CodeEntry);
};
@@ -134,17 +161,6 @@ 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);
@@ -163,7 +179,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 +202,8 @@ class ProfileNode {
unsigned id_;
HashMap line_ticks_;
- List<DeoptInfo> deopt_infos_;
+ std::vector<DeoptInfo> deopt_infos_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileNode);
};
« no previous file with comments | « src/cpu-profiler.cc ('k') | src/profile-generator.cc » ('j') | src/profile-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698