| 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 "include/v8-profiler.h" | 9 #include "include/v8-profiler.h" |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| 11 #include "src/compiler.h" | 11 #include "src/compiler.h" |
| 12 #include "src/hashmap.h" | 12 #include "src/hashmap.h" |
| 13 #include "src/strings-storage.h" | 13 #include "src/strings-storage.h" |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 | 17 |
| 18 struct OffsetRange; | |
| 19 | |
| 20 // Provides a mapping from the offsets within generated code to | 18 // Provides a mapping from the offsets within generated code to |
| 21 // the source line. | 19 // the source line. |
| 22 class JITLineInfoTable : public Malloced { | 20 class JITLineInfoTable : public Malloced { |
| 23 public: | 21 public: |
| 24 JITLineInfoTable(); | 22 JITLineInfoTable(); |
| 25 ~JITLineInfoTable(); | 23 ~JITLineInfoTable(); |
| 26 | 24 |
| 27 void SetPosition(int pc_offset, int line); | 25 void SetPosition(int pc_offset, int line); |
| 28 int GetSourceLineNumber(int pc_offset) const; | 26 int GetSourceLineNumber(int pc_offset) const; |
| 29 | 27 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 const char* deopt_reason() const { return deopt_reason_; } | 74 const char* deopt_reason() const { return deopt_reason_; } |
| 77 SourcePosition deopt_position() const { return deopt_position_; } | 75 SourcePosition deopt_position() const { return deopt_position_; } |
| 78 bool has_deopt_info() const { return !deopt_position_.IsUnknown(); } | 76 bool has_deopt_info() const { return !deopt_position_.IsUnknown(); } |
| 79 void clear_deopt_info() { | 77 void clear_deopt_info() { |
| 80 deopt_reason_ = kNoDeoptReason; | 78 deopt_reason_ = kNoDeoptReason; |
| 81 deopt_position_ = SourcePosition::Unknown(); | 79 deopt_position_ = SourcePosition::Unknown(); |
| 82 } | 80 } |
| 83 | 81 |
| 84 void FillFunctionInfo(SharedFunctionInfo* shared); | 82 void FillFunctionInfo(SharedFunctionInfo* shared); |
| 85 | 83 |
| 86 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } | |
| 87 void set_no_frame_ranges(List<OffsetRange>* ranges) { | |
| 88 no_frame_ranges_ = ranges; | |
| 89 } | |
| 90 void set_inlined_function_infos( | 84 void set_inlined_function_infos( |
| 91 const std::vector<InlinedFunctionInfo>& infos) { | 85 const std::vector<InlinedFunctionInfo>& infos) { |
| 92 inlined_function_infos_ = infos; | 86 inlined_function_infos_ = infos; |
| 93 } | 87 } |
| 94 const std::vector<InlinedFunctionInfo> inlined_function_infos() { | 88 const std::vector<InlinedFunctionInfo> inlined_function_infos() { |
| 95 return inlined_function_infos_; | 89 return inlined_function_infos_; |
| 96 } | 90 } |
| 97 | 91 |
| 98 void SetBuiltinId(Builtins::Name id); | 92 void SetBuiltinId(Builtins::Name id); |
| 99 Builtins::Name builtin_id() const { | 93 Builtins::Name builtin_id() const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 118 Logger::LogEventsAndTags tag() const { return TagField::decode(bit_field_); } | 112 Logger::LogEventsAndTags tag() const { return TagField::decode(bit_field_); } |
| 119 | 113 |
| 120 uint32_t bit_field_; | 114 uint32_t bit_field_; |
| 121 const char* name_prefix_; | 115 const char* name_prefix_; |
| 122 const char* name_; | 116 const char* name_; |
| 123 const char* resource_name_; | 117 const char* resource_name_; |
| 124 int line_number_; | 118 int line_number_; |
| 125 int column_number_; | 119 int column_number_; |
| 126 int script_id_; | 120 int script_id_; |
| 127 int position_; | 121 int position_; |
| 128 List<OffsetRange>* no_frame_ranges_; | |
| 129 const char* bailout_reason_; | 122 const char* bailout_reason_; |
| 130 const char* deopt_reason_; | 123 const char* deopt_reason_; |
| 131 SourcePosition deopt_position_; | 124 SourcePosition deopt_position_; |
| 132 size_t pc_offset_; | 125 size_t pc_offset_; |
| 133 JITLineInfoTable* line_info_; | 126 JITLineInfoTable* line_info_; |
| 134 Address instruction_start_; | 127 Address instruction_start_; |
| 135 | 128 |
| 136 std::vector<InlinedFunctionInfo> inlined_function_infos_; | 129 std::vector<InlinedFunctionInfo> inlined_function_infos_; |
| 137 | 130 |
| 138 DISALLOW_COPY_AND_ASSIGN(CodeEntry); | 131 DISALLOW_COPY_AND_ASSIGN(CodeEntry); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 CodeEntry* unresolved_entry_; | 373 CodeEntry* unresolved_entry_; |
| 381 | 374 |
| 382 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 375 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 383 }; | 376 }; |
| 384 | 377 |
| 385 | 378 |
| 386 } // namespace internal | 379 } // namespace internal |
| 387 } // namespace v8 | 380 } // namespace v8 |
| 388 | 381 |
| 389 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ | 382 #endif // V8_PROFILER_PROFILE_GENERATOR_H_ |
| OLD | NEW |