V8 Project
v8::internal::CodeMap Class Reference

#include <profile-generator.h>

+ Collaboration diagram for v8::internal::CodeMap:

Classes

struct  CodeEntryInfo
 
struct  CodeTreeConfig
 
class  CodeTreePrinter
 

Public Member Functions

 CodeMap ()
 
void AddCode (Address addr, CodeEntry *entry, unsigned size)
 
void MoveCode (Address from, Address to)
 
CodeEntryFindEntry (Address addr, Address *start=NULL)
 
int GetSharedId (Address addr)
 
void Print ()
 

Private Types

typedef SplayTree< CodeTreeConfigCodeTree
 

Private Member Functions

void DeleteAllCoveredCode (Address start, Address end)
 
 DISALLOW_COPY_AND_ASSIGN (CodeMap)
 

Private Attributes

CodeTree tree_
 
int next_shared_id_
 

Static Private Attributes

static CodeEntry *const kSharedFunctionCodeEntry = NULL
 

Detailed Description

Definition at line 210 of file profile-generator.h.

Member Typedef Documentation

◆ CodeTree

Definition at line 237 of file profile-generator.h.

Constructor & Destructor Documentation

◆ CodeMap()

v8::internal::CodeMap::CodeMap ( )
inline

Definition at line 212 of file profile-generator.h.

Member Function Documentation

◆ AddCode()

void v8::internal::CodeMap::AddCode ( Address  addr,
CodeEntry entry,
unsigned  size 
)

Definition at line 354 of file profile-generator.cc.

354  {
355  DeleteAllCoveredCode(addr, addr + size);
356  CodeTree::Locator locator;
357  tree_.Insert(addr, &locator);
358  locator.set_value(CodeEntryInfo(entry, size));
359 }
void DeleteAllCoveredCode(Address start, Address end)
bool Insert(const Key &key, Locator *locator)
enable harmony numeric enable harmony object literal extensions Optimize object size

References DeleteAllCoveredCode(), v8::internal::SplayTree< Config, AllocationPolicy >::Insert(), size, and tree_.

Referenced by MoveCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteAllCoveredCode()

void v8::internal::CodeMap::DeleteAllCoveredCode ( Address  start,
Address  end 
)
private

Definition at line 362 of file profile-generator.cc.

362  {
363  List<Address> to_delete;
364  Address addr = end - 1;
365  while (addr >= start) {
366  CodeTree::Locator locator;
367  if (!tree_.FindGreatestLessThan(addr, &locator)) break;
368  Address start2 = locator.key(), end2 = start2 + locator.value().size;
369  if (start2 < end && start < end2) to_delete.Add(start2);
370  addr = start2 - 1;
371  }
372  for (int i = 0; i < to_delete.length(); ++i) tree_.Remove(to_delete[i]);
373 }
bool FindGreatestLessThan(const Key &key, Locator *locator)
bool Remove(const Key &key)
byte * Address
Definition: globals.h:101

References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::SplayTree< Config, AllocationPolicy >::FindGreatestLessThan(), v8::internal::SplayTree< Config, AllocationPolicy >::Remove(), and tree_.

Referenced by AddCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::CodeMap::DISALLOW_COPY_AND_ASSIGN ( CodeMap  )
private

◆ FindEntry()

CodeEntry * v8::internal::CodeMap::FindEntry ( Address  addr,
Address start = NULL 
)

Definition at line 376 of file profile-generator.cc.

376  {
377  CodeTree::Locator locator;
378  if (tree_.FindGreatestLessThan(addr, &locator)) {
379  // locator.key() <= addr. Need to check that addr is within entry.
380  const CodeEntryInfo& entry = locator.value();
381  if (addr < (locator.key() + entry.size)) {
382  if (start) {
383  *start = locator.key();
384  }
385  return entry.entry;
386  }
387  }
388  return NULL;
389 }
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

References v8::internal::CodeMap::CodeEntryInfo::entry, v8::internal::SplayTree< Config, AllocationPolicy >::FindGreatestLessThan(), NULL, v8::internal::CodeMap::CodeEntryInfo::size, and tree_.

Referenced by v8::internal::ProfileGenerator::RecordTickSample().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSharedId()

int v8::internal::CodeMap::GetSharedId ( Address  addr)

Definition at line 392 of file profile-generator.cc.

392  {
393  CodeTree::Locator locator;
394  // For shared function entries, 'size' field is used to store their IDs.
395  if (tree_.Find(addr, &locator)) {
396  const CodeEntryInfo& entry = locator.value();
397  DCHECK(entry.entry == kSharedFunctionCodeEntry);
398  return entry.size;
399  } else {
400  tree_.Insert(addr, &locator);
401  int id = next_shared_id_++;
402  locator.set_value(CodeEntryInfo(kSharedFunctionCodeEntry, id));
403  return id;
404  }
405 }
static CodeEntry *const kSharedFunctionCodeEntry
bool Find(const Key &key, Locator *locator)
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, v8::internal::CodeMap::CodeEntryInfo::entry, v8::internal::SplayTree< Config, AllocationPolicy >::Find(), v8::internal::SplayTree< Config, AllocationPolicy >::Insert(), kSharedFunctionCodeEntry, next_shared_id_, v8::internal::CodeMap::CodeEntryInfo::size, and tree_.

+ Here is the call graph for this function:

◆ MoveCode()

void v8::internal::CodeMap::MoveCode ( Address  from,
Address  to 
)

Definition at line 408 of file profile-generator.cc.

408  {
409  if (from == to) return;
410  CodeTree::Locator locator;
411  if (!tree_.Find(from, &locator)) return;
412  CodeEntryInfo entry = locator.value();
413  tree_.Remove(from);
414  AddCode(to, entry.entry, entry.size);
415 }
void AddCode(Address addr, CodeEntry *entry, unsigned 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 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 AddCode(), v8::internal::CodeMap::CodeEntryInfo::entry, v8::internal::SplayTree< Config, AllocationPolicy >::Find(), v8::internal::SplayTree< Config, AllocationPolicy >::Remove(), v8::internal::CodeMap::CodeEntryInfo::size, to(), and tree_.

+ Here is the call graph for this function:

◆ Print()

void v8::internal::CodeMap::Print ( )

Definition at line 429 of file profile-generator.cc.

429  {
430  CodeTreePrinter printer;
431  tree_.ForEach(&printer);
432 }
void ForEach(Callback *callback)

References v8::internal::SplayTree< Config, AllocationPolicy >::ForEach(), and tree_.

+ Here is the call graph for this function:

Member Data Documentation

◆ kSharedFunctionCodeEntry

CodeEntry *const v8::internal::CodeMap::kSharedFunctionCodeEntry = NULL
staticprivate

◆ next_shared_id_

int v8::internal::CodeMap::next_shared_id_
private

Definition at line 250 of file profile-generator.h.

Referenced by GetSharedId().

◆ tree_

CodeTree v8::internal::CodeMap::tree_
private

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