V8 Project
v8::internal::AddressToTraceMap Class Reference

#include <allocation-tracker.h>

+ Collaboration diagram for v8::internal::AddressToTraceMap:

Classes

struct  RangeStack
 

Public Member Functions

void AddRange (Address addr, int size, unsigned node_id)
 
unsigned GetTraceNodeId (Address addr)
 
void MoveObject (Address from, Address to, int size)
 
void Clear ()
 
size_t size ()
 
void Print ()
 

Private Types

typedef std::map< Address, RangeStackRangeMap
 

Private Member Functions

void RemoveRange (Address start, Address end)
 

Private Attributes

RangeMap ranges_
 

Detailed Description

Definition at line 63 of file allocation-tracker.h.

Member Typedef Documentation

◆ RangeMap

Member Function Documentation

◆ AddRange()

void v8::internal::AddressToTraceMap::AddRange ( Address  addr,
int  size,
unsigned  node_id 
)

Definition at line 118 of file allocation-tracker.cc.

119  {
120  Address end = start + size;
121  RemoveRange(start, end);
122 
123  RangeStack new_range(start, trace_node_id);
124  ranges_.insert(RangeMap::value_type(end, new_range));
125 }
void RemoveRange(Address start, Address end)
byte * Address
Definition: globals.h:101

References size.

Referenced by v8::internal::AllocationTracker::AllocationEvent().

+ Here is the caller graph for this function:

◆ Clear()

void v8::internal::AddressToTraceMap::Clear ( )

Definition at line 146 of file allocation-tracker.cc.

146  {
147  ranges_.clear();
148 }

◆ GetTraceNodeId()

unsigned v8::internal::AddressToTraceMap::GetTraceNodeId ( Address  addr)

Definition at line 128 of file allocation-tracker.cc.

128  {
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;
133  }
134  return 0;
135 }

◆ MoveObject()

void v8::internal::AddressToTraceMap::MoveObject ( Address  from,
Address  to,
int  size 
)

Definition at line 138 of file allocation-tracker.cc.

138  {
139  unsigned trace_node_id = GetTraceNodeId(from);
140  if (trace_node_id == 0) return;
141  RemoveRange(from, from + size);
142  AddRange(to, size, trace_node_id);
143 }
void AddRange(Address addr, int size, unsigned node_id)
unsigned GetTraceNodeId(Address addr)
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

References v8::internal::AddRange(), size, and to().

+ Here is the call graph for this function:

◆ Print()

void v8::internal::AddressToTraceMap::Print ( )

Definition at line 151 of file allocation-tracker.cc.

151  {
152  PrintF("[AddressToTraceMap (%" V8PRIuPTR "): \n", ranges_.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);
156  }
157  PrintF("]\n");
158 }
#define V8PRIuPTR
Definition: macros.h:365
void PrintF(const char *format,...)
Definition: utils.cc:80

References v8::internal::PrintF(), and V8PRIuPTR.

+ Here is the call graph for this function:

◆ RemoveRange()

void v8::internal::AddressToTraceMap::RemoveRange ( Address  start,
Address  end 
)
private

Definition at line 161 of file allocation-tracker.cc.

161  {
162  RangeMap::iterator it = ranges_.upper_bound(start);
163  if (it == ranges_.end()) return;
164 
165  RangeStack prev_range(0, 0);
166 
167  RangeMap::iterator to_remove_begin = it;
168  if (it->second.start < start) {
169  prev_range = it->second;
170  }
171  do {
172  if (it->first > end) {
173  if (it->second.start < end) {
174  it->second.start = end;
175  }
176  break;
177  }
178  ++it;
179  }
180  while (it != ranges_.end());
181 
182  ranges_.erase(to_remove_begin, it);
183 
184  if (prev_range.start != 0) {
185  ranges_.insert(RangeMap::value_type(start, prev_range));
186  }
187 }

References v8::internal::AddressToTraceMap::RangeStack::start.

◆ size()

size_t v8::internal::AddressToTraceMap::size ( )
inline

Definition at line 69 of file allocation-tracker.h.

69 { return ranges_.size(); }

References ranges_.

Member Data Documentation

◆ ranges_

RangeMap v8::internal::AddressToTraceMap::ranges_
private

Definition at line 84 of file allocation-tracker.h.

Referenced by size().


The documentation for this class was generated from the following files: