V8 Project
v8::internal::CodeEventLogger::NameBuffer Class Reference
+ Collaboration diagram for v8::internal::CodeEventLogger::NameBuffer:

Public Member Functions

 NameBuffer ()
 
void Reset ()
 
void Init (Logger::LogEventsAndTags tag)
 
void AppendName (Name *name)
 
void AppendString (String *str)
 
void AppendBytes (const char *bytes, int size)
 
void AppendBytes (const char *bytes)
 
void AppendByte (char c)
 
void AppendInt (int n)
 
void AppendHex (uint32_t n)
 
const char * get ()
 
int size () const
 

Private Attributes

int utf8_pos_
 
char utf8_buffer_ [kUtf8BufferSize]
 
uc16 utf16_buffer [kUtf16BufferSize]
 

Static Private Attributes

static const int kUtf8BufferSize = 512
 
static const int kUtf16BufferSize = 128
 

Detailed Description

Definition at line 59 of file log.cc.

Constructor & Destructor Documentation

◆ NameBuffer()

v8::internal::CodeEventLogger::NameBuffer::NameBuffer ( )
inline

Definition at line 61 of file log.cc.

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ AppendByte()

void v8::internal::CodeEventLogger::NameBuffer::AppendByte ( char  c)
inline

Definition at line 119 of file log.cc.

119  {
120  if (utf8_pos_ >= kUtf8BufferSize) return;
121  utf8_buffer_[utf8_pos_++] = c;
122  }
char utf8_buffer_[kUtf8BufferSize]
Definition: log.cc:150

References kUtf8BufferSize, utf8_buffer_, and utf8_pos_.

Referenced by AppendName(), v8::internal::CodeEventLogger::CodeCreateEvent(), and Init().

+ Here is the caller graph for this function:

◆ AppendBytes() [1/2]

void v8::internal::CodeEventLogger::NameBuffer::AppendBytes ( const char *  bytes)
inline

Definition at line 115 of file log.cc.

115  {
116  AppendBytes(bytes, StrLength(bytes));
117  }
void AppendBytes(const char *bytes, int size)
Definition: log.cc:109
int StrLength(const char *string)
Definition: vector.h:147

References AppendBytes(), and v8::internal::StrLength().

+ Here is the call graph for this function:

◆ AppendBytes() [2/2]

void v8::internal::CodeEventLogger::NameBuffer::AppendBytes ( const char *  bytes,
int  size 
)
inline

Definition at line 109 of file log.cc.

109  {
111  MemCopy(utf8_buffer_ + utf8_pos_, bytes, size);
112  utf8_pos_ += size;
113  }
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
void MemCopy(void *dest, const void *src, size_t size)
Definition: utils.h:350

References kUtf8BufferSize, v8::internal::MemCopy(), v8::internal::Min(), size(), utf8_buffer_, and utf8_pos_.

Referenced by AppendBytes(), AppendName(), v8::internal::CodeEventLogger::CodeCreateEvent(), and Init().

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

◆ AppendHex()

void v8::internal::CodeEventLogger::NameBuffer::AppendHex ( uint32_t  n)
inline

Definition at line 133 of file log.cc.

133  {
134  Vector<char> buffer(utf8_buffer_ + utf8_pos_,
136  int size = SNPrintF(buffer, "%x", n);
137  if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
138  utf8_pos_ += size;
139  }
140  }
int SNPrintF(Vector< char > str, const char *format,...)
Definition: utils.cc:105

References kUtf8BufferSize, size(), v8::internal::SNPrintF(), utf8_buffer_, and utf8_pos_.

Referenced by AppendName(), and v8::internal::CodeEventLogger::CodeCreateEvent().

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

◆ AppendInt()

void v8::internal::CodeEventLogger::NameBuffer::AppendInt ( int  n)
inline

Definition at line 124 of file log.cc.

124  {
125  Vector<char> buffer(utf8_buffer_ + utf8_pos_,
127  int size = SNPrintF(buffer, "%d", n);
128  if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
129  utf8_pos_ += size;
130  }
131  }

References kUtf8BufferSize, size(), v8::internal::SNPrintF(), utf8_buffer_, and utf8_pos_.

Referenced by v8::internal::CodeEventLogger::CodeCreateEvent().

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

◆ AppendName()

void v8::internal::CodeEventLogger::NameBuffer::AppendName ( Name name)
inline

Definition at line 73 of file log.cc.

73  {
74  if (name->IsString()) {
75  AppendString(String::cast(name));
76  } else {
77  Symbol* symbol = Symbol::cast(name);
78  AppendBytes("symbol(");
79  if (!symbol->name()->IsUndefined()) {
80  AppendBytes("\"");
81  AppendString(String::cast(symbol->name()));
82  AppendBytes("\" ");
83  }
84  AppendBytes("hash ");
85  AppendHex(symbol->Hash());
86  AppendByte(')');
87  }
88  }
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
IN DWORD64 OUT PDWORD64 OUT PIMAGEHLP_SYMBOL64 Symbol

References AppendByte(), AppendBytes(), AppendHex(), AppendString(), v8::internal::Name::Hash(), and name.

Referenced by v8::internal::CodeEventLogger::CodeCreateEvent().

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

◆ AppendString()

void v8::internal::CodeEventLogger::NameBuffer::AppendString ( String str)
inline

Definition at line 90 of file log.cc.

90  {
91  if (str == NULL) return;
92  int uc16_length = Min(str->length(), kUtf16BufferSize);
93  String::WriteToFlat(str, utf16_buffer, 0, uc16_length);
95  for (int i = 0; i < uc16_length && utf8_pos_ < kUtf8BufferSize; ++i) {
96  uc16 c = utf16_buffer[i];
98  utf8_buffer_[utf8_pos_++] = static_cast<char>(c);
99  } else {
100  int char_length = unibrow::Utf8::Length(c, previous);
101  if (utf8_pos_ + char_length > kUtf8BufferSize) break;
103  utf8_pos_ += char_length;
104  }
105  previous = c;
106  }
107  }
static const int kNoPreviousCharacter
Definition: unicode.h:97
static const unsigned kMaxOneByteChar
Definition: unicode.h:141
static uchar Length(uchar chr, int previous)
Definition: unicode-inl.h:140
static unsigned Encode(char *out, uchar c, int previous, bool replace_invalid=false)
Definition: unicode-inl.h:91
uc16 utf16_buffer[kUtf16BufferSize]
Definition: log.cc:151
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
Definition: objects.cc:8370
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
uint16_t uc16
Definition: globals.h:184

References unibrow::Utf8::Encode(), unibrow::Utf8::kMaxOneByteChar, unibrow::Utf16::kNoPreviousCharacter, kUtf16BufferSize, kUtf8BufferSize, v8::internal::String::length(), unibrow::Utf8::Length(), v8::internal::Min(), NULL, utf16_buffer, utf8_buffer_, utf8_pos_, and v8::internal::String::WriteToFlat().

Referenced by AppendName(), v8::internal::CodeEventLogger::CodeCreateEvent(), and v8::internal::CodeEventLogger::RegExpCodeCreateEvent().

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

◆ get()

const char* v8::internal::CodeEventLogger::NameBuffer::get ( )
inline

Definition at line 142 of file log.cc.

142 { return utf8_buffer_; }

References utf8_buffer_.

Referenced by v8::internal::CodeEventLogger::CodeCreateEvent(), and v8::internal::CodeEventLogger::RegExpCodeCreateEvent().

+ Here is the caller graph for this function:

◆ Init()

void v8::internal::CodeEventLogger::NameBuffer::Init ( Logger::LogEventsAndTags  tag)
inline

Definition at line 67 of file log.cc.

67  {
68  Reset();
70  AppendByte(':');
71  }
static const char *const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS]
Definition: log.cc:30

References AppendByte(), AppendBytes(), v8::internal::kLogEventsNames, and Reset().

Referenced by v8::internal::CodeEventLogger::CodeCreateEvent(), and v8::internal::CodeEventLogger::RegExpCodeCreateEvent().

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

◆ Reset()

void v8::internal::CodeEventLogger::NameBuffer::Reset ( )
inline

Definition at line 63 of file log.cc.

63  {
64  utf8_pos_ = 0;
65  }

References utf8_pos_.

Referenced by Init(), and NameBuffer().

+ Here is the caller graph for this function:

◆ size()

int v8::internal::CodeEventLogger::NameBuffer::size ( ) const
inline

Definition at line 143 of file log.cc.

143 { return utf8_pos_; }

References utf8_pos_.

Referenced by AppendBytes(), AppendHex(), AppendInt(), v8::internal::CodeEventLogger::CodeCreateEvent(), and v8::internal::CodeEventLogger::RegExpCodeCreateEvent().

+ Here is the caller graph for this function:

Member Data Documentation

◆ kUtf16BufferSize

const int v8::internal::CodeEventLogger::NameBuffer::kUtf16BufferSize = 128
staticprivate

Definition at line 147 of file log.cc.

Referenced by AppendString().

◆ kUtf8BufferSize

const int v8::internal::CodeEventLogger::NameBuffer::kUtf8BufferSize = 512
staticprivate

Definition at line 146 of file log.cc.

Referenced by AppendByte(), AppendBytes(), AppendHex(), AppendInt(), and AppendString().

◆ utf16_buffer

uc16 v8::internal::CodeEventLogger::NameBuffer::utf16_buffer[kUtf16BufferSize]
private

Definition at line 151 of file log.cc.

Referenced by AppendString().

◆ utf8_buffer_

char v8::internal::CodeEventLogger::NameBuffer::utf8_buffer_[kUtf8BufferSize]
private

Definition at line 150 of file log.cc.

Referenced by AppendByte(), AppendBytes(), AppendHex(), AppendInt(), AppendString(), and get().

◆ utf8_pos_

int v8::internal::CodeEventLogger::NameBuffer::utf8_pos_
private

Definition at line 149 of file log.cc.

Referenced by AppendByte(), AppendBytes(), AppendHex(), AppendInt(), AppendString(), Reset(), and size().


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