OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PROFILER_PROFILE_GENERATOR_H_ | 5 #ifndef V8_PROFILER_PROFILE_GENERATOR_H_ |
6 #define V8_PROFILER_PROFILE_GENERATOR_H_ | 6 #define V8_PROFILER_PROFILE_GENERATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 void set_script_id(int script_id) { script_id_ = script_id; } | 66 void set_script_id(int script_id) { script_id_ = script_id; } |
67 int position() const { return position_; } | 67 int position() const { return position_; } |
68 void set_position(int position) { position_ = position; } | 68 void set_position(int position) { position_ = position; } |
69 void set_bailout_reason(const char* bailout_reason) { | 69 void set_bailout_reason(const char* bailout_reason) { |
70 bailout_reason_ = bailout_reason; | 70 bailout_reason_ = bailout_reason; |
71 } | 71 } |
72 const char* bailout_reason() const { return bailout_reason_; } | 72 const char* bailout_reason() const { return bailout_reason_; } |
73 | 73 |
74 void set_deopt_info(const char* deopt_reason, SourcePosition position, | 74 void set_deopt_info(const char* deopt_reason, SourcePosition position, |
75 int deopt_id) { | 75 int deopt_id) { |
76 DCHECK(deopt_position_.IsUnknown()); | 76 DCHECK(!has_deopt_info()); |
77 deopt_reason_ = deopt_reason; | 77 deopt_reason_ = deopt_reason; |
78 deopt_position_ = position; | 78 deopt_position_ = position; |
79 deopt_id_ = deopt_id; | 79 deopt_id_ = deopt_id; |
80 } | 80 } |
81 CpuProfileDeoptInfo GetDeoptInfo(); | 81 CpuProfileDeoptInfo GetDeoptInfo(); |
82 const char* deopt_reason() const { return deopt_reason_; } | 82 bool has_deopt_info() const { return deopt_id_ != kNoDeoptimizationId; } |
83 SourcePosition deopt_position() const { return deopt_position_; } | |
84 bool has_deopt_info() const { return !deopt_position_.IsUnknown(); } | |
85 void clear_deopt_info() { | 83 void clear_deopt_info() { |
86 deopt_reason_ = kNoDeoptReason; | 84 deopt_reason_ = kNoDeoptReason; |
87 deopt_position_ = SourcePosition::Unknown(); | 85 deopt_position_ = SourcePosition::Unknown(); |
| 86 deopt_id_ = kNoDeoptimizationId; |
88 } | 87 } |
89 | 88 |
90 void FillFunctionInfo(SharedFunctionInfo* shared); | 89 void FillFunctionInfo(SharedFunctionInfo* shared); |
91 | 90 |
92 void SetBuiltinId(Builtins::Name id); | 91 void SetBuiltinId(Builtins::Name id); |
93 Builtins::Name builtin_id() const { | 92 Builtins::Name builtin_id() const { |
94 return BuiltinIdField::decode(bit_field_); | 93 return BuiltinIdField::decode(bit_field_); |
95 } | 94 } |
96 | 95 |
97 uint32_t GetHash() const; | 96 uint32_t GetHash() const; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 CodeMap code_map_; | 378 CodeMap code_map_; |
380 | 379 |
381 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 380 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
382 }; | 381 }; |
383 | 382 |
384 | 383 |
385 } // namespace internal | 384 } // namespace internal |
386 } // namespace v8 | 385 } // namespace v8 |
387 | 386 |
388 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 387 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
OLD | NEW |