5#ifndef V8_PROFILER_ALLOCATION_TRACKER_H_
6#define V8_PROFILER_ALLOCATION_TRACKER_H_
9#include <unordered_map>
26class AllocationTraceTree;
27class AllocationTracker;
29class SharedFunctionInfo;
46 unsigned id()
const {
return id_; }
47 const std::vector<AllocationTraceNode*>&
children()
const {
81 void AddRange(Address addr,
int size,
unsigned node_id);
82 unsigned GetTraceNodeId(Address addr);
83 void MoveObject(Address from, Address to,
int size);
85 size_t size() {
return ranges_.size(); }
96 using RangeMap = std::map<Address, RangeStack>;
98 void RemoveRange(Address
start, Address
end);
std::map< Address, RangeStack > RangeMap
std::vector< AllocationTraceNode * > children_
AllocationTraceTree * tree_
unsigned function_info_index_
const std::vector< AllocationTraceNode * > & children() const
AllocationTraceNode * FindOrAddChild(unsigned function_info_index)
unsigned allocation_size() const
unsigned allocation_count() const
void AddAllocation(unsigned size)
unsigned allocation_count_
AllocationTraceNode & operator=(const AllocationTraceNode &)=delete
AllocationTraceNode(AllocationTraceTree *tree, unsigned function_info_index)
void Print(int indent, AllocationTracker *tracker)
unsigned function_info_index() const
AllocationTraceNode * FindChild(unsigned function_info_index)
AllocationTraceNode(const AllocationTraceNode &)=delete
AllocationTraceNode * AddPathFromEnd(base::Vector< const unsigned > path)
V8_EXPORT_PRIVATE void Print(AllocationTracker *tracker)
AllocationTraceNode root_
~AllocationTraceTree()=default
AllocationTraceNode * root()
AllocationTraceTree & operator=(const AllocationTraceTree &)=delete
AllocationTraceTree(const AllocationTraceTree &)=delete
AllocationTracker * tracker_
String::LineEndsVector & line_ends()
static void HandleWeakScript(const v8::WeakCallbackInfo< ScriptData > &)
ScriptData(Tagged< Script >, Isolate *, AllocationTracker *)
String::LineEndsVector line_ends_
Global< debug::Script > script_
base::HashMap id_to_function_info_index_
unsigned info_index_for_other_state_
AllocationTraceTree * trace_tree()
AddressToTraceMap address_to_trace_
unsigned functionInfoIndexForVMState(StateTag state)
std::unordered_map< ScriptId, ScriptData > ScriptsDataMap
unsigned allocation_trace_buffer_[kMaxAllocationTraceLength]
AllocationTraceTree trace_tree_
unsigned AddFunctionInfo(Tagged< SharedFunctionInfo > info, SnapshotObjectId id, Isolate *isolate)
std::vector< FunctionInfo * > function_info_list_
Script::PositionInfo GetScriptPositionInfo(Tagged< Script > script, Isolate *isolate, int start)
AddressToTraceMap * address_to_trace()
AllocationTracker & operator=(const AllocationTracker &)=delete
static const int kMaxAllocationTraceLength
ScriptsDataMap scripts_data_map_
String::LineEndsVector & GetOrCreateLineEnds(Tagged< Script > script, Isolate *isolate)
AllocationTracker(HeapObjectsMap *ids, StringsStorage *names)
AllocationTracker(const AllocationTracker &)=delete
void AllocationEvent(Address addr, int size)
const std::vector< FunctionInfo * > & function_info_list() const
uint32_t SnapshotObjectId
#define V8_EXPORT_PRIVATE
RangeStack(Address start, unsigned node_id)
SnapshotObjectId function_id