V8 Project
v8::internal::Logger Class Reference

#include <log.h>

+ Collaboration diagram for v8::internal::Logger:

Public Types

enum  StartEnd { START = 0 , END = 1 }
 
enum  LogEventsAndTags { NUMBER_OF_LOG_EVENTS }
 

Public Member Functions

bool SetUp (Isolate *isolate)
 
void SetCodeEventHandler (uint32_t options, JitCodeEventHandler event_handler)
 
Samplersampler ()
 
FILE * TearDown ()
 
void StringEvent (const char *name, const char *value)
 
void IntEvent (const char *name, int value)
 
void IntPtrTEvent (const char *name, intptr_t value)
 
void HandleEvent (const char *name, Object **location)
 
void NewEvent (const char *name, void *object, size_t size)
 
void DeleteEvent (const char *name, void *object)
 
void ResourceEvent (const char *name, const char *tag)
 
void SuspectReadEvent (Name *name, Object *obj)
 
void DebugTag (const char *call_site_tag)
 
void DebugEvent (const char *event_type, Vector< uint16_t > parameter)
 
void ApiNamedSecurityCheck (Object *key)
 
void ApiIndexedSecurityCheck (uint32_t index)
 
void ApiNamedPropertyAccess (const char *tag, JSObject *holder, Object *name)
 
void ApiIndexedPropertyAccess (const char *tag, JSObject *holder, uint32_t index)
 
void ApiObjectAccess (const char *tag, JSObject *obj)
 
void ApiEntryCall (const char *name)
 
void addCodeEventListener (CodeEventListener *listener)
 
void removeCodeEventListener (CodeEventListener *listener)
 
bool hasCodeEventListener (CodeEventListener *listener)
 
void CallbackEvent (Name *name, Address entry_point)
 
void GetterCallbackEvent (Name *name, Address entry_point)
 
void SetterCallbackEvent (Name *name, Address entry_point)
 
void CodeCreateEvent (LogEventsAndTags tag, Code *code, const char *source)
 
void CodeCreateEvent (LogEventsAndTags tag, Code *code, Name *name)
 
void CodeCreateEvent (LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *name)
 
void CodeCreateEvent (LogEventsAndTags tag, Code *code, SharedFunctionInfo *shared, CompilationInfo *info, Name *source, int line, int column)
 
void CodeCreateEvent (LogEventsAndTags tag, Code *code, int args_count)
 
void CodeDisableOptEvent (Code *code, SharedFunctionInfo *shared)
 
void CodeMovingGCEvent ()
 
void RegExpCodeCreateEvent (Code *code, String *source)
 
void CodeMoveEvent (Address from, Address to)
 
void CodeDeleteEvent (Address from)
 
void CodeLinePosInfoAddPositionEvent (void *jit_handler_data, int pc_offset, int position)
 
void CodeLinePosInfoAddStatementPositionEvent (void *jit_handler_data, int pc_offset, int position)
 
void CodeStartLinePosInfoRecordEvent (PositionsRecorder *pos_recorder)
 
void CodeEndLinePosInfoRecordEvent (Code *code, void *jit_handler_data)
 
void SharedFunctionInfoMoveEvent (Address from, Address to)
 
void CodeNameEvent (Address addr, int pos, const char *code_name)
 
void SnapshotPositionEvent (Address addr, int pos)
 
void HeapSampleBeginEvent (const char *space, const char *kind)
 
void HeapSampleEndEvent (const char *space, const char *kind)
 
void HeapSampleItemEvent (const char *type, int number, int bytes)
 
void HeapSampleJSConstructorEvent (const char *constructor, int number, int bytes)
 
void HeapSampleJSRetainersEvent (const char *constructor, const char *event)
 
void HeapSampleJSProducerEvent (const char *constructor, Address *stack)
 
void HeapSampleStats (const char *space, const char *kind, intptr_t capacity, intptr_t used)
 
void SharedLibraryEvent (const std::string &library_path, uintptr_t start, uintptr_t end)
 
void CodeDeoptEvent (Code *code)
 
void CurrentTimeEvent ()
 
void TimerEvent (StartEnd se, const char *name)
 
void RegExpCompileEvent (Handle< JSRegExp > regexp, bool in_cache)
 
bool is_logging ()
 
bool is_logging_code_events ()
 
void StopProfiler ()
 
void LogExistingFunction (Handle< SharedFunctionInfo > shared, Handle< Code > code)
 
void LogCompiledFunctions ()
 
void LogAccessorCallbacks ()
 
void LogCodeObjects ()
 
 INLINE (static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script *))
 
void LogFailure ()
 

Static Public Member Functions

static void NewEventStatic (const char *name, void *object, size_t size)
 
static void DeleteEventStatic (const char *name, void *object)
 
static void EnterExternal (Isolate *isolate)
 
static void LeaveExternal (Isolate *isolate)
 
static void EmptyTimerEventsLogger (const char *name, int se)
 
static void DefaultTimerEventsLogger (const char *name, int se)
 

Static Public Attributes

static const int kSamplingIntervalMs = 1
 

Private Member Functions

 Logger (Isolate *isolate)
 
 ~Logger ()
 
void ProfilerBeginEvent ()
 
void CallbackEventInternal (const char *prefix, Name *name, Address entry_point)
 
void MoveEventInternal (LogEventsAndTags event, Address from, Address to)
 
void LogRegExpSource (Handle< JSRegExp > regexp)
 
void LogCodeObject (Object *code_object)
 
void InitNameBuffer (LogEventsAndTags tag)
 
void TickEvent (TickSample *sample, bool overflow)
 
void ApiEvent (const char *name,...)
 
void UncheckedStringEvent (const char *name, const char *value)
 
void UncheckedIntEvent (const char *name, int value)
 
void UncheckedIntPtrTEvent (const char *name, intptr_t value)
 

Private Attributes

Isolateisolate_
 
Tickerticker_
 
Profilerprofiler_
 
const char *const * log_events_
 
bool is_logging_
 
Loglog_
 
PerfBasicLoggerperf_basic_logger_
 
PerfJitLoggerperf_jit_logger_
 
LowLevelLoggerll_logger_
 
JitLoggerjit_logger_
 
List< CodeEventListener * > listeners_
 
bool is_initialized_
 
base::ElapsedTimer timer_
 

Friends

class EventLog
 
class Isolate
 
class TimeLog
 
class Profiler
 
template<StateTag Tag>
class VMState
 
class LoggerTestHelper
 
class CpuProfiler
 

Detailed Description

Definition at line 152 of file log.h.

Member Enumeration Documentation

◆ LogEventsAndTags

Enumerator
NUMBER_OF_LOG_EVENTS 

Definition at line 157 of file log.h.

157  {
160  };
@ NUMBER_OF_LOG_EVENTS
Definition: log.h:159
#define DECLARE_ENUM(enum_item, ignore)
Definition: log.h:156
#define LOG_EVENTS_AND_TAGS_LIST(V)
Definition: log.h:86

◆ StartEnd

Enumerator
START 
END 

Definition at line 154 of file log.h.

154 { START = 0, END = 1 };

Constructor & Destructor Documentation

◆ Logger()

v8::internal::Logger::Logger ( Isolate isolate)
explicitprivate

Definition at line 765 of file log.cc.

766  : isolate_(isolate),
767  ticker_(NULL),
768  profiler_(NULL),
769  log_events_(NULL),
770  is_logging_(false),
771  log_(new Log(this)),
774  ll_logger_(NULL),
775  jit_logger_(NULL),
776  listeners_(5),
777  is_initialized_(false) {
778 }
bool is_initialized_
Definition: log.h:415
Ticker * ticker_
Definition: log.h:386
Profiler * profiler_
Definition: log.h:391
PerfJitLogger * perf_jit_logger_
Definition: log.h:408
JitLogger * jit_logger_
Definition: log.h:410
const char *const * log_events_
Definition: log.h:394
bool is_logging_
Definition: log.h:405
PerfBasicLogger * perf_basic_logger_
Definition: log.h:407
LowLevelLogger * ll_logger_
Definition: log.h:409
Isolate * isolate_
Definition: log.h:383
List< CodeEventListener * > listeners_
Definition: log.h:411
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

◆ ~Logger()

v8::internal::Logger::~Logger ( )
private

Definition at line 781 of file log.cc.

781  {
782  delete log_;
783 }

References log_.

Member Function Documentation

◆ addCodeEventListener()

void v8::internal::Logger::addCodeEventListener ( CodeEventListener listener)

Definition at line 786 of file log.cc.

786  {
787  DCHECK(!hasCodeEventListener(listener));
788  listeners_.Add(listener);
789 }
bool hasCodeEventListener(CodeEventListener *listener)
Definition: log.cc:798
#define DCHECK(condition)
Definition: logging.h:205

References DCHECK, hasCodeEventListener(), and listeners_.

Referenced by v8::internal::CodeAddressMap::CodeAddressMap(), SetCodeEventHandler(), and SetUp().

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

◆ ApiEntryCall()

void v8::internal::Logger::ApiEntryCall ( const char *  name)

Definition at line 1085 of file log.cc.

1085  {
1086  if (!log_->IsEnabled() || !FLAG_log_api) return;
1087  ApiEvent("api,%s", name);
1088 }
bool IsEnabled()
Definition: log-utils.h:37
void ApiEvent(const char *name,...)
Definition: log.cc:861
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

References ApiEvent(), v8::internal::Log::IsEnabled(), log_, and name.

+ Here is the call graph for this function:

◆ ApiEvent()

void v8::internal::Logger::ApiEvent ( const char *  name,
  ... 
)
private

Definition at line 861 of file log.cc.

861  {
862  DCHECK(log_->IsEnabled() && FLAG_log_api);
863  Log::MessageBuilder msg(log_);
864  va_list ap;
865  va_start(ap, format);
866  msg.AppendVA(format, ap);
867  va_end(ap);
868  msg.WriteToLogFile();
869 }

References DCHECK, v8::internal::Log::IsEnabled(), and log_.

Referenced by ApiEntryCall(), ApiIndexedPropertyAccess(), ApiIndexedSecurityCheck(), ApiNamedPropertyAccess(), ApiNamedSecurityCheck(), and ApiObjectAccess().

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

◆ ApiIndexedPropertyAccess()

void v8::internal::Logger::ApiIndexedPropertyAccess ( const char *  tag,
JSObject holder,
uint32_t  index 
)

Definition at line 1065 of file log.cc.

1067  {
1068  if (!log_->IsEnabled() || !FLAG_log_api) return;
1069  String* class_name_obj = holder->class_name();
1070  SmartArrayPointer<char> class_name =
1071  class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1072  ApiEvent("api,%s,\"%s\",%u", tag, class_name.get(), index);
1073 }
@ DISALLOW_NULLS
Definition: objects.h:8337
@ ROBUST_STRING_TRAVERSAL
Definition: objects.h:8338

References ApiEvent(), v8::internal::JSReceiver::class_name(), v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), v8::internal::Log::IsEnabled(), log_, v8::internal::ROBUST_STRING_TRAVERSAL, and v8::internal::String::ToCString().

+ Here is the call graph for this function:

◆ ApiIndexedSecurityCheck()

void v8::internal::Logger::ApiIndexedSecurityCheck ( uint32_t  index)

Definition at line 1032 of file log.cc.

1032  {
1033  if (!log_->IsEnabled() || !FLAG_log_api) return;
1034  ApiEvent("api,check-security,%u", index);
1035 }

References ApiEvent(), v8::internal::Log::IsEnabled(), and log_.

+ Here is the call graph for this function:

◆ ApiNamedPropertyAccess()

void v8::internal::Logger::ApiNamedPropertyAccess ( const char *  tag,
JSObject holder,
Object name 
)

Definition at line 1038 of file log.cc.

1040  {
1041  DCHECK(name->IsName());
1042  if (!log_->IsEnabled() || !FLAG_log_api) return;
1043  String* class_name_obj = holder->class_name();
1044  SmartArrayPointer<char> class_name =
1045  class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1046  if (name->IsString()) {
1047  SmartArrayPointer<char> property_name =
1048  String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1049  ApiEvent("api,%s,\"%s\",\"%s\"", tag, class_name.get(),
1050  property_name.get());
1051  } else {
1052  Symbol* symbol = Symbol::cast(name);
1053  uint32_t hash = symbol->Hash();
1054  if (symbol->name()->IsUndefined()) {
1055  ApiEvent("api,%s,\"%s\",symbol(hash %x)", tag, class_name.get(), hash);
1056  } else {
1057  SmartArrayPointer<char> str = String::cast(symbol->name())->ToCString(
1059  ApiEvent("api,%s,\"%s\",symbol(\"%s\" hash %x)", tag, class_name.get(),
1060  str.get(), hash);
1061  }
1062  }
1063 }
IN DWORD64 OUT PDWORD64 OUT PIMAGEHLP_SYMBOL64 Symbol

References ApiEvent(), v8::internal::JSReceiver::class_name(), DCHECK, v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), v8::internal::Name::Hash(), v8::internal::Log::IsEnabled(), log_, name, v8::internal::ROBUST_STRING_TRAVERSAL, and v8::internal::String::ToCString().

+ Here is the call graph for this function:

◆ ApiNamedSecurityCheck()

void v8::internal::Logger::ApiNamedSecurityCheck ( Object key)

Definition at line 872 of file log.cc.

872  {
873  if (!log_->IsEnabled() || !FLAG_log_api) return;
874  if (key->IsString()) {
875  SmartArrayPointer<char> str =
876  String::cast(key)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
877  ApiEvent("api,check-security,\"%s\"", str.get());
878  } else if (key->IsSymbol()) {
879  Symbol* symbol = Symbol::cast(key);
880  if (symbol->name()->IsUndefined()) {
881  ApiEvent("api,check-security,symbol(hash %x)", Symbol::cast(key)->Hash());
882  } else {
883  SmartArrayPointer<char> str = String::cast(symbol->name())->ToCString(
885  ApiEvent("api,check-security,symbol(\"%s\" hash %x)", str.get(),
886  Symbol::cast(key)->Hash());
887  }
888  } else if (key->IsUndefined()) {
889  ApiEvent("api,check-security,undefined");
890  } else {
891  ApiEvent("api,check-security,['no-name']");
892  }
893 }
static uint32_t Hash(RegisteredExtension *extension)

References ApiEvent(), v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), v8::internal::Hash(), v8::internal::Log::IsEnabled(), log_, and v8::internal::ROBUST_STRING_TRAVERSAL.

+ Here is the call graph for this function:

◆ ApiObjectAccess()

void v8::internal::Logger::ApiObjectAccess ( const char *  tag,
JSObject obj 
)

Definition at line 1076 of file log.cc.

1076  {
1077  if (!log_->IsEnabled() || !FLAG_log_api) return;
1078  String* class_name_obj = object->class_name();
1079  SmartArrayPointer<char> class_name =
1080  class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1081  ApiEvent("api,%s,\"%s\"", tag, class_name.get());
1082 }

References ApiEvent(), v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), v8::internal::Log::IsEnabled(), log_, v8::internal::ROBUST_STRING_TRAVERSAL, and v8::internal::String::ToCString().

+ Here is the call graph for this function:

◆ CallbackEvent()

void v8::internal::Logger::CallbackEvent ( Name name,
Address  entry_point 
)

Definition at line 1145 of file log.cc.

1145  {
1146  PROFILER_LOG(CallbackEvent(name, entry_point));
1147  CallbackEventInternal("", name, entry_point);
1148 }
void CallbackEventInternal(const char *prefix, Name *name, Address entry_point)
Definition: log.cc:1118
void CallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1145
#define PROFILER_LOG(Call)
Definition: log.cc:41

References CallbackEventInternal(), name, and PROFILER_LOG.

Referenced by LogExistingFunction().

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

◆ CallbackEventInternal()

void v8::internal::Logger::CallbackEventInternal ( const char *  prefix,
Name name,
Address  entry_point 
)
private

Definition at line 1118 of file log.cc.

1119  {
1120  if (!FLAG_log_code || !log_->IsEnabled()) return;
1121  Log::MessageBuilder msg(log_);
1122  msg.Append("%s,%s,-2,",
1123  kLogEventsNames[CODE_CREATION_EVENT],
1124  kLogEventsNames[CALLBACK_TAG]);
1125  msg.AppendAddress(entry_point);
1126  if (name->IsString()) {
1127  SmartArrayPointer<char> str =
1128  String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1129  msg.Append(",1,\"%s%s\"", prefix, str.get());
1130  } else {
1131  Symbol* symbol = Symbol::cast(name);
1132  if (symbol->name()->IsUndefined()) {
1133  msg.Append(",1,symbol(hash %x)", prefix, symbol->Hash());
1134  } else {
1135  SmartArrayPointer<char> str = String::cast(symbol->name())->ToCString(
1137  msg.Append(",1,symbol(\"%s\" hash %x)", prefix, str.get(),
1138  symbol->Hash());
1139  }
1140  }
1141  msg.WriteToLogFile();
1142 }
static const char *const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS]
Definition: log.cc:30

References v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), v8::internal::Name::Hash(), v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, log_, name, and v8::internal::ROBUST_STRING_TRAVERSAL.

Referenced by CallbackEvent(), GetterCallbackEvent(), and SetterCallbackEvent().

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

◆ CodeCreateEvent() [1/5]

void v8::internal::Logger::CodeCreateEvent ( LogEventsAndTags  tag,
Code code,
const char *  source 
)

Definition at line 1176 of file log.cc.

1178  {
1179  PROFILER_LOG(CodeCreateEvent(tag, code, comment));
1180 
1181  if (!is_logging_code_events()) return;
1182  CALL_LISTENERS(CodeCreateEvent(tag, code, comment));
1183 
1184  if (!FLAG_log_code || !log_->IsEnabled()) return;
1185  Log::MessageBuilder msg(log_);
1186  AppendCodeCreateHeader(&msg, tag, code);
1187  msg.AppendDoubleQuotedString(comment);
1188  msg.WriteToLogFile();
1189 }
bool is_logging_code_events()
Definition: log.h:315
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
Definition: log.cc:1176
#define CALL_LISTENERS(Call)
Definition: log.cc:36
static void AppendCodeCreateHeader(Log::MessageBuilder *msg, Logger::LogEventsAndTags tag, Code *code)
Definition: log.cc:1163

References v8::internal::AppendCodeCreateHeader(), CALL_LISTENERS, is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, and PROFILER_LOG.

Referenced by CodeCreateEvent(), LogCodeObject(), and LogExistingFunction().

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

◆ CodeCreateEvent() [2/5]

void v8::internal::Logger::CodeCreateEvent ( LogEventsAndTags  tag,
Code code,
int  args_count 
)

Definition at line 1277 of file log.cc.

1279  {
1280  PROFILER_LOG(CodeCreateEvent(tag, code, args_count));
1281 
1282  if (!is_logging_code_events()) return;
1283  CALL_LISTENERS(CodeCreateEvent(tag, code, args_count));
1284 
1285  if (!FLAG_log_code || !log_->IsEnabled()) return;
1286  Log::MessageBuilder msg(log_);
1287  AppendCodeCreateHeader(&msg, tag, code);
1288  msg.Append("\"args_count: %d\"", args_count);
1289  msg.WriteToLogFile();
1290 }

References v8::internal::AppendCodeCreateHeader(), CALL_LISTENERS, CodeCreateEvent(), is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, and PROFILER_LOG.

+ Here is the call graph for this function:

◆ CodeCreateEvent() [3/5]

void v8::internal::Logger::CodeCreateEvent ( LogEventsAndTags  tag,
Code code,
Name name 
)

Definition at line 1192 of file log.cc.

1194  {
1195  PROFILER_LOG(CodeCreateEvent(tag, code, name));
1196 
1197  if (!is_logging_code_events()) return;
1198  CALL_LISTENERS(CodeCreateEvent(tag, code, name));
1199 
1200  if (!FLAG_log_code || !log_->IsEnabled()) return;
1201  Log::MessageBuilder msg(log_);
1202  AppendCodeCreateHeader(&msg, tag, code);
1203  if (name->IsString()) {
1204  msg.Append('"');
1205  msg.AppendDetailed(String::cast(name), false);
1206  msg.Append('"');
1207  } else {
1208  msg.AppendSymbolName(Symbol::cast(name));
1209  }
1210  msg.WriteToLogFile();
1211 }

References v8::internal::AppendCodeCreateHeader(), CALL_LISTENERS, CodeCreateEvent(), is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, name, and PROFILER_LOG.

+ Here is the call graph for this function:

◆ CodeCreateEvent() [4/5]

void v8::internal::Logger::CodeCreateEvent ( LogEventsAndTags  tag,
Code code,
SharedFunctionInfo shared,
CompilationInfo info,
Name name 
)

Definition at line 1214 of file log.cc.

1218  {
1219  PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, name));
1220 
1221  if (!is_logging_code_events()) return;
1222  CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, name));
1223 
1224  if (!FLAG_log_code || !log_->IsEnabled()) return;
1225  if (code == isolate_->builtins()->builtin(Builtins::kCompileLazy)) return;
1226 
1227  Log::MessageBuilder msg(log_);
1228  AppendCodeCreateHeader(&msg, tag, code);
1229  if (name->IsString()) {
1230  SmartArrayPointer<char> str =
1231  String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1232  msg.Append("\"%s\"", str.get());
1233  } else {
1234  msg.AppendSymbolName(Symbol::cast(name));
1235  }
1236  msg.Append(',');
1237  msg.AppendAddress(shared->address());
1238  msg.Append(",%s", ComputeMarker(code));
1239  msg.WriteToLogFile();
1240 }
Code * builtin(Name name)
Definition: builtins.h:254
Builtins * builtins()
Definition: isolate.h:947
static const char * ComputeMarker(Code *code)
Definition: log.cc:50

References v8::internal::HeapObject::address(), v8::internal::AppendCodeCreateHeader(), v8::internal::Builtins::builtin(), v8::internal::Isolate::builtins(), CALL_LISTENERS, CodeCreateEvent(), v8::internal::ComputeMarker(), v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), is_logging_code_events(), v8::internal::Log::IsEnabled(), isolate_, log_, name, PROFILER_LOG, and v8::internal::ROBUST_STRING_TRAVERSAL.

+ Here is the call graph for this function:

◆ CodeCreateEvent() [5/5]

void v8::internal::Logger::CodeCreateEvent ( LogEventsAndTags  tag,
Code code,
SharedFunctionInfo shared,
CompilationInfo info,
Name source,
int  line,
int  column 
)

Definition at line 1246 of file log.cc.

1250  {
1251  PROFILER_LOG(CodeCreateEvent(tag, code, shared, info, source, line, column));
1252 
1253  if (!is_logging_code_events()) return;
1254  CALL_LISTENERS(CodeCreateEvent(tag, code, shared, info, source, line,
1255  column));
1256 
1257  if (!FLAG_log_code || !log_->IsEnabled()) return;
1258  Log::MessageBuilder msg(log_);
1259  AppendCodeCreateHeader(&msg, tag, code);
1260  SmartArrayPointer<char> name =
1261  shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1262  msg.Append("\"%s ", name.get());
1263  if (source->IsString()) {
1264  SmartArrayPointer<char> sourcestr =
1265  String::cast(source)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1266  msg.Append("%s", sourcestr.get());
1267  } else {
1268  msg.AppendSymbolName(Symbol::cast(source));
1269  }
1270  msg.Append(":%d:%d\",", line, column);
1271  msg.AppendAddress(shared->address());
1272  msg.Append(",%s", ComputeMarker(code));
1273  msg.WriteToLogFile();
1274 }

References v8::internal::HeapObject::address(), v8::internal::AppendCodeCreateHeader(), CALL_LISTENERS, CodeCreateEvent(), v8::internal::ComputeMarker(), v8::internal::SharedFunctionInfo::DebugName(), v8::internal::DISALLOW_NULLS, v8::internal::SmartPointerBase< Deallocator, T >::get(), is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, name, PROFILER_LOG, v8::internal::ROBUST_STRING_TRAVERSAL, and v8::internal::String::ToCString().

+ Here is the call graph for this function:

◆ CodeDeleteEvent()

void v8::internal::Logger::CodeDeleteEvent ( Address  from)

Definition at line 1346 of file log.cc.

1346  {
1348 
1349  if (!is_logging_code_events()) return;
1351 
1352  if (!FLAG_log_code || !log_->IsEnabled()) return;
1353  Log::MessageBuilder msg(log_);
1354  msg.Append("%s,", kLogEventsNames[CODE_DELETE_EVENT]);
1355  msg.AppendAddress(from);
1356  msg.WriteToLogFile();
1357 }
void CodeDeleteEvent(Address from)
Definition: log.cc:1346

References CALL_LISTENERS, is_logging_code_events(), v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, log_, and PROFILER_LOG.

+ Here is the call graph for this function:

◆ CodeDeoptEvent()

void v8::internal::Logger::CodeDeoptEvent ( Code code)

Definition at line 907 of file log.cc.

907  {
908  if (!log_->IsEnabled()) return;
909  DCHECK(FLAG_log_internal_timer_events);
910  Log::MessageBuilder msg(log_);
911  int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
912  msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize());
913  msg.WriteToLogFile();
914 }
base::ElapsedTimer timer_
Definition: log.h:417

References v8::internal::Code::CodeSize(), DCHECK, v8::internal::Log::IsEnabled(), log_, and timer_.

+ Here is the call graph for this function:

◆ CodeDisableOptEvent()

void v8::internal::Logger::CodeDisableOptEvent ( Code code,
SharedFunctionInfo shared 
)

Definition at line 1293 of file log.cc.

1294  {
1295  PROFILER_LOG(CodeDisableOptEvent(code, shared));
1296 
1297  if (!is_logging_code_events()) return;
1298  CALL_LISTENERS(CodeDisableOptEvent(code, shared));
1299 
1300  if (!FLAG_log_code || !log_->IsEnabled()) return;
1301  Log::MessageBuilder msg(log_);
1302  msg.Append("%s,", kLogEventsNames[CODE_DISABLE_OPT_EVENT]);
1303  SmartArrayPointer<char> name =
1304  shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
1305  msg.Append("\"%s\",", name.get());
1306  msg.Append("\"%s\"", GetBailoutReason(shared->DisableOptimizationReason()));
1307  msg.WriteToLogFile();
1308 }
void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
Definition: log.cc:1293
const char * GetBailoutReason(BailoutReason reason)

References CALL_LISTENERS, v8::internal::SharedFunctionInfo::DebugName(), v8::internal::SharedFunctionInfo::DisableOptimizationReason(), v8::internal::DISALLOW_NULLS, v8::internal::GetBailoutReason(), is_logging_code_events(), v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, log_, name, PROFILER_LOG, v8::internal::ROBUST_STRING_TRAVERSAL, and v8::internal::String::ToCString().

+ Here is the call graph for this function:

◆ CodeEndLinePosInfoRecordEvent()

void v8::internal::Logger::CodeEndLinePosInfoRecordEvent ( Code code,
void *  jit_handler_data 
)

Definition at line 1387 of file log.cc.

1388  {
1389  JIT_LOG(EndCodePosInfoEvent(code, jit_handler_data));
1390 }
#define JIT_LOG(Call)
Definition: log.cc:469

References JIT_LOG.

◆ CodeLinePosInfoAddPositionEvent()

void v8::internal::Logger::CodeLinePosInfoAddPositionEvent ( void *  jit_handler_data,
int  pc_offset,
int  position 
)

Definition at line 1360 of file log.cc.

1362  {
1363  JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1364  pc_offset,
1365  position,
1367 }

References JIT_LOG, and v8::JitCodeEvent::POSITION.

◆ CodeLinePosInfoAddStatementPositionEvent()

void v8::internal::Logger::CodeLinePosInfoAddStatementPositionEvent ( void *  jit_handler_data,
int  pc_offset,
int  position 
)

Definition at line 1370 of file log.cc.

1372  {
1373  JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1374  pc_offset,
1375  position,
1377 }
@ STATEMENT_POSITION
Definition: v8.h:4285

References JIT_LOG, and v8::JitCodeEvent::STATEMENT_POSITION.

◆ CodeMoveEvent()

void v8::internal::Logger::CodeMoveEvent ( Address  from,
Address  to 
)

Definition at line 1337 of file log.cc.

1337  {
1338  PROFILER_LOG(CodeMoveEvent(from, to));
1339 
1340  if (!is_logging_code_events()) return;
1342  MoveEventInternal(CODE_MOVE_EVENT, from, to);
1343 }
void MoveEventInternal(LogEventsAndTags event, Address from, Address to)
Definition: log.cc:1422
void CodeMoveEvent(Address from, Address to)
Definition: log.cc:1337
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 CALL_LISTENERS, is_logging_code_events(), MoveEventInternal(), PROFILER_LOG, and to().

+ Here is the call graph for this function:

◆ CodeMovingGCEvent()

void v8::internal::Logger::CodeMovingGCEvent ( )

Definition at line 1311 of file log.cc.

1311  {
1313 
1314  if (!is_logging_code_events()) return;
1315  if (!log_->IsEnabled() || !FLAG_ll_prof) return;
1318 }
static void SignalCodeMovingGC()
void CodeMovingGCEvent()
Definition: log.cc:1311

References CALL_LISTENERS, is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, PROFILER_LOG, and v8::base::OS::SignalCodeMovingGC().

+ Here is the call graph for this function:

◆ CodeNameEvent()

void v8::internal::Logger::CodeNameEvent ( Address  addr,
int  pos,
const char *  code_name 
)

Definition at line 1393 of file log.cc.

1393  {
1394  if (code_name == NULL) return; // Not a code object.
1395  Log::MessageBuilder msg(log_);
1396  msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos);
1397  msg.AppendDoubleQuotedString(code_name);
1398  msg.WriteToLogFile();
1399 }

References v8::internal::kLogEventsNames, log_, and NULL.

◆ CodeStartLinePosInfoRecordEvent()

void v8::internal::Logger::CodeStartLinePosInfoRecordEvent ( PositionsRecorder *  pos_recorder)

Definition at line 1380 of file log.cc.

1380  {
1381  if (jit_logger_ != NULL) {
1382  pos_recorder->AttachJITHandlerData(jit_logger_->StartCodePosInfoEvent());
1383  }
1384 }
void * StartCodePosInfoEvent()
Definition: log.cc:571

References jit_logger_, NULL, and v8::internal::JitLogger::StartCodePosInfoEvent().

+ Here is the call graph for this function:

◆ CurrentTimeEvent()

void v8::internal::Logger::CurrentTimeEvent ( )

Definition at line 917 of file log.cc.

917  {
918  if (!log_->IsEnabled()) return;
919  DCHECK(FLAG_log_internal_timer_events);
920  Log::MessageBuilder msg(log_);
921  int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
922  msg.Append("current-time,%ld", since_epoch);
923  msg.WriteToLogFile();
924 }

References DCHECK, v8::internal::Log::IsEnabled(), log_, and timer_.

+ Here is the call graph for this function:

◆ DebugEvent()

void v8::internal::Logger::DebugEvent ( const char *  event_type,
Vector< uint16_t >  parameter 
)

Definition at line 1504 of file log.cc.

1504  {
1505  if (!log_->IsEnabled() || !FLAG_log) return;
1506  StringBuilder s(parameter.length() + 1);
1507  for (int i = 0; i < parameter.length(); ++i) {
1508  s.AddCharacter(static_cast<char>(parameter[i]));
1509  }
1510  char* parameter_string = s.Finalize();
1511  Log::MessageBuilder msg(log_);
1512  msg.Append("debug-queue-event,%s,%15.3f,%s", event_type,
1513  base::OS::TimeCurrentMillis(), parameter_string);
1514  DeleteArray(parameter_string);
1515  msg.WriteToLogFile();
1516 }
static double TimeCurrentMillis()
int length() const
Definition: vector.h:41
void DeleteArray(T *array)
Definition: allocation.h:68

References v8::internal::SimpleStringBuilder::AddCharacter(), v8::internal::DeleteArray(), v8::internal::SimpleStringBuilder::Finalize(), v8::internal::Log::IsEnabled(), v8::internal::Vector< T >::length(), log_, and v8::base::OS::TimeCurrentMillis().

+ Here is the call graph for this function:

◆ DebugTag()

void v8::internal::Logger::DebugTag ( const char *  call_site_tag)

Definition at line 1496 of file log.cc.

1496  {
1497  if (!log_->IsEnabled() || !FLAG_log) return;
1498  Log::MessageBuilder msg(log_);
1499  msg.Append("debug-tag,%s", call_site_tag);
1500  msg.WriteToLogFile();
1501 }

References v8::internal::Log::IsEnabled(), and log_.

Referenced by v8::internal::Debug::EnqueueCommandMessage(), and v8::internal::Debug::NotifyMessageHandler().

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

◆ DefaultTimerEventsLogger()

void v8::internal::Logger::DefaultTimerEventsLogger ( const char *  name,
int  se 
)
static

Definition at line 953 of file log.cc.

953  {
954  Isolate* isolate = Isolate::Current();
955  LOG(isolate, TimerEvent(static_cast<StartEnd>(se), name));
956 }
void TimerEvent(StartEnd se, const char *name)
Definition: log.cc:927
friend class Isolate
Definition: log.h:399
#define LOG(isolate, Call)
Definition: log.h:69

References LOG, name, and TimerEvent().

Referenced by v8::internal::Isolate::Init(), and v8::internal::TimerEventScope< TimerEvent >::LogTimerEvent().

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

◆ DeleteEvent()

void v8::internal::Logger::DeleteEvent ( const char *  name,
void *  object 
)

Definition at line 1100 of file log.cc.

1100  {
1101  if (!log_->IsEnabled() || !FLAG_log) return;
1102  Log::MessageBuilder msg(log_);
1103  msg.Append("delete,%s,0x%" V8PRIxPTR, name, object);
1104  msg.WriteToLogFile();
1105 }
#define V8PRIxPTR
Definition: macros.h:363

References v8::internal::Log::IsEnabled(), log_, name, and V8PRIxPTR.

+ Here is the call graph for this function:

◆ DeleteEventStatic()

void v8::internal::Logger::DeleteEventStatic ( const char *  name,
void *  object 
)
static

Definition at line 1113 of file log.cc.

1113  {
1114  Isolate::Current()->logger()->DeleteEvent(name, object);
1115 }

References name.

◆ EmptyTimerEventsLogger()

static void v8::internal::Logger::EmptyTimerEventsLogger ( const char *  name,
int  se 
)
inlinestatic

Definition at line 303 of file log.h.

303 {}

Referenced by v8::internal::Isolate::Init().

+ Here is the caller graph for this function:

◆ EnterExternal()

void v8::internal::Logger::EnterExternal ( Isolate isolate)
static

Definition at line 939 of file log.cc.

939  {
941  DCHECK(isolate->current_vm_state() == JS);
942  isolate->set_current_vm_state(EXTERNAL);
943 }

References DCHECK, v8::internal::EXTERNAL, v8::internal::JS, LOG, name, START, and TimerEvent().

+ Here is the call graph for this function:

◆ GetterCallbackEvent()

void v8::internal::Logger::GetterCallbackEvent ( Name name,
Address  entry_point 
)

Definition at line 1151 of file log.cc.

1151  {
1152  PROFILER_LOG(GetterCallbackEvent(name, entry_point));
1153  CallbackEventInternal("get ", name, entry_point);
1154 }
void GetterCallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1151

References CallbackEventInternal(), name, and PROFILER_LOG.

Referenced by LogAccessorCallbacks().

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

◆ HandleEvent()

void v8::internal::Logger::HandleEvent ( const char *  name,
Object **  location 
)

Definition at line 850 of file log.cc.

850  {
851  if (!log_->IsEnabled() || !FLAG_log_handles) return;
852  Log::MessageBuilder msg(log_);
853  msg.Append("%s,0x%" V8PRIxPTR, name, location);
854  msg.WriteToLogFile();
855 }

References v8::internal::Log::IsEnabled(), log_, name, and V8PRIxPTR.

+ Here is the call graph for this function:

◆ hasCodeEventListener()

bool v8::internal::Logger::hasCodeEventListener ( CodeEventListener listener)

Definition at line 798 of file log.cc.

798  {
799  return listeners_.Contains(listener);
800 }

References listeners_.

Referenced by addCodeEventListener(), and removeCodeEventListener().

+ Here is the caller graph for this function:

◆ HeapSampleBeginEvent()

void v8::internal::Logger::HeapSampleBeginEvent ( const char *  space,
const char *  kind 
)

Definition at line 1469 of file log.cc.

1469  {
1470  if (!log_->IsEnabled() || !FLAG_log_gc) return;
1471  Log::MessageBuilder msg(log_);
1472  // Using non-relative system time in order to be able to synchronize with
1473  // external memory profiling events (e.g. DOM memory size).
1474  msg.Append("heap-sample-begin,\"%s\",\"%s\",%.0f", space, kind,
1476  msg.WriteToLogFile();
1477 }
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 space(in MBytes)

References v8::internal::Log::IsEnabled(), log_, space(), and v8::base::OS::TimeCurrentMillis().

+ Here is the call graph for this function:

◆ HeapSampleEndEvent()

void v8::internal::Logger::HeapSampleEndEvent ( const char *  space,
const char *  kind 
)

Definition at line 1480 of file log.cc.

1480  {
1481  if (!log_->IsEnabled() || !FLAG_log_gc) return;
1482  Log::MessageBuilder msg(log_);
1483  msg.Append("heap-sample-end,\"%s\",\"%s\"", space, kind);
1484  msg.WriteToLogFile();
1485 }

References v8::internal::Log::IsEnabled(), log_, and space().

+ Here is the call graph for this function:

◆ HeapSampleItemEvent()

void v8::internal::Logger::HeapSampleItemEvent ( const char *  type,
int  number,
int  bytes 
)

Definition at line 1488 of file log.cc.

1488  {
1489  if (!log_->IsEnabled() || !FLAG_log_gc) return;
1490  Log::MessageBuilder msg(log_);
1491  msg.Append("heap-sample-item,%s,%d,%d", type, number, bytes);
1492  msg.WriteToLogFile();
1493 }

References v8::internal::Log::IsEnabled(), and log_.

+ Here is the call graph for this function:

◆ HeapSampleJSConstructorEvent()

void v8::internal::Logger::HeapSampleJSConstructorEvent ( const char *  constructor,
int  number,
int  bytes 
)

◆ HeapSampleJSProducerEvent()

void v8::internal::Logger::HeapSampleJSProducerEvent ( const char *  constructor,
Address stack 
)

◆ HeapSampleJSRetainersEvent()

void v8::internal::Logger::HeapSampleJSRetainersEvent ( const char *  constructor,
const char *  event 
)

◆ HeapSampleStats()

void v8::internal::Logger::HeapSampleStats ( const char *  space,
const char *  kind,
intptr_t  capacity,
intptr_t  used 
)

◆ InitNameBuffer()

void v8::internal::Logger::InitNameBuffer ( LogEventsAndTags  tag)
private

◆ INLINE()

v8::internal::Logger::INLINE ( static LogEventsAndTags   ToNativeByScriptLogEventsAndTags, Script *)

◆ IntEvent()

void v8::internal::Logger::IntEvent ( const char *  name,
int  value 
)

Definition at line 824 of file log.cc.

824  {
825  if (FLAG_log) UncheckedIntEvent(name, value);
826 }
void UncheckedIntEvent(const char *name, int value)
Definition: log.cc:834

References name, and UncheckedIntEvent().

+ Here is the call graph for this function:

◆ IntPtrTEvent()

void v8::internal::Logger::IntPtrTEvent ( const char *  name,
intptr_t  value 
)

Definition at line 829 of file log.cc.

829  {
830  if (FLAG_log) UncheckedIntPtrTEvent(name, value);
831 }
void UncheckedIntPtrTEvent(const char *name, intptr_t value)
Definition: log.cc:842

References name, and UncheckedIntPtrTEvent().

+ Here is the call graph for this function:

◆ is_logging()

bool v8::internal::Logger::is_logging ( )
inline

Definition at line 311 of file log.h.

311  {
312  return is_logging_;
313  }

References is_logging_.

Referenced by is_logging_code_events(), and v8::internal::Heap::SelectScavengingVisitorsTable().

+ Here is the caller graph for this function:

◆ is_logging_code_events()

bool v8::internal::Logger::is_logging_code_events ( )
inline

Definition at line 315 of file log.h.

315  {
316  return is_logging() || jit_logger_ != NULL;
317  }
bool is_logging()
Definition: log.h:311

References is_logging(), jit_logger_, and NULL.

Referenced by CodeCreateEvent(), CodeDeleteEvent(), CodeDisableOptEvent(), CodeMoveEvent(), CodeMovingGCEvent(), v8::internal::Isolate::Init(), v8::internal::Heap::OnMoveEvent(), v8::internal::RecordFunctionCompilation(), RegExpCodeCreateEvent(), and SharedFunctionInfoMoveEvent().

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

◆ LeaveExternal()

void v8::internal::Logger::LeaveExternal ( Isolate isolate)
static

Definition at line 946 of file log.cc.

946  {
948  DCHECK(isolate->current_vm_state() == EXTERNAL);
949  isolate->set_current_vm_state(JS);
950 }

References DCHECK, END, v8::internal::EXTERNAL, v8::internal::JS, LOG, name, and TimerEvent().

+ Here is the call graph for this function:

◆ LogAccessorCallbacks()

void v8::internal::Logger::LogAccessorCallbacks ( )

Definition at line 1765 of file log.cc.

1765  {
1766  Heap* heap = isolate_->heap();
1768  "Logger::LogAccessorCallbacks");
1769  HeapIterator iterator(heap);
1770  DisallowHeapAllocation no_gc;
1771  for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1772  if (!obj->IsExecutableAccessorInfo()) continue;
1773  ExecutableAccessorInfo* ai = ExecutableAccessorInfo::cast(obj);
1774  if (!ai->name()->IsName()) continue;
1775  Address getter_entry = v8::ToCData<Address>(ai->getter());
1776  Name* name = Name::cast(ai->name());
1777  if (getter_entry != 0) {
1778  PROFILE(isolate_, GetterCallbackEvent(name, getter_entry));
1779  }
1780  Address setter_entry = v8::ToCData<Address>(ai->setter());
1781  if (setter_entry != 0) {
1782  PROFILE(isolate_, SetterCallbackEvent(name, setter_entry));
1783  }
1784  }
1785 }
static const int kMakeHeapIterableMask
Definition: heap.h:721
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
Definition: heap.cc:724
void SetterCallbackEvent(Name *name, Address entry_point)
Definition: log.cc:1157
#define PROFILE(IsolateGetter, Call)
Definition: cpu-profiler.h:181
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
Definition: assert-scope.h:110
byte * Address
Definition: globals.h:101

References v8::internal::Heap::CollectAllGarbage(), GetterCallbackEvent(), v8::internal::Isolate::heap(), isolate_, v8::internal::Heap::kMakeHeapIterableMask, name, NULL, PROFILE, and SetterCallbackEvent().

Referenced by v8::internal::CpuProfiler::StartProcessorIfNotStarted().

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

◆ LogCodeObject()

void v8::internal::Logger::LogCodeObject ( Object code_object)
private

Definition at line 1627 of file log.cc.

1627  {
1628  Code* code_object = Code::cast(object);
1629  LogEventsAndTags tag = Logger::STUB_TAG;
1630  const char* description = "Unknown code from the snapshot";
1631  switch (code_object->kind()) {
1632  case Code::FUNCTION:
1633  case Code::OPTIMIZED_FUNCTION:
1634  return; // We log this later using LogCompiledFunctions.
1635  case Code::BINARY_OP_IC:
1636  case Code::COMPARE_IC: // fall through
1637  case Code::COMPARE_NIL_IC: // fall through
1638  case Code::TO_BOOLEAN_IC: // fall through
1639  case Code::STUB:
1640  description =
1641  CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true);
1642  if (description == NULL)
1643  description = "A stub from the snapshot";
1644  tag = Logger::STUB_TAG;
1645  break;
1646  case Code::REGEXP:
1647  description = "Regular expression code";
1648  tag = Logger::REG_EXP_TAG;
1649  break;
1650  case Code::BUILTIN:
1651  description = "A builtin from the snapshot";
1652  tag = Logger::BUILTIN_TAG;
1653  break;
1654  case Code::HANDLER:
1655  description = "An IC handler from the snapshot";
1656  tag = Logger::HANDLER_TAG;
1657  break;
1658  case Code::KEYED_LOAD_IC:
1659  description = "A keyed load IC from the snapshot";
1660  tag = Logger::KEYED_LOAD_IC_TAG;
1661  break;
1662  case Code::LOAD_IC:
1663  description = "A load IC from the snapshot";
1664  tag = Logger::LOAD_IC_TAG;
1665  break;
1666  case Code::CALL_IC:
1667  description = "A call IC from the snapshot";
1668  tag = Logger::CALL_IC_TAG;
1669  break;
1670  case Code::STORE_IC:
1671  description = "A store IC from the snapshot";
1672  tag = Logger::STORE_IC_TAG;
1673  break;
1674  case Code::KEYED_STORE_IC:
1675  description = "A keyed store IC from the snapshot";
1676  tag = Logger::KEYED_STORE_IC_TAG;
1677  break;
1678  case Code::NUMBER_OF_KINDS:
1679  break;
1680  }
1681  PROFILE(isolate_, CodeCreateEvent(tag, code_object, description));
1682 }
#define BUILTIN(name)
Definition: builtins.cc:122

References BUILTIN, CodeCreateEvent(), isolate_, v8::internal::Code::kind(), NULL, v8::internal::Code::NUMBER_OF_KINDS, PROFILE, and v8::internal::STUB.

Referenced by LogCodeObjects().

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

◆ LogCodeObjects()

void v8::internal::Logger::LogCodeObjects ( )

Definition at line 1685 of file log.cc.

1685  {
1686  Heap* heap = isolate_->heap();
1688  "Logger::LogCodeObjects");
1689  HeapIterator iterator(heap);
1690  DisallowHeapAllocation no_gc;
1691  for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
1692  if (obj->IsCode()) LogCodeObject(obj);
1693  }
1694 }
void LogCodeObject(Object *code_object)
Definition: log.cc:1627

References v8::internal::Heap::CollectAllGarbage(), v8::internal::Isolate::heap(), isolate_, v8::internal::Heap::kMakeHeapIterableMask, LogCodeObject(), and NULL.

Referenced by SetCodeEventHandler(), and v8::internal::CpuProfiler::StartProcessorIfNotStarted().

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

◆ LogCompiledFunctions()

void v8::internal::Logger::LogCompiledFunctions ( )

Definition at line 1745 of file log.cc.

1745  {
1746  Heap* heap = isolate_->heap();
1748  "Logger::LogCompiledFunctions");
1749  HandleScope scope(isolate_);
1750  const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL);
1751  ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
1752  ScopedVector< Handle<Code> > code_objects(compiled_funcs_count);
1753  EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start());
1754 
1755  // During iteration, there can be heap allocation due to
1756  // GetScriptLineNumber call.
1757  for (int i = 0; i < compiled_funcs_count; ++i) {
1758  if (code_objects[i].is_identical_to(isolate_->builtins()->CompileLazy()))
1759  continue;
1760  LogExistingFunction(sfis[i], code_objects[i]);
1761  }
1762 }
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
Definition: log.cc:1697
static int EnumerateCompiledFunctions(Heap *heap, Handle< SharedFunctionInfo > *sfis, Handle< Code > *code_objects)
Definition: log.cc:1592

References v8::internal::Isolate::builtins(), v8::internal::Heap::CollectAllGarbage(), v8::internal::EnumerateCompiledFunctions(), v8::internal::Isolate::heap(), isolate_, v8::internal::Heap::kMakeHeapIterableMask, LogExistingFunction(), NULL, and v8::internal::Vector< T >::start().

Referenced by SetCodeEventHandler(), and v8::internal::CpuProfiler::StartProcessorIfNotStarted().

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

◆ LogExistingFunction()

void v8::internal::Logger::LogExistingFunction ( Handle< SharedFunctionInfo shared,
Handle< Code code 
)

Definition at line 1697 of file log.cc.

1698  {
1699  Handle<String> func_name(shared->DebugName());
1700  if (shared->script()->IsScript()) {
1701  Handle<Script> script(Script::cast(shared->script()));
1702  int line_num = Script::GetLineNumber(script, shared->start_position()) + 1;
1703  int column_num =
1704  Script::GetColumnNumber(script, shared->start_position()) + 1;
1705  if (script->name()->IsString()) {
1706  Handle<String> script_name(String::cast(script->name()));
1707  if (line_num > 0) {
1708  PROFILE(isolate_,
1710  Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1711  *code, *shared, NULL,
1712  *script_name, line_num, column_num));
1713  } else {
1714  // Can't distinguish eval and script here, so always use Script.
1715  PROFILE(isolate_,
1717  Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
1718  *code, *shared, NULL, *script_name));
1719  }
1720  } else {
1721  PROFILE(isolate_,
1723  Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1724  *code, *shared, NULL,
1725  isolate_->heap()->empty_string(), line_num, column_num));
1726  }
1727  } else if (shared->IsApiFunction()) {
1728  // API function.
1729  FunctionTemplateInfo* fun_data = shared->get_api_func_data();
1730  Object* raw_call_data = fun_data->call_code();
1731  if (!raw_call_data->IsUndefined()) {
1732  CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data);
1733  Object* callback_obj = call_data->callback();
1734  Address entry_point = v8::ToCData<Address>(callback_obj);
1735  PROFILE(isolate_, CallbackEvent(*func_name, entry_point));
1736  }
1737  } else {
1738  PROFILE(isolate_,
1740  Logger::LAZY_COMPILE_TAG, *code, *shared, NULL, *func_name));
1741  }
1742 }
static int GetColumnNumber(Handle< Script > script, int code_pos)
Definition: objects.cc:9635
static int GetLineNumber(Handle< Script > script, int code_pos)
Definition: objects.cc:9673
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References CallbackEvent(), CodeCreateEvent(), v8::internal::Script::GetColumnNumber(), v8::internal::Script::GetLineNumber(), v8::internal::Isolate::heap(), isolate_, NULL, and PROFILE.

Referenced by LogCompiledFunctions().

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

◆ LogFailure()

void v8::internal::Logger::LogFailure ( )

Definition at line 1555 of file log.cc.

1555  {
1556  StopProfiler();
1557 }
void StopProfiler()
Definition: log.cc:1544

References StopProfiler().

+ Here is the call graph for this function:

◆ LogRegExpSource()

void v8::internal::Logger::LogRegExpSource ( Handle< JSRegExp regexp)
private

Definition at line 976 of file log.cc.

976  {
977  // Prints "/" + re.source + "/" +
978  // (re.global?"g":"") + (re.ignorecase?"i":"") + (re.multiline?"m":"")
979  Log::MessageBuilder msg(log_);
980 
981  Handle<Object> source = Object::GetProperty(
982  isolate_, regexp, "source").ToHandleChecked();
983  if (!source->IsString()) {
984  msg.Append("no source");
985  return;
986  }
987 
988  switch (regexp->TypeTag()) {
989  case JSRegExp::ATOM:
990  msg.Append('a');
991  break;
992  default:
993  break;
994  }
995  msg.Append('/');
996  msg.AppendDetailed(*Handle<String>::cast(source), false);
997  msg.Append('/');
998 
999  // global flag
1000  Handle<Object> global = Object::GetProperty(
1001  isolate_, regexp, "global").ToHandleChecked();
1002  if (global->IsTrue()) {
1003  msg.Append('g');
1004  }
1005  // ignorecase flag
1006  Handle<Object> ignorecase = Object::GetProperty(
1007  isolate_, regexp, "ignoreCase").ToHandleChecked();
1008  if (ignorecase->IsTrue()) {
1009  msg.Append('i');
1010  }
1011  // multiline flag
1012  Handle<Object> multiline = Object::GetProperty(
1013  isolate_, regexp, "multiline").ToHandleChecked();
1014  if (multiline->IsTrue()) {
1015  msg.Append('m');
1016  }
1017 
1018  msg.WriteToLogFile();
1019 }
static Handle< T > cast(Handle< S > that)
Definition: handles.h:116
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
Definition: objects.cc:109

References v8::internal::JSRegExp::ATOM, v8::internal::Object::GetProperty(), isolate_, and log_.

Referenced by RegExpCompileEvent().

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

◆ MoveEventInternal()

void v8::internal::Logger::MoveEventInternal ( LogEventsAndTags  event,
Address  from,
Address  to 
)
private

Definition at line 1422 of file log.cc.

1424  {
1425  if (!FLAG_log_code || !log_->IsEnabled()) return;
1426  Log::MessageBuilder msg(log_);
1427  msg.Append("%s,", kLogEventsNames[event]);
1428  msg.AppendAddress(from);
1429  msg.Append(',');
1430  msg.AppendAddress(to);
1431  msg.WriteToLogFile();
1432 }

References v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, log_, and to().

Referenced by CodeMoveEvent(), and SharedFunctionInfoMoveEvent().

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

◆ NewEvent()

void v8::internal::Logger::NewEvent ( const char *  name,
void *  object,
size_t  size 
)

Definition at line 1091 of file log.cc.

1091  {
1092  if (!log_->IsEnabled() || !FLAG_log) return;
1093  Log::MessageBuilder msg(log_);
1094  msg.Append("new,%s,0x%" V8PRIxPTR ",%u", name, object,
1095  static_cast<unsigned int>(size));
1096  msg.WriteToLogFile();
1097 }
enable harmony numeric enable harmony object literal extensions Optimize object size

References v8::internal::Log::IsEnabled(), log_, name, size, and V8PRIxPTR.

+ Here is the call graph for this function:

◆ NewEventStatic()

void v8::internal::Logger::NewEventStatic ( const char *  name,
void *  object,
size_t  size 
)
static

Definition at line 1108 of file log.cc.

1108  {
1109  Isolate::Current()->logger()->NewEvent(name, object, size);
1110 }

References name, and size.

◆ ProfilerBeginEvent()

void v8::internal::Logger::ProfilerBeginEvent ( )
private

Definition at line 803 of file log.cc.

803  {
804  if (!log_->IsEnabled()) return;
805  Log::MessageBuilder msg(log_);
806  msg.Append("profiler,\"begin\",%d", kSamplingIntervalMs);
807  msg.WriteToLogFile();
808 }
static const int kSamplingIntervalMs
Definition: log.h:341

References v8::internal::Log::IsEnabled(), kSamplingIntervalMs, and log_.

Referenced by v8::internal::Profiler::Engage().

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

◆ RegExpCodeCreateEvent()

void v8::internal::Logger::RegExpCodeCreateEvent ( Code code,
String source 
)

Definition at line 1321 of file log.cc.

1321  {
1322  PROFILER_LOG(RegExpCodeCreateEvent(code, source));
1323 
1324  if (!is_logging_code_events()) return;
1325  CALL_LISTENERS(RegExpCodeCreateEvent(code, source));
1326 
1327  if (!FLAG_log_code || !log_->IsEnabled()) return;
1328  Log::MessageBuilder msg(log_);
1329  AppendCodeCreateHeader(&msg, REG_EXP_TAG, code);
1330  msg.Append('"');
1331  msg.AppendDetailed(source, false);
1332  msg.Append('"');
1333  msg.WriteToLogFile();
1334 }
void RegExpCodeCreateEvent(Code *code, String *source)
Definition: log.cc:1321

References v8::internal::AppendCodeCreateHeader(), CALL_LISTENERS, is_logging_code_events(), v8::internal::Log::IsEnabled(), log_, and PROFILER_LOG.

+ Here is the call graph for this function:

◆ RegExpCompileEvent()

void v8::internal::Logger::RegExpCompileEvent ( Handle< JSRegExp regexp,
bool  in_cache 
)

Definition at line 1022 of file log.cc.

1022  {
1023  if (!log_->IsEnabled() || !FLAG_log_regexp) return;
1024  Log::MessageBuilder msg(log_);
1025  msg.Append("regexp-compile,");
1026  LogRegExpSource(regexp);
1027  msg.Append(in_cache ? ",hit" : ",miss");
1028  msg.WriteToLogFile();
1029 }
void LogRegExpSource(Handle< JSRegExp > regexp)
Definition: log.cc:976

References v8::internal::Log::IsEnabled(), log_, and LogRegExpSource().

+ Here is the call graph for this function:

◆ removeCodeEventListener()

void v8::internal::Logger::removeCodeEventListener ( CodeEventListener listener)

Definition at line 792 of file log.cc.

792  {
793  DCHECK(hasCodeEventListener(listener));
794  listeners_.RemoveElement(listener);
795 }

References DCHECK, hasCodeEventListener(), and listeners_.

Referenced by SetCodeEventHandler(), TearDown(), and v8::internal::CodeAddressMap::~CodeAddressMap().

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

◆ ResourceEvent()

void v8::internal::Logger::ResourceEvent ( const char *  name,
const char *  tag 
)

Definition at line 1435 of file log.cc.

1435  {
1436  if (!log_->IsEnabled() || !FLAG_log) return;
1437  Log::MessageBuilder msg(log_);
1438  msg.Append("%s,%s,", name, tag);
1439 
1440  uint32_t sec, usec;
1441  if (base::OS::GetUserTime(&sec, &usec) != -1) {
1442  msg.Append("%d,%d,", sec, usec);
1443  }
1444  msg.Append("%.0f", base::OS::TimeCurrentMillis());
1445  msg.WriteToLogFile();
1446 }
static int GetUserTime(uint32_t *secs, uint32_t *usecs)

References v8::base::OS::GetUserTime(), v8::internal::Log::IsEnabled(), log_, name, and v8::base::OS::TimeCurrentMillis().

+ Here is the call graph for this function:

◆ sampler()

Sampler * v8::internal::Logger::sampler ( )

Definition at line 1897 of file log.cc.

1897  {
1898  return ticker_;
1899 }

References ticker_.

Referenced by v8::internal::Isolate::Deinit(), and v8::internal::CpuProfiler::StartProcessorIfNotStarted().

+ Here is the caller graph for this function:

◆ SetCodeEventHandler()

void v8::internal::Logger::SetCodeEventHandler ( uint32_t  options,
JitCodeEventHandler  event_handler 
)

Definition at line 1877 of file log.cc.

1878  {
1879  if (jit_logger_) {
1881  delete jit_logger_;
1882  jit_logger_ = NULL;
1883  }
1884 
1885  if (event_handler) {
1886  jit_logger_ = new JitLogger(event_handler);
1888  if (options & kJitCodeEventEnumExisting) {
1889  HandleScope scope(isolate_);
1890  LogCodeObjects();
1892  }
1893  }
1894 }
void removeCodeEventListener(CodeEventListener *listener)
Definition: log.cc:792
void addCodeEventListener(CodeEventListener *listener)
Definition: log.cc:786
void LogCompiledFunctions()
Definition: log.cc:1745
void LogCodeObjects()
Definition: log.cc:1685
@ kJitCodeEventEnumExisting
Definition: v8.h:4336

References addCodeEventListener(), isolate_, jit_logger_, v8::kJitCodeEventEnumExisting, LogCodeObjects(), LogCompiledFunctions(), NULL, and removeCodeEventListener().

Referenced by v8::Isolate::New(), and v8::Isolate::SetJitCodeEventHandler().

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

◆ SetterCallbackEvent()

void v8::internal::Logger::SetterCallbackEvent ( Name name,
Address  entry_point 
)

Definition at line 1157 of file log.cc.

1157  {
1158  PROFILER_LOG(SetterCallbackEvent(name, entry_point));
1159  CallbackEventInternal("set ", name, entry_point);
1160 }

References CallbackEventInternal(), name, and PROFILER_LOG.

Referenced by LogAccessorCallbacks().

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

◆ SetUp()

bool v8::internal::Logger::SetUp ( Isolate isolate)

Definition at line 1829 of file log.cc.

1829  {
1830  // Tests and EnsureInitialize() can call this twice in a row. It's harmless.
1831  if (is_initialized_) return true;
1832  is_initialized_ = true;
1833 
1834  // --ll-prof implies --log-code and --log-snapshot-positions.
1835  if (FLAG_ll_prof) {
1836  FLAG_log_snapshot_positions = true;
1837  }
1838 
1839  OStringStream log_file_name;
1840  PrepareLogFileName(log_file_name, isolate, FLAG_logfile);
1841  log_->Initialize(log_file_name.c_str());
1842 
1843 
1844  if (FLAG_perf_basic_prof) {
1845  perf_basic_logger_ = new PerfBasicLogger();
1847  }
1848 
1849  if (FLAG_perf_jit_prof) {
1850  perf_jit_logger_ = new PerfJitLogger();
1852  }
1853 
1854  if (FLAG_ll_prof) {
1855  ll_logger_ = new LowLevelLogger(log_file_name.c_str());
1857  }
1858 
1859  ticker_ = new Ticker(isolate, kSamplingIntervalMs);
1860 
1861  if (Log::InitLogAtStart()) {
1862  is_logging_ = true;
1863  }
1864 
1865  if (FLAG_prof) {
1866  profiler_ = new Profiler(isolate);
1867  is_logging_ = true;
1868  profiler_->Engage();
1869  }
1870 
1871  if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start();
1872 
1873  return true;
1874 }
void Initialize(const char *log_file_name)
Definition: log-utils.cc:26
static bool InitLogAtStart()
Definition: log-utils.h:24
friend class Profiler
Definition: log.h:401
static void PrepareLogFileName(OStream &os, Isolate *isolate, const char *file_name)
Definition: log.cc:1794

References addCodeEventListener(), v8::internal::OStringStream::c_str(), v8::internal::Profiler::Engage(), v8::internal::Log::Initialize(), v8::internal::Log::InitLogAtStart(), is_initialized_, is_logging_, kSamplingIntervalMs, ll_logger_, log_, perf_basic_logger_, perf_jit_logger_, v8::internal::PrepareLogFileName(), Profiler, profiler_, ticker_, and timer_.

Referenced by v8::internal::Isolate::Init().

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

◆ SharedFunctionInfoMoveEvent()

void v8::internal::Logger::SharedFunctionInfoMoveEvent ( Address  from,
Address  to 
)

Definition at line 1414 of file log.cc.

1414  {
1416 
1417  if (!is_logging_code_events()) return;
1418  MoveEventInternal(SHARED_FUNC_MOVE_EVENT, from, to);
1419 }
void SharedFunctionInfoMoveEvent(Address from, Address to)
Definition: log.cc:1414

References is_logging_code_events(), MoveEventInternal(), PROFILER_LOG, and to().

+ Here is the call graph for this function:

◆ SharedLibraryEvent()

void v8::internal::Logger::SharedLibraryEvent ( const std::string &  library_path,
uintptr_t  start,
uintptr_t  end 
)

Definition at line 896 of file log.cc.

898  {
899  if (!log_->IsEnabled() || !FLAG_prof) return;
900  Log::MessageBuilder msg(log_);
901  msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR,
902  library_path.c_str(), start, end);
903  msg.WriteToLogFile();
904 }

References v8::internal::Log::IsEnabled(), log_, and V8PRIxPTR.

+ Here is the call graph for this function:

◆ SnapshotPositionEvent()

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

Definition at line 1402 of file log.cc.

1402  {
1403  if (!log_->IsEnabled()) return;
1404  LL_LOG(SnapshotPositionEvent(addr, pos));
1405  if (!FLAG_log_snapshot_positions) return;
1406  Log::MessageBuilder msg(log_);
1407  msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
1408  msg.AppendAddress(addr);
1409  msg.Append(",%d", pos);
1410  msg.WriteToLogFile();
1411 }
void SnapshotPositionEvent(Address addr, int pos)
Definition: log.cc:1402
#define LL_LOG(Call)
Definition: log.cc:295

References v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, LL_LOG, and log_.

+ Here is the call graph for this function:

◆ StopProfiler()

void v8::internal::Logger::StopProfiler ( )

Definition at line 1544 of file log.cc.

1544  {
1545  if (!log_->IsEnabled()) return;
1546  if (profiler_ != NULL) {
1547  profiler_->pause();
1548  is_logging_ = false;
1549  }
1550 }

References is_logging_, v8::internal::Log::IsEnabled(), log_, NULL, v8::internal::Profiler::pause(), and profiler_.

Referenced by LogFailure().

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

◆ StringEvent()

void v8::internal::Logger::StringEvent ( const char *  name,
const char *  value 
)

Definition at line 811 of file log.cc.

811  {
812  if (FLAG_log) UncheckedStringEvent(name, value);
813 }
void UncheckedStringEvent(const char *name, const char *value)
Definition: log.cc:816

References name, and UncheckedStringEvent().

+ Here is the call graph for this function:

◆ SuspectReadEvent()

void v8::internal::Logger::SuspectReadEvent ( Name name,
Object obj 
)

Definition at line 1449 of file log.cc.

1449  {
1450  if (!log_->IsEnabled() || !FLAG_log_suspect) return;
1451  Log::MessageBuilder msg(log_);
1452  String* class_name = obj->IsJSObject()
1453  ? JSObject::cast(obj)->class_name()
1454  : isolate_->heap()->empty_string();
1455  msg.Append("suspect-read,");
1456  msg.Append(class_name);
1457  msg.Append(',');
1458  if (name->IsString()) {
1459  msg.Append('"');
1460  msg.Append(String::cast(name));
1461  msg.Append('"');
1462  } else {
1463  msg.AppendSymbolName(Symbol::cast(name));
1464  }
1465  msg.WriteToLogFile();
1466 }

References v8::internal::Isolate::heap(), v8::internal::Log::IsEnabled(), isolate_, log_, and name.

+ Here is the call graph for this function:

◆ TearDown()

FILE * v8::internal::Logger::TearDown ( )

Definition at line 1902 of file log.cc.

1902  {
1903  if (!is_initialized_) return NULL;
1904  is_initialized_ = false;
1905 
1906  // Stop the profiler before closing the file.
1907  if (profiler_ != NULL) {
1908  profiler_->Disengage();
1909  delete profiler_;
1910  profiler_ = NULL;
1911  }
1912 
1913  delete ticker_;
1914  ticker_ = NULL;
1915 
1916  if (perf_basic_logger_) {
1918  delete perf_basic_logger_;
1920  }
1921 
1922  if (perf_jit_logger_) {
1924  delete perf_jit_logger_;
1926  }
1927 
1928  if (ll_logger_) {
1930  delete ll_logger_;
1931  ll_logger_ = NULL;
1932  }
1933 
1934  if (jit_logger_) {
1936  delete jit_logger_;
1937  jit_logger_ = NULL;
1938  }
1939 
1940  return log_->Close();
1941 }
FILE * Close()
Definition: log-utils.cc:74

References v8::internal::Log::Close(), v8::internal::Profiler::Disengage(), is_initialized_, jit_logger_, ll_logger_, log_, NULL, perf_basic_logger_, perf_jit_logger_, profiler_, removeCodeEventListener(), and ticker_.

Referenced by v8::internal::Isolate::Deinit().

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

◆ TickEvent()

void v8::internal::Logger::TickEvent ( TickSample sample,
bool  overflow 
)
private

Definition at line 1519 of file log.cc.

1519  {
1520  if (!log_->IsEnabled() || !FLAG_prof) return;
1521  Log::MessageBuilder msg(log_);
1522  msg.Append("%s,", kLogEventsNames[TICK_EVENT]);
1523  msg.AppendAddress(sample->pc);
1524  msg.Append(",%ld", static_cast<int>(timer_.Elapsed().InMicroseconds()));
1525  if (sample->has_external_callback) {
1526  msg.Append(",1,");
1527  msg.AppendAddress(sample->external_callback);
1528  } else {
1529  msg.Append(",0,");
1530  msg.AppendAddress(sample->tos);
1531  }
1532  msg.Append(",%d", static_cast<int>(sample->state));
1533  if (overflow) {
1534  msg.Append(",overflow");
1535  }
1536  for (unsigned i = 0; i < sample->frames_count; ++i) {
1537  msg.Append(',');
1538  msg.AppendAddress(sample->stack[i]);
1539  }
1540  msg.WriteToLogFile();
1541 }

References v8::internal::TickSample::external_callback, v8::internal::TickSample::frames_count, v8::internal::TickSample::has_external_callback, v8::internal::Log::IsEnabled(), v8::internal::kLogEventsNames, log_, v8::internal::overflow, v8::internal::TickSample::pc, v8::internal::TickSample::stack, v8::internal::TickSample::state, timer_, and v8::internal::TickSample::tos.

+ Here is the call graph for this function:

◆ TimerEvent()

void v8::internal::Logger::TimerEvent ( Logger::StartEnd  se,
const char *  name 
)

Definition at line 927 of file log.cc.

927  {
928  if (!log_->IsEnabled()) return;
929  DCHECK(FLAG_log_internal_timer_events);
930  Log::MessageBuilder msg(log_);
931  int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds());
932  const char* format = (se == START) ? "timer-event-start,\"%s\",%ld"
933  : "timer-event-end,\"%s\",%ld";
934  msg.Append(format, name, since_epoch);
935  msg.WriteToLogFile();
936 }

References DCHECK, v8::internal::Log::IsEnabled(), log_, name, START, and timer_.

Referenced by DefaultTimerEventsLogger(), EnterExternal(), and LeaveExternal().

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

◆ UncheckedIntEvent()

void v8::internal::Logger::UncheckedIntEvent ( const char *  name,
int  value 
)
private

Definition at line 834 of file log.cc.

834  {
835  if (!log_->IsEnabled()) return;
836  Log::MessageBuilder msg(log_);
837  msg.Append("%s,%d", name, value);
838  msg.WriteToLogFile();
839 }

References v8::internal::Log::IsEnabled(), log_, and name.

Referenced by IntEvent().

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

◆ UncheckedIntPtrTEvent()

void v8::internal::Logger::UncheckedIntPtrTEvent ( const char *  name,
intptr_t  value 
)
private

Definition at line 842 of file log.cc.

842  {
843  if (!log_->IsEnabled()) return;
844  Log::MessageBuilder msg(log_);
845  msg.Append("%s,%" V8_PTR_PREFIX "d", name, value);
846  msg.WriteToLogFile();
847 }
#define V8_PTR_PREFIX
Definition: macros.h:360

References v8::internal::Log::IsEnabled(), log_, name, and V8_PTR_PREFIX.

Referenced by IntPtrTEvent().

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

◆ UncheckedStringEvent()

void v8::internal::Logger::UncheckedStringEvent ( const char *  name,
const char *  value 
)
private

Definition at line 816 of file log.cc.

816  {
817  if (!log_->IsEnabled()) return;
818  Log::MessageBuilder msg(log_);
819  msg.Append("%s,\"%s\"", name, value);
820  msg.WriteToLogFile();
821 }

References v8::internal::Log::IsEnabled(), log_, and name.

Referenced by StringEvent().

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

Friends And Related Function Documentation

◆ CpuProfiler

friend class CpuProfiler
friend

Definition at line 419 of file log.h.

◆ EventLog

friend class EventLog
friend

Definition at line 398 of file log.h.

◆ Isolate

friend class Isolate
friend

Definition at line 399 of file log.h.

◆ LoggerTestHelper

friend class LoggerTestHelper
friend

Definition at line 403 of file log.h.

◆ Profiler

friend class Profiler
friend

Definition at line 401 of file log.h.

Referenced by SetUp().

◆ TimeLog

friend class TimeLog
friend

Definition at line 400 of file log.h.

◆ VMState

template<StateTag Tag>
friend class VMState
friend

Definition at line 402 of file log.h.

Member Data Documentation

◆ is_initialized_

bool v8::internal::Logger::is_initialized_
private

Definition at line 415 of file log.h.

Referenced by SetUp(), and TearDown().

◆ is_logging_

bool v8::internal::Logger::is_logging_
private

◆ isolate_

◆ jit_logger_

JitLogger* v8::internal::Logger::jit_logger_
private

◆ kSamplingIntervalMs

const int v8::internal::Logger::kSamplingIntervalMs = 1
static

Definition at line 341 of file log.h.

Referenced by ProfilerBeginEvent(), and SetUp().

◆ listeners_

List<CodeEventListener*> v8::internal::Logger::listeners_
private

Definition at line 411 of file log.h.

Referenced by addCodeEventListener(), hasCodeEventListener(), and removeCodeEventListener().

◆ ll_logger_

LowLevelLogger* v8::internal::Logger::ll_logger_
private

Definition at line 409 of file log.h.

Referenced by SetUp(), and TearDown().

◆ log_

◆ log_events_

const char* const* v8::internal::Logger::log_events_
private

Definition at line 394 of file log.h.

◆ perf_basic_logger_

PerfBasicLogger* v8::internal::Logger::perf_basic_logger_
private

Definition at line 407 of file log.h.

Referenced by SetUp(), and TearDown().

◆ perf_jit_logger_

PerfJitLogger* v8::internal::Logger::perf_jit_logger_
private

Definition at line 408 of file log.h.

Referenced by SetUp(), and TearDown().

◆ profiler_

Profiler* v8::internal::Logger::profiler_
private

Definition at line 391 of file log.h.

Referenced by SetUp(), StopProfiler(), and TearDown().

◆ ticker_

Ticker* v8::internal::Logger::ticker_
private

◆ timer_

base::ElapsedTimer v8::internal::Logger::timer_
private

Definition at line 417 of file log.h.

Referenced by CodeDeoptEvent(), CurrentTimeEvent(), SetUp(), TickEvent(), and TimerEvent().


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