V8 Project
v8::internal::LowLevelLogger Class Reference
+ Inheritance diagram for v8::internal::LowLevelLogger:
+ Collaboration diagram for v8::internal::LowLevelLogger:

Classes

struct  CodeCreateStruct
 
struct  CodeDeleteStruct
 
struct  CodeMoveStruct
 
struct  SnapshotPositionStruct
 

Public Member Functions

 LowLevelLogger (const char *file_name)
 
virtual ~LowLevelLogger ()
 
virtual void CodeMoveEvent (Address from, Address to)
 
virtual void CodeDisableOptEvent (Code *code, SharedFunctionInfo *shared)
 
virtual void CodeDeleteEvent (Address from)
 
virtual void SnapshotPositionEvent (Address addr, int pos)
 
virtual void CodeMovingGCEvent ()
 
- Public Member Functions inherited from v8::internal::CodeEventLogger
 CodeEventLogger ()
 
virtual ~CodeEventLogger ()
 
virtual void CodeCreateEvent (Logger::LogEventsAndTags tag, Code *code, const char *comment)
 
virtual void CodeCreateEvent (Logger::LogEventsAndTags tag, Code *code, Name *name)
 
virtual void CodeCreateEvent (Logger::LogEventsAndTags tag, Code *code, int args_count)
 
virtual void CodeCreateEvent (Logger::LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *name)
 
virtual void CodeCreateEvent (Logger::LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *source, int line, int column)
 
virtual void RegExpCodeCreateEvent (Code *code, String *source)
 
virtual void CallbackEvent (Name *name, Address entry_point)
 
virtual void GetterCallbackEvent (Name *name, Address entry_point)
 
virtual void SetterCallbackEvent (Name *name, Address entry_point)
 
virtual void SharedFunctionInfoMoveEvent (Address from, Address to)
 
- Public Member Functions inherited from v8::internal::CodeEventListener
virtual ~CodeEventListener ()
 

Private Member Functions

virtual void LogRecordedBuffer (Code *code, SharedFunctionInfo *shared, const char *name, int length)
 
void LogCodeInfo ()
 
void LogWriteBytes (const char *bytes, int size)
 
template<typename T >
void LogWriteStruct (const T &s)
 

Private Attributes

FILE * ll_output_handle_
 

Static Private Attributes

static const char kCodeMovingGCTag = 'G'
 
static const char kLogExt [] = ".ll"
 
static const int kLogBufferSize = 2 * MB
 

Detailed Description

Definition at line 297 of file log.cc.

Constructor & Destructor Documentation

◆ LowLevelLogger()

v8::internal::LowLevelLogger::LowLevelLogger ( const char *  file_name)
explicit

Definition at line 372 of file log.cc.

374  // Open the low-level log file.
375  size_t len = strlen(name);
376  ScopedVector<char> ll_name(static_cast<int>(len + sizeof(kLogExt)));
377  MemCopy(ll_name.start(), name, len);
378  MemCopy(ll_name.start() + len, kLogExt, sizeof(kLogExt));
380  base::OS::FOpen(ll_name.start(), base::OS::LogFileOpenMode);
381  setvbuf(ll_output_handle_, NULL, _IOFBF, kLogBufferSize);
382 
383  LogCodeInfo();
384 }
static const char *const LogFileOpenMode
Definition: platform.h:187
static FILE * FOpen(const char *path, const char *mode)
static const char kLogExt[]
Definition: log.cc:351
static const int kLogBufferSize
Definition: log.cc:355
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
void MemCopy(void *dest, const void *src, size_t size)
Definition: utils.h:350

References v8::base::OS::FOpen(), kLogBufferSize, kLogExt, ll_output_handle_, LogCodeInfo(), v8::base::OS::LogFileOpenMode, v8::internal::MemCopy(), name, NULL, and v8::internal::Vector< T >::start().

+ Here is the call graph for this function:

◆ ~LowLevelLogger()

v8::internal::LowLevelLogger::~LowLevelLogger ( )
virtual

Definition at line 387 of file log.cc.

387  {
388  fclose(ll_output_handle_);
390 }

References ll_output_handle_, and NULL.

Member Function Documentation

◆ CodeDeleteEvent()

void v8::internal::LowLevelLogger::CodeDeleteEvent ( Address  from)
virtual

Implements v8::internal::CodeEventListener.

Definition at line 440 of file log.cc.

440  {
441  CodeDeleteStruct event;
442  event.address = from + Code::kHeaderSize;
443  LogWriteStruct(event);
444 }
static const int kHeaderSize
Definition: objects.h:5373
void LogWriteStruct(const T &s)
Definition: log.cc:361

References v8::internal::LowLevelLogger::CodeDeleteStruct::address, v8::internal::Code::kHeaderSize, and LogWriteStruct().

+ Here is the call graph for this function:

◆ CodeDisableOptEvent()

virtual void v8::internal::LowLevelLogger::CodeDisableOptEvent ( Code code,
SharedFunctionInfo shared 
)
inlinevirtual

Implements v8::internal::CodeEventListener.

Definition at line 303 of file log.cc.

303 { }

◆ CodeMoveEvent()

void v8::internal::LowLevelLogger::CodeMoveEvent ( Address  from,
Address  to 
)
virtual

Implements v8::internal::CodeEventListener.

Definition at line 432 of file log.cc.

432  {
433  CodeMoveStruct event;
434  event.from_address = from + Code::kHeaderSize;
435  event.to_address = to + Code::kHeaderSize;
436  LogWriteStruct(event);
437 }
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::LowLevelLogger::CodeMoveStruct::from_address, v8::internal::Code::kHeaderSize, LogWriteStruct(), and to().

+ Here is the call graph for this function:

◆ CodeMovingGCEvent()

void v8::internal::LowLevelLogger::CodeMovingGCEvent ( )
virtual

Reimplemented from v8::internal::CodeEventLogger.

Definition at line 462 of file log.cc.

462  {
463  const char tag = kCodeMovingGCTag;
464 
465  LogWriteBytes(&tag, sizeof(tag));
466 }
static const char kCodeMovingGCTag
Definition: log.cc:347
void LogWriteBytes(const char *bytes, int size)
Definition: log.cc:455

References kCodeMovingGCTag, and LogWriteBytes().

+ Here is the call graph for this function:

◆ LogCodeInfo()

void v8::internal::LowLevelLogger::LogCodeInfo ( )
private

Definition at line 393 of file log.cc.

393  {
394 #if V8_TARGET_ARCH_IA32
395  const char arch[] = "ia32";
396 #elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_64_BIT
397  const char arch[] = "x64";
398 #elif V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
399  const char arch[] = "x32";
400 #elif V8_TARGET_ARCH_ARM
401  const char arch[] = "arm";
402 #elif V8_TARGET_ARCH_MIPS
403  const char arch[] = "mips";
404 #elif V8_TARGET_ARCH_X87
405  const char arch[] = "x87";
406 #elif V8_TARGET_ARCH_ARM64
407  const char arch[] = "arm64";
408 #else
409  const char arch[] = "unknown";
410 #endif
411  LogWriteBytes(arch, sizeof(arch));
412 }

References LogWriteBytes().

Referenced by LowLevelLogger().

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

◆ LogRecordedBuffer()

void v8::internal::LowLevelLogger::LogRecordedBuffer ( Code code,
SharedFunctionInfo shared,
const char *  name,
int  length 
)
privatevirtual

Implements v8::internal::CodeEventLogger.

Definition at line 415 of file log.cc.

418  {
419  CodeCreateStruct event;
420  event.name_size = length;
421  event.code_address = code->instruction_start();
422  DCHECK(event.code_address == code->address() + Code::kHeaderSize);
423  event.code_size = code->instruction_size();
424  LogWriteStruct(event);
425  LogWriteBytes(name, length);
427  reinterpret_cast<const char*>(code->instruction_start()),
428  code->instruction_size());
429 }
#define DCHECK(condition)
Definition: logging.h:205

References v8::internal::HeapObject::address(), v8::internal::LowLevelLogger::CodeCreateStruct::code_address, DCHECK, v8::internal::Code::instruction_size(), v8::internal::Code::instruction_start(), v8::internal::Code::kHeaderSize, LogWriteBytes(), LogWriteStruct(), name, and v8::internal::LowLevelLogger::CodeCreateStruct::name_size.

+ Here is the call graph for this function:

◆ LogWriteBytes()

void v8::internal::LowLevelLogger::LogWriteBytes ( const char *  bytes,
int  size 
)
private

Definition at line 455 of file log.cc.

455  {
456  size_t rv = fwrite(bytes, 1, size, ll_output_handle_);
457  DCHECK(static_cast<size_t>(size) == rv);
458  USE(rv);
459 }
enable harmony numeric enable harmony object literal extensions Optimize object size
void USE(T)
Definition: macros.h:322

References DCHECK, ll_output_handle_, size, and USE().

Referenced by CodeMovingGCEvent(), LogCodeInfo(), LogRecordedBuffer(), and LogWriteStruct().

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

◆ LogWriteStruct()

template<typename T >
void v8::internal::LowLevelLogger::LogWriteStruct ( const T s)
inlineprivate

Definition at line 361 of file log.cc.

361  {
362  char tag = T::kTag;
363  LogWriteBytes(reinterpret_cast<const char*>(&tag), sizeof(tag));
364  LogWriteBytes(reinterpret_cast<const char*>(&s), sizeof(s));
365  }

References LogWriteBytes().

Referenced by CodeDeleteEvent(), CodeMoveEvent(), LogRecordedBuffer(), and SnapshotPositionEvent().

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

◆ SnapshotPositionEvent()

void v8::internal::LowLevelLogger::SnapshotPositionEvent ( Address  addr,
int  pos 
)
virtual

Definition at line 447 of file log.cc.

447  {
448  SnapshotPositionStruct event;
449  event.address = addr + Code::kHeaderSize;
450  event.position = pos;
451  LogWriteStruct(event);
452 }

References v8::internal::LowLevelLogger::SnapshotPositionStruct::address, v8::internal::Code::kHeaderSize, and LogWriteStruct().

+ Here is the call graph for this function:

Member Data Documentation

◆ kCodeMovingGCTag

const char v8::internal::LowLevelLogger::kCodeMovingGCTag = 'G'
staticprivate

Definition at line 347 of file log.cc.

Referenced by CodeMovingGCEvent().

◆ kLogBufferSize

const int v8::internal::LowLevelLogger::kLogBufferSize = 2 * MB
staticprivate

Definition at line 355 of file log.cc.

Referenced by LowLevelLogger().

◆ kLogExt

const char v8::internal::LowLevelLogger::kLogExt = ".ll"
staticprivate

Definition at line 351 of file log.cc.

Referenced by LowLevelLogger().

◆ ll_output_handle_

FILE* v8::internal::LowLevelLogger::ll_output_handle_
private

Definition at line 367 of file log.cc.

Referenced by LogWriteBytes(), LowLevelLogger(), and ~LowLevelLogger().


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