| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ALLOCATION_TRACKER_H_ | 5 #ifndef V8_PROFILER_ALLOCATION_TRACKER_H_ |
| 6 #define V8_PROFILER_ALLOCATION_TRACKER_H_ | 6 #define V8_PROFILER_ALLOCATION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "include/v8-profiler.h" | 10 #include "include/v8-profiler.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 static void DeleteFunctionInfo(FunctionInfo** info); | 122 static void DeleteFunctionInfo(FunctionInfo** info); |
| 123 unsigned functionInfoIndexForVMState(StateTag state); | 123 unsigned functionInfoIndexForVMState(StateTag state); |
| 124 | 124 |
| 125 class UnresolvedLocation { | 125 class UnresolvedLocation { |
| 126 public: | 126 public: |
| 127 UnresolvedLocation(Script* script, int start, FunctionInfo* info); | 127 UnresolvedLocation(Script* script, int start, FunctionInfo* info); |
| 128 ~UnresolvedLocation(); | 128 ~UnresolvedLocation(); |
| 129 void Resolve(); | 129 void Resolve(); |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 static void HandleWeakScript( | 132 static void HandleWeakScript(const v8::WeakCallbackInfo<void>& data); |
| 133 const v8::WeakCallbackData<v8::Value, void>& data); | |
| 134 | 133 |
| 135 Handle<Script> script_; | 134 Handle<Script> script_; |
| 136 int start_position_; | 135 int start_position_; |
| 137 FunctionInfo* info_; | 136 FunctionInfo* info_; |
| 138 }; | 137 }; |
| 139 static void DeleteUnresolvedLocation(UnresolvedLocation** location); | 138 static void DeleteUnresolvedLocation(UnresolvedLocation** location); |
| 140 | 139 |
| 141 static const int kMaxAllocationTraceLength = 64; | 140 static const int kMaxAllocationTraceLength = 64; |
| 142 HeapObjectsMap* ids_; | 141 HeapObjectsMap* ids_; |
| 143 StringsStorage* names_; | 142 StringsStorage* names_; |
| 144 AllocationTraceTree trace_tree_; | 143 AllocationTraceTree trace_tree_; |
| 145 unsigned allocation_trace_buffer_[kMaxAllocationTraceLength]; | 144 unsigned allocation_trace_buffer_[kMaxAllocationTraceLength]; |
| 146 List<FunctionInfo*> function_info_list_; | 145 List<FunctionInfo*> function_info_list_; |
| 147 HashMap id_to_function_info_index_; | 146 HashMap id_to_function_info_index_; |
| 148 List<UnresolvedLocation*> unresolved_locations_; | 147 List<UnresolvedLocation*> unresolved_locations_; |
| 149 unsigned info_index_for_other_state_; | 148 unsigned info_index_for_other_state_; |
| 150 AddressToTraceMap address_to_trace_; | 149 AddressToTraceMap address_to_trace_; |
| 151 | 150 |
| 152 DISALLOW_COPY_AND_ASSIGN(AllocationTracker); | 151 DISALLOW_COPY_AND_ASSIGN(AllocationTracker); |
| 153 }; | 152 }; |
| 154 | 153 |
| 155 } // namespace internal | 154 } // namespace internal |
| 156 } // namespace v8 | 155 } // namespace v8 |
| 157 | 156 |
| 158 #endif // V8_ALLOCATION_TRACKER_H_ | 157 #endif // V8_ALLOCATION_TRACKER_H_ |
| OLD | NEW |