V8 Project
v8::internal::BasicBlockProfiler::Data Class Reference

#include <basic-block-profiler.h>

+ Collaboration diagram for v8::internal::BasicBlockProfiler::Data:

Public Member Functions

size_t n_blocks () const
 
const uint32_tcounts () const
 
void SetCode (OStringStream *os)
 
void SetFunctionName (OStringStream *os)
 
void SetSchedule (OStringStream *os)
 
void SetBlockId (size_t offset, int block_id)
 
uint32_tGetCounterAddress (size_t offset)
 

Private Member Functions

 Data (size_t n_blocks)
 
 ~Data ()
 
void ResetCounts ()
 
 DISALLOW_COPY_AND_ASSIGN (Data)
 

Private Attributes

const size_t n_blocks_
 
std::vector< intblock_ids_
 
std::vector< uint32_tcounts_
 
std::string function_name_
 
std::string schedule_
 
std::string code_
 

Friends

class BasicBlockProfiler
 
OStreamoperator<< (OStream &os, const BasicBlockProfiler::Data &s)
 

Detailed Description

Definition at line 20 of file basic-block-profiler.h.

Constructor & Destructor Documentation

◆ Data()

v8::internal::BasicBlockProfiler::Data::Data ( size_t  n_blocks)
explicitprivate

◆ ~Data()

v8::internal::BasicBlockProfiler::Data::~Data ( )
private

Definition at line 14 of file basic-block-profiler.cc.

14 {}

Member Function Documentation

◆ counts()

const uint32_t* v8::internal::BasicBlockProfiler::Data::counts ( ) const
inline

Definition at line 23 of file basic-block-profiler.h.

23 { return &counts_[0]; }

References counts_.

◆ DISALLOW_COPY_AND_ASSIGN()

v8::internal::BasicBlockProfiler::Data::DISALLOW_COPY_AND_ASSIGN ( Data  )
private

◆ GetCounterAddress()

uint32_t * v8::internal::BasicBlockProfiler::Data::GetCounterAddress ( size_t  offset)

Definition at line 43 of file basic-block-profiler.cc.

43  {
44  DCHECK(offset < n_blocks_);
45  return &counts_[offset];
46 }
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK.

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

+ Here is the caller graph for this function:

◆ n_blocks()

size_t v8::internal::BasicBlockProfiler::Data::n_blocks ( ) const
inline

Definition at line 22 of file basic-block-profiler.h.

22 { return n_blocks_; }

References n_blocks_.

◆ ResetCounts()

void v8::internal::BasicBlockProfiler::Data::ResetCounts ( )
private

Definition at line 49 of file basic-block-profiler.cc.

49  {
50  for (size_t i = 0; i < n_blocks_; ++i) {
51  counts_[i] = 0;
52  }
53 }

◆ SetBlockId()

void v8::internal::BasicBlockProfiler::Data::SetBlockId ( size_t  offset,
int  block_id 
)

Definition at line 37 of file basic-block-profiler.cc.

37  {
38  DCHECK(offset < n_blocks_);
39  block_ids_[offset] = block_id;
40 }

References DCHECK.

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

+ Here is the caller graph for this function:

◆ SetCode()

void v8::internal::BasicBlockProfiler::Data::SetCode ( OStringStream os)

Definition at line 22 of file basic-block-profiler.cc.

22  {
23  InsertIntoString(os, &code_);
24 }
static void InsertIntoString(OStringStream *os, std::string *string)

References v8::internal::InsertIntoString().

Referenced by v8::internal::compiler::Pipeline::GenerateCode().

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

◆ SetFunctionName()

void v8::internal::BasicBlockProfiler::Data::SetFunctionName ( OStringStream os)

Definition at line 27 of file basic-block-profiler.cc.

References v8::internal::InsertIntoString().

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

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

◆ SetSchedule()

void v8::internal::BasicBlockProfiler::Data::SetSchedule ( OStringStream os)

Definition at line 32 of file basic-block-profiler.cc.

References v8::internal::InsertIntoString().

Referenced by v8::internal::compiler::BasicBlockInstrumentor::Instrument().

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

Friends And Related Function Documentation

◆ BasicBlockProfiler

friend class BasicBlockProfiler
friend

Definition at line 32 of file basic-block-profiler.h.

◆ operator<<

OStream& operator<< ( OStream os,
const BasicBlockProfiler::Data s 
)
friend

Definition at line 91 of file basic-block-profiler.cc.

91  {
92  const char* name = "unknown function";
93  if (!d.function_name_.empty()) {
94  name = d.function_name_.c_str();
95  }
96  if (!d.schedule_.empty()) {
97  os << "schedule for " << name << endl;
98  os << d.schedule_.c_str() << endl;
99  }
100  os << "block counts for " << name << ":" << endl;
101  for (size_t i = 0; i < d.n_blocks_; ++i) {
102  os << "block " << d.block_ids_[i] << " : " << d.counts_[i] << endl;
103  }
104  os << endl;
105  if (!d.code_.empty()) {
106  os << d.code_.c_str() << endl;
107  }
108  return os;
109 }
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
OStream & endl(OStream &os)
Definition: ostreams.cc:112

Member Data Documentation

◆ block_ids_

std::vector<int> v8::internal::BasicBlockProfiler::Data::block_ids_
private

Definition at line 41 of file basic-block-profiler.h.

◆ code_

std::string v8::internal::BasicBlockProfiler::Data::code_
private

Definition at line 45 of file basic-block-profiler.h.

◆ counts_

std::vector<uint32_t> v8::internal::BasicBlockProfiler::Data::counts_
private

Definition at line 42 of file basic-block-profiler.h.

Referenced by counts().

◆ function_name_

std::string v8::internal::BasicBlockProfiler::Data::function_name_
private

Definition at line 43 of file basic-block-profiler.h.

◆ n_blocks_

const size_t v8::internal::BasicBlockProfiler::Data::n_blocks_
private

Definition at line 40 of file basic-block-profiler.h.

Referenced by n_blocks().

◆ schedule_

std::string v8::internal::BasicBlockProfiler::Data::schedule_
private

Definition at line 44 of file basic-block-profiler.h.


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