17 function_info_index_(function_info_index),
20 id_(tree->next_node_id()) {
30 unsigned function_info_index) {
40 unsigned function_info_index) {
58 if (tracker !=
NULL) {
86 for (
unsigned* entry = path.
start() + path.
length() - 1;
87 entry != path.
start() - 1;
119 unsigned trace_node_id) {
121 RemoveRange(start, end);
124 ranges_.insert(RangeMap::value_type(end, new_range));
129 RangeMap::const_iterator it = ranges_.upper_bound(addr);
130 if (it == ranges_.end())
return 0;
131 if (it->second.start <= addr) {
132 return it->second.trace_node_id;
139 unsigned trace_node_id = GetTraceNodeId(from);
140 if (trace_node_id == 0)
return;
141 RemoveRange(from, from +
size);
153 for (RangeMap::iterator it = ranges_.begin(); it != ranges_.end(); ++it) {
154 PrintF(
"[%p - %p] => %u\n", it->second.start, it->first,
155 it->second.trace_node_id);
162 RangeMap::iterator it = ranges_.upper_bound(start);
163 if (it == ranges_.end())
return;
167 RangeMap::iterator to_remove_begin = it;
168 if (it->second.start < start) {
169 prev_range = it->second;
172 if (it->first > end) {
173 if (it->second.start < end) {
174 it->second.
start = end;
180 while (it != ranges_.end());
182 ranges_.erase(to_remove_begin, it);
184 if (prev_range.
start != 0) {
185 ranges_.insert(RangeMap::value_type(start, prev_range));
202 info->
name =
"(root)";
217 for (
int i = 0;
i < copy.length();
i++) {
269 if (entry->value ==
NULL) {
273 if (shared->script()->IsScript()) {
274 Script* script = Script::cast(shared->script());
275 if (script->name()->IsName()) {
276 Name*
name = Name::cast(script->name());
290 return static_cast<unsigned>(
reinterpret_cast<intptr_t
>((entry->value)));
295 if (state !=
OTHER)
return 0;
298 info->
name =
"(V8 API)";
308 : start_position_(start),
319 if (!script_.is_null()) {
326 if (script_.is_null())
return;
static void Print(const char *format,...)
void MoveObject(Address from, Address to, int size)
void AddRange(Address addr, int size, unsigned node_id)
void RemoveRange(Address start, Address end)
unsigned GetTraceNodeId(Address addr)
AllocationTraceTree * tree_
unsigned function_info_index_
AllocationTraceNode * FindOrAddChild(unsigned function_info_index)
void AddAllocation(unsigned size)
unsigned allocation_count_
AllocationTraceNode(AllocationTraceTree *tree, unsigned function_info_index)
void Print(int indent, AllocationTracker *tracker)
unsigned function_info_index() const
List< AllocationTraceNode * > children_
AllocationTraceNode * FindChild(unsigned function_info_index)
void Print(AllocationTracker *tracker)
AllocationTraceNode * AddPathFromEnd(const Vector< unsigned > &path)
AllocationTraceNode * root()
static void HandleWeakScript(const v8::WeakCallbackData< v8::Value, void > &data)
UnresolvedLocation(Script *script, int start, FunctionInfo *info)
void PrepareForSerialization()
unsigned info_index_for_other_state_
unsigned AddFunctionInfo(SharedFunctionInfo *info, SnapshotObjectId id)
AddressToTraceMap address_to_trace_
unsigned functionInfoIndexForVMState(StateTag state)
HashMap id_to_function_info_index_
unsigned allocation_trace_buffer_[kMaxAllocationTraceLength]
const List< FunctionInfo * > & function_info_list() const
AllocationTraceTree trace_tree_
List< UnresolvedLocation * > unresolved_locations_
static void DeleteFunctionInfo(FunctionInfo **info)
static const int kMaxAllocationTraceLength
List< FunctionInfo * > function_info_list_
AllocationTracker(HeapObjectsMap *ids, StringsStorage *names)
static void DeleteUnresolvedLocation(UnresolvedLocation **location)
void AllocationEvent(Address addr, int size)
static FreeListNode * FromAddress(Address address)
static bool IsFreeListNode(HeapObject *object)
void set_size(Heap *heap, int size_in_bytes)
static void MakeWeak(Object **location, void *parameter, WeakCallback weak_callback)
static void Destroy(Object **location)
Handle< Object > Create(Object *value)
static Handle< T > cast(Handle< S > that)
static Handle< T > null()
Isolate * GetIsolate() const
static HeapObject * FromAddress(Address address)
SnapshotObjectId FindOrAddEntry(Address addr, unsigned int size, bool accessed=true)
GlobalHandles * global_handles()
JSFunction * function() const
void AddAll(const List< T, AllocationPolicy > &other, AllocationPolicy allocator=AllocationPolicy())
static int GetColumnNumber(Handle< Script > script, int code_pos)
static int GetLineNumber(Handle< Script > script, int code_pos)
int start_position() const
const char * GetFunctionName(Name *name)
const char * GetName(Name *name)
Entry * Lookup(void *key, uint32_t hash, bool insert, AllocationPolicy allocator=AllocationPolicy())
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
static const uint32_t kZeroHashSeed
void PrintF(const char *format,...)
uint32_t ComputeIntegerHash(uint32_t key, uint32_t seed)
static uint32_t SnapshotObjectIdHash(SnapshotObjectId id)
ContainedInLattice AddRange(ContainedInLattice containment, const int *ranges, int ranges_length, Interval new_range)
Debugger support for the V8 JavaScript engine.
uint32_t SnapshotObjectId
SnapshotObjectId function_id