29 #define DECLARE_EVENT(ignore1, name) name,
36 #define CALL_LISTENERS(Call) \
37 for (int i = 0; i < listeners_.length(); ++i) { \
38 listeners_[i]->Call; \
41 #define PROFILER_LOG(Call) \
43 CpuProfiler* cpu_profiler = isolate_->cpu_profiler(); \
44 if (cpu_profiler->is_profiling()) { \
51 switch (code->
kind()) {
52 case Code::FUNCTION:
return code->
optimizable() ?
"~" :
"";
53 case Code::OPTIMIZED_FUNCTION:
return "*";
74 if (
name->IsString()) {
79 if (!symbol->name()->IsUndefined()) {
91 if (str ==
NULL)
return;
162 const char* comment) {
194 Name* source,
int line,
int column) {
199 if (source->IsString()) {
260 : perf_output_handle_(
NULL) {
295 #define LL_LOG(Call) if (ll_logger_) ll_logger_->Call;
360 template <
typename T>
363 LogWriteBytes(
reinterpret_cast<const char*
>(&tag),
sizeof(tag));
373 : ll_output_handle_(
NULL) {
375 size_t len = strlen(
name);
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";
409 const char arch[] =
"unknown";
450 event.position = pos;
469 #define JIT_LOG(Call) if (jit_logger_) jit_logger_->Call;
480 void* jit_handler_data,
499 : code_event_handler_(code_event_handler) {
508 memset(&event, 0,
sizeof(event));
513 if (shared && shared->script()->IsScript()) {
516 event.script = ToApiHandle<v8::UnboundScript>(shared_function_handle);
517 event.name.str =
name;
518 event.name.len = length;
532 const size_t header_size =
536 event.new_code_start =
555 void* jit_handler_data,
560 memset(&event, 0,
sizeof(event));
562 event.user_data = jit_handler_data;
563 event.line_info.offset = pc_offset;
564 event.line_info.pos = position;
565 event.line_info.position_type = position_type;
573 memset(&event, 0,
sizeof(event));
577 return event.user_data;
583 memset(&event, 0,
sizeof(event));
586 event.user_data = jit_handler_data;
697 : base::Thread(
Options(
"v8:Profiler")),
702 buffer_semaphore_(0),
712 std::vector<base::OS::SharedLibraryAddress> addresses =
714 for (
size_t i = 0;
i < addresses.size(); ++
i) {
716 addresses[
i].library_path, addresses[
i].start, addresses[
i].end));
747 LOG(
isolate_, UncheckedStringEvent(
"profiler",
"end"));
772 perf_basic_logger_(
NULL),
773 perf_jit_logger_(
NULL),
777 is_initialized_(
false) {
805 Log::MessageBuilder msg(
log_);
807 msg.WriteToLogFile();
818 Log::MessageBuilder msg(
log_);
819 msg.Append(
"%s,\"%s\"",
name, value);
820 msg.WriteToLogFile();
836 Log::MessageBuilder msg(
log_);
837 msg.Append(
"%s,%d",
name, value);
838 msg.WriteToLogFile();
844 Log::MessageBuilder msg(
log_);
846 msg.WriteToLogFile();
852 Log::MessageBuilder msg(
log_);
854 msg.WriteToLogFile();
863 Log::MessageBuilder msg(
log_);
865 va_start(ap, format);
866 msg.AppendVA(format, ap);
868 msg.WriteToLogFile();
874 if (key->IsString()) {
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());
885 ApiEvent(
"api,check-security,symbol(\"%s\" hash %x)", str.
get(),
886 Symbol::cast(key)->Hash());
888 }
else if (key->IsUndefined()) {
889 ApiEvent(
"api,check-security,undefined");
891 ApiEvent(
"api,check-security,['no-name']");
900 Log::MessageBuilder msg(
log_);
902 library_path.c_str(), start, end);
903 msg.WriteToLogFile();
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();
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();
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();
941 DCHECK(isolate->current_vm_state() ==
JS);
942 isolate->set_current_vm_state(
EXTERNAL);
949 isolate->set_current_vm_state(
JS);
954 Isolate* isolate = Isolate::Current();
959 template <
class TimerEvent>
961 if (TimerEvent::expose_to_api() ||
969 #define V(TimerName, expose) \
970 template void TimerEventScope<TimerEvent##TimerName>::LogTimerEvent( \
971 Logger::StartEnd se);
979 Log::MessageBuilder msg(
log_);
982 isolate_, regexp,
"source").ToHandleChecked();
983 if (!source->IsString()) {
984 msg.Append(
"no source");
988 switch (regexp->TypeTag()) {
1001 isolate_, regexp,
"global").ToHandleChecked();
1002 if (global->IsTrue()) {
1007 isolate_, regexp,
"ignoreCase").ToHandleChecked();
1008 if (ignorecase->IsTrue()) {
1013 isolate_, regexp,
"multiline").ToHandleChecked();
1014 if (multiline->IsTrue()) {
1018 msg.WriteToLogFile();
1024 Log::MessageBuilder msg(
log_);
1025 msg.Append(
"regexp-compile,");
1027 msg.Append(in_cache ?
",hit" :
",miss");
1028 msg.WriteToLogFile();
1034 ApiEvent(
"api,check-security,%u", index);
1046 if (
name->IsString()) {
1049 ApiEvent(
"api,%s,\"%s\",\"%s\"", tag, class_name.
get(),
1050 property_name.
get());
1054 if (symbol->name()->IsUndefined()) {
1055 ApiEvent(
"api,%s,\"%s\",symbol(hash %x)", tag, class_name.
get(), hash);
1059 ApiEvent(
"api,%s,\"%s\",symbol(\"%s\" hash %x)", tag, class_name.
get(),
1072 ApiEvent(
"api,%s,\"%s\",%u", tag, class_name.
get(), index);
1078 String* class_name_obj =
object->class_name();
1093 Log::MessageBuilder msg(
log_);
1095 static_cast<unsigned int>(
size));
1096 msg.WriteToLogFile();
1102 Log::MessageBuilder msg(
log_);
1104 msg.WriteToLogFile();
1109 Isolate::Current()->logger()->NewEvent(
name,
object,
size);
1114 Isolate::Current()->logger()->DeleteEvent(
name,
object);
1121 Log::MessageBuilder msg(
log_);
1122 msg.Append(
"%s,%s,-2,",
1125 msg.AppendAddress(entry_point);
1126 if (
name->IsString()) {
1129 msg.Append(
",1,\"%s%s\"", prefix, str.
get());
1132 if (symbol->name()->IsUndefined()) {
1133 msg.Append(
",1,symbol(hash %x)", prefix, symbol->
Hash());
1137 msg.Append(
",1,symbol(\"%s\" hash %x)", prefix, str.
get(),
1141 msg.WriteToLogFile();
1167 msg->Append(
"%s,%s,%d,",
1171 msg->AppendAddress(code->
address());
1178 const char* comment) {
1185 Log::MessageBuilder msg(
log_);
1187 msg.AppendDoubleQuotedString(comment);
1188 msg.WriteToLogFile();
1201 Log::MessageBuilder msg(
log_);
1203 if (
name->IsString()) {
1205 msg.AppendDetailed(String::cast(
name),
false);
1208 msg.AppendSymbolName(Symbol::cast(
name));
1210 msg.WriteToLogFile();
1227 Log::MessageBuilder msg(
log_);
1229 if (
name->IsString()) {
1232 msg.Append(
"\"%s\"", str.
get());
1234 msg.AppendSymbolName(Symbol::cast(
name));
1237 msg.AppendAddress(shared->
address());
1239 msg.WriteToLogFile();
1250 Name* source,
int line,
int column) {
1258 Log::MessageBuilder msg(
log_);
1262 msg.Append(
"\"%s ",
name.get());
1263 if (source->IsString()) {
1266 msg.Append(
"%s", sourcestr.
get());
1268 msg.AppendSymbolName(Symbol::cast(source));
1270 msg.Append(
":%d:%d\",", line, column);
1271 msg.AppendAddress(shared->
address());
1273 msg.WriteToLogFile();
1286 Log::MessageBuilder msg(
log_);
1288 msg.Append(
"\"args_count: %d\"", args_count);
1289 msg.WriteToLogFile();
1301 Log::MessageBuilder msg(
log_);
1305 msg.Append(
"\"%s\",",
name.get());
1307 msg.WriteToLogFile();
1328 Log::MessageBuilder msg(
log_);
1331 msg.AppendDetailed(source,
false);
1333 msg.WriteToLogFile();
1353 Log::MessageBuilder msg(
log_);
1355 msg.AppendAddress(from);
1356 msg.WriteToLogFile();
1363 JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1373 JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1388 void* jit_handler_data) {
1389 JIT_LOG(EndCodePosInfoEvent(code, jit_handler_data));
1394 if (code_name ==
NULL)
return;
1395 Log::MessageBuilder msg(
log_);
1397 msg.AppendDoubleQuotedString(code_name);
1398 msg.WriteToLogFile();
1405 if (!FLAG_log_snapshot_positions)
return;
1406 Log::MessageBuilder msg(
log_);
1408 msg.AppendAddress(addr);
1409 msg.Append(
",%d", pos);
1410 msg.WriteToLogFile();
1426 Log::MessageBuilder msg(
log_);
1428 msg.AppendAddress(from);
1430 msg.AppendAddress(
to);
1431 msg.WriteToLogFile();
1437 Log::MessageBuilder msg(
log_);
1438 msg.Append(
"%s,%s,",
name, tag);
1442 msg.Append(
"%d,%d,", sec, usec);
1445 msg.WriteToLogFile();
1451 Log::MessageBuilder msg(
log_);
1452 String* class_name = obj->IsJSObject()
1453 ? JSObject::cast(obj)->class_name()
1455 msg.Append(
"suspect-read,");
1456 msg.Append(class_name);
1458 if (
name->IsString()) {
1460 msg.Append(String::cast(
name));
1463 msg.AppendSymbolName(Symbol::cast(
name));
1465 msg.WriteToLogFile();
1471 Log::MessageBuilder msg(
log_);
1474 msg.Append(
"heap-sample-begin,\"%s\",\"%s\",%.0f",
space, kind,
1476 msg.WriteToLogFile();
1482 Log::MessageBuilder msg(
log_);
1483 msg.Append(
"heap-sample-end,\"%s\",\"%s\"",
space, kind);
1484 msg.WriteToLogFile();
1490 Log::MessageBuilder msg(
log_);
1491 msg.Append(
"heap-sample-item,%s,%d,%d", type, number, bytes);
1492 msg.WriteToLogFile();
1498 Log::MessageBuilder msg(
log_);
1499 msg.Append(
"debug-tag,%s", call_site_tag);
1500 msg.WriteToLogFile();
1507 for (
int i = 0;
i < parameter.
length(); ++
i) {
1510 char* parameter_string = s.
Finalize();
1511 Log::MessageBuilder msg(
log_);
1512 msg.Append(
"debug-queue-event,%s,%15.3f,%s", event_type,
1515 msg.WriteToLogFile();
1521 Log::MessageBuilder msg(
log_);
1523 msg.AppendAddress(sample->
pc);
1524 msg.Append(
",%ld",
static_cast<int>(
timer_.Elapsed().InMicroseconds()));
1530 msg.AppendAddress(sample->
tos);
1532 msg.Append(
",%d",
static_cast<int>(sample->
state));
1534 msg.Append(
",overflow");
1538 msg.AppendAddress(sample->
stack[
i]);
1540 msg.WriteToLogFile();
1572 Object* maybe_script = sfi->script();
1573 if (maybe_script->IsScript()
1574 && !Script::cast(maybe_script)->HasValidSource())
return;
1579 DCHECK(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
1595 HeapIterator iterator(heap);
1597 int compiled_funcs_count = 0;
1601 for (
HeapObject* obj = iterator.next(); obj !=
NULL; obj = iterator.next()) {
1602 if (!obj->IsSharedFunctionInfo())
continue;
1605 && (!sfi->script()->IsScript()
1606 || Script::cast(sfi->script())->HasValidSource())) {
1610 if (code_objects !=
NULL) {
1611 code_objects[compiled_funcs_count] =
Handle<Code>(sfi->code());
1613 ++compiled_funcs_count;
1620 &compiled_funcs_count);
1623 return compiled_funcs_count;
1628 Code* code_object = Code::cast(
object);
1630 const char* description =
"Unknown code from the snapshot";
1631 switch (code_object->
kind()) {
1632 case Code::FUNCTION:
1633 case Code::OPTIMIZED_FUNCTION:
1635 case Code::BINARY_OP_IC:
1636 case Code::COMPARE_IC:
1637 case Code::COMPARE_NIL_IC:
1638 case Code::TO_BOOLEAN_IC:
1641 CodeStub::MajorName(CodeStub::GetMajorKey(code_object),
true);
1642 if (description ==
NULL)
1643 description =
"A stub from the snapshot";
1644 tag = Logger::STUB_TAG;
1647 description =
"Regular expression code";
1648 tag = Logger::REG_EXP_TAG;
1651 description =
"A builtin from the snapshot";
1652 tag = Logger::BUILTIN_TAG;
1655 description =
"An IC handler from the snapshot";
1656 tag = Logger::HANDLER_TAG;
1658 case Code::KEYED_LOAD_IC:
1659 description =
"A keyed load IC from the snapshot";
1660 tag = Logger::KEYED_LOAD_IC_TAG;
1663 description =
"A load IC from the snapshot";
1664 tag = Logger::LOAD_IC_TAG;
1667 description =
"A call IC from the snapshot";
1668 tag = Logger::CALL_IC_TAG;
1670 case Code::STORE_IC:
1671 description =
"A store IC from the snapshot";
1672 tag = Logger::STORE_IC_TAG;
1674 case Code::KEYED_STORE_IC:
1675 description =
"A keyed store IC from the snapshot";
1676 tag = Logger::KEYED_STORE_IC_TAG;
1688 "Logger::LogCodeObjects");
1689 HeapIterator iterator(heap);
1691 for (
HeapObject* obj = iterator.next(); obj !=
NULL; obj = iterator.next()) {
1700 if (shared->script()->IsScript()) {
1705 if (script->name()->IsString()) {
1710 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1711 *code, *shared,
NULL,
1712 *script_name, line_num, column_num));
1717 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
1718 *code, *shared,
NULL, *script_name));
1723 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1724 *code, *shared,
NULL,
1725 isolate_->
heap()->empty_string(), line_num, column_num));
1727 }
else if (shared->IsApiFunction()) {
1730 Object* raw_call_data = fun_data->call_code();
1731 if (!raw_call_data->IsUndefined()) {
1733 Object* callback_obj = call_data->callback();
1734 Address entry_point = v8::ToCData<Address>(callback_obj);
1740 Logger::LAZY_COMPILE_TAG, *code, *shared,
NULL, *func_name));
1748 "Logger::LogCompiledFunctions");
1757 for (
int i = 0;
i < compiled_funcs_count; ++
i) {
1768 "Logger::LogAccessorCallbacks");
1769 HeapIterator iterator(heap);
1771 for (
HeapObject* obj = iterator.next(); obj !=
NULL; obj = iterator.next()) {
1772 if (!obj->IsExecutableAccessorInfo())
continue;
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) {
1780 Address setter_entry = v8::ToCData<Address>(ai->setter());
1781 if (setter_entry != 0) {
1790 if (FLAG_logfile_per_isolate) os <<
"isolate-" << isolate <<
"-";
1795 Isolate* isolate,
const char* file_name) {
1797 for (
const char* p = file_name; *p; p++) {
1836 FLAG_log_snapshot_positions =
true;
1844 if (FLAG_perf_basic_prof) {
1849 if (FLAG_perf_jit_prof) {
1871 if (FLAG_log_internal_timer_events || FLAG_prof)
timer_.Start();
1885 if (event_handler) {
static const int kNoPreviousCharacter
static const unsigned kMaxOneByteChar
static uchar Length(uchar chr, int previous)
static unsigned Encode(char *out, uchar c, int previous, bool replace_invalid=false)
static void SignalCodeMovingGC()
static const char *const LogFileOpenMode
static FILE * FOpen(const char *path, const char *mode)
static int GetCurrentProcessId()
static std::vector< SharedLibraryAddress > GetSharedLibraryAddresses()
static int GetUserTime(uint32_t *secs, uint32_t *usecs)
static double TimeCurrentMillis()
static void FPrint(FILE *out, const char *format,...)
Code * builtin(Name name)
void Init(Logger::LogEventsAndTags tag)
void AppendName(Name *name)
void AppendBytes(const char *bytes)
char utf8_buffer_[kUtf8BufferSize]
void AppendHex(uint32_t n)
uc16 utf16_buffer[kUtf16BufferSize]
void AppendString(String *str)
static const int kUtf8BufferSize
static const int kUtf16BufferSize
void AppendBytes(const char *bytes, int size)
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)
virtual ~CodeEventLogger()
virtual void LogRecordedBuffer(Code *code, SharedFunctionInfo *shared, const char *name, int length)=0
virtual void RegExpCodeCreateEvent(Code *code, String *source)
NameBuffer * name_buffer_
int instruction_size() const
byte * instruction_start()
static const int kHeaderSize
static void VisitAllOptimizedFunctions(Isolate *isolate, OptimizedFunctionVisitor *visitor)
virtual void LeaveContext(Context *context)
virtual void VisitFunction(JSFunction *function)
Handle< Code > * code_objects_
virtual void EnterContext(Context *context)
EnumerateOptimizedFunctionsVisitor(Handle< SharedFunctionInfo > *sfis, Handle< Code > *code_objects, int *count)
Handle< SharedFunctionInfo > * sfis_
static HeapObject * FromAddress(Address address)
static const int kMakeHeapIterableMask
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
virtual void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
virtual void LogRecordedBuffer(Code *code, SharedFunctionInfo *shared, const char *name, int length)
virtual void CodeDeleteEvent(Address from)
JitCodeEventHandler code_event_handler_
void EndCodePosInfoEvent(Code *code, void *jit_handler_data)
virtual void CodeMoveEvent(Address from, Address to)
void * StartCodePosInfoEvent()
JitLogger(JitCodeEventHandler code_event_handler)
virtual void AddCodeLinePosInfoEvent(void *jit_handler_data, int pc_offset, int position, JitCodeEvent::PositionType position_type)
void Initialize(const char *log_file_name)
static bool InitLogAtStart()
void SharedLibraryEvent(const std::string &library_path, uintptr_t start, uintptr_t end)
void ApiNamedSecurityCheck(Object *key)
void removeCodeEventListener(CodeEventListener *listener)
void CodeEndLinePosInfoRecordEvent(Code *code, void *jit_handler_data)
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
void UncheckedIntPtrTEvent(const char *name, intptr_t value)
void ApiEntryCall(const char *name)
void DeleteEvent(const char *name, void *object)
static void DeleteEventStatic(const char *name, void *object)
void IntEvent(const char *name, int value)
void GetterCallbackEvent(Name *name, Address entry_point)
void HeapSampleItemEvent(const char *type, int number, int bytes)
void CodeNameEvent(Address addr, int pos, const char *code_name)
void RegExpCodeCreateEvent(Code *code, String *source)
bool is_logging_code_events()
void SetterCallbackEvent(Name *name, Address entry_point)
void NewEvent(const char *name, void *object, size_t size)
PerfJitLogger * perf_jit_logger_
void LogAccessorCallbacks()
void addCodeEventListener(CodeEventListener *listener)
void ProfilerBeginEvent()
void SharedFunctionInfoMoveEvent(Address from, Address to)
bool SetUp(Isolate *isolate)
void CodeLinePosInfoAddPositionEvent(void *jit_handler_data, int pc_offset, int position)
void CodeDeoptEvent(Code *code)
void CodeLinePosInfoAddStatementPositionEvent(void *jit_handler_data, int pc_offset, int position)
void UncheckedIntEvent(const char *name, int value)
static void LeaveExternal(Isolate *isolate)
static void DefaultTimerEventsLogger(const char *name, int se)
void ResourceEvent(const char *name, const char *tag)
void ApiEvent(const char *name,...)
void LogCompiledFunctions()
bool hasCodeEventListener(CodeEventListener *listener)
void MoveEventInternal(LogEventsAndTags event, Address from, Address to)
void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
void SuspectReadEvent(Name *name, Object *obj)
void LogRegExpSource(Handle< JSRegExp > regexp)
static void EnterExternal(Isolate *isolate)
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
void CodeDeleteEvent(Address from)
PerfBasicLogger * perf_basic_logger_
static void NewEventStatic(const char *name, void *object, size_t size)
void TimerEvent(StartEnd se, const char *name)
void HandleEvent(const char *name, Object **location)
LowLevelLogger * ll_logger_
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
void StringEvent(const char *name, const char *value)
void CallbackEventInternal(const char *prefix, Name *name, Address entry_point)
void UncheckedStringEvent(const char *name, const char *value)
void SnapshotPositionEvent(Address addr, int pos)
base::ElapsedTimer timer_
void CodeStartLinePosInfoRecordEvent(PositionsRecorder *pos_recorder)
void RegExpCompileEvent(Handle< JSRegExp > regexp, bool in_cache)
void HeapSampleEndEvent(const char *space, const char *kind)
void CallbackEvent(Name *name, Address entry_point)
void CodeMoveEvent(Address from, Address to)
void ApiIndexedSecurityCheck(uint32_t index)
void ApiObjectAccess(const char *tag, JSObject *obj)
void TickEvent(TickSample *sample, bool overflow)
List< CodeEventListener * > listeners_
void IntPtrTEvent(const char *name, intptr_t value)
static const int kSamplingIntervalMs
void DebugTag(const char *call_site_tag)
void HeapSampleBeginEvent(const char *space, const char *kind)
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
void LogCodeObject(Object *code_object)
static const char kLogExt[]
static const char kCodeMovingGCTag
static const int kLogBufferSize
virtual ~LowLevelLogger()
virtual void CodeMovingGCEvent()
virtual void SnapshotPositionEvent(Address addr, int pos)
virtual void LogRecordedBuffer(Code *code, SharedFunctionInfo *shared, const char *name, int length)
virtual void CodeDeleteEvent(Address from)
void LogWriteStruct(const T &s)
virtual void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
LowLevelLogger(const char *file_name)
void LogWriteBytes(const char *bytes, int size)
virtual void CodeMoveEvent(Address from, Address to)
const char * c_str() const
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
virtual void CodeDeleteEvent(Address from)
static const int kLogBufferSize
virtual ~PerfBasicLogger()
FILE * perf_output_handle_
static const char kFilenameFormatString[]
virtual void CodeMoveEvent(Address from, Address to)
virtual void LogRecordedBuffer(Code *code, SharedFunctionInfo *shared, const char *name, int length)
virtual void CodeDisableOptEvent(Code *code, SharedFunctionInfo *shared)
static const int kFilenameBufferPadding
static const int kBufferSize
Profiler(Isolate *isolate)
base::Semaphore buffer_semaphore_
TickSample buffer_[kBufferSize]
void Insert(TickSample *sample)
bool Remove(TickSample *sample)
void DecreaseProfilingDepth()
void IncreaseProfilingDepth()
Isolate * isolate() const
static int GetColumnNumber(Handle< Script > script, int code_pos)
static int GetLineNumber(Handle< Script > script, int code_pos)
BailoutReason DisableOptimizationReason()
void AddCharacter(char c)
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
SmartArrayPointer< char > ToCString(AllowNullsFlag allow_nulls, RobustnessFlag robustness_flag, int offset, int length, int *length_output=0)
Ticker(Isolate *isolate, int interval)
virtual void Tick(TickSample *sample)
void SetProfiler(Profiler *profiler)
void LogTimerEvent(Logger::StartEnd se)
#define PROFILE(IsolateGetter, Call)
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 A file to write the raw context snapshot bytes Write V8 startup blob Print the time it takes to lazily compile hydrogen code stubs dump only objects containing this substring stress the GC compactor to flush out pretty print source code for builtins print C code to recreate TurboFan graphs report heap spill statistics along with enable possessive quantifier syntax for testing Minimal Log code events to the log file without profiling log positions Log statistical profiling Used with turns on browser compatible mode for profiling Enable perf linux profiler(experimental annotate support).") DEFINE_STRING(gc_fake_mmap
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
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in 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 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)
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
#define PROFILER_LOG(Call)
#define DECLARE_EVENT(ignore1, name)
#define CALL_LISTENERS(Call)
#define LOG(isolate, Call)
#define TIMER_EVENTS_LIST(V)
#define LOG_EVENTS_AND_TAGS_LIST(V)
#define CHECK_NE(unexpected, value)
#define DCHECK(condition)
static const char * ComputeMarker(Code *code)
void DeleteArray(T *array)
static void PrepareLogFileName(OStream &os, Isolate *isolate, const char *file_name)
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
static void AddIsolateIdIfNeeded(OStream &os, Isolate *isolate)
int SNPrintF(Vector< char > str, const char *format,...)
@ ROBUST_STRING_TRAVERSAL
static int EnumerateCompiledFunctions(Heap *heap, Handle< SharedFunctionInfo > *sfis, Handle< Code > *code_objects)
const char * GetBailoutReason(BailoutReason reason)
static uint32_t Hash(RegisteredExtension *extension)
static void AppendCodeCreateHeader(Log::MessageBuilder *msg, Logger::LogEventsAndTags tag, Code *code)
static const char *const kLogEventsNames[Logger::NUMBER_OF_LOG_EVENTS]
int StrLength(const char *string)
void MemCopy(void *dest, const void *src, size_t size)
Debugger support for the V8 JavaScript engine.
@ kJitCodeEventEnumExisting
void(* JitCodeEventHandler)(const JitCodeEvent *event)
Callback function passed to SetJitCodeEventHandler.
A JIT code event is issued each time code is added, moved or removed.
@ CODE_END_LINE_INFO_RECORDING
@ CODE_START_LINE_INFO_RECORDING
Address external_callback
Address stack[kMaxFramesCount]
bool has_external_callback
#define T(name, string, precedence)