50 #define DECLARE_EVENT(ignore1, name) name,
57 #define CALL_LISTENERS(Call) \
58 for (int i = 0; i < listeners_.length(); ++i) { \
59 listeners_[i]->Call; \
62 #define PROFILER_LOG(Call) \
64 CpuProfiler* cpu_profiler = isolate_->cpu_profiler(); \
65 if (cpu_profiler->is_profiling()) { \
71 static const char* ComputeMarker(Code*
code) {
72 switch (code->kind()) {
73 case Code::FUNCTION:
return code->optimizable() ?
"~" :
"";
74 case Code::OPTIMIZED_FUNCTION:
return "*";
95 if (name->IsString()) {
100 if (!symbol->name()->IsUndefined()) {
112 if (str ==
NULL)
return;
113 int uc16_length =
Min(str->
length(), kUtf16BufferSize);
116 for (
int i = 0; i < uc16_length && utf8_pos_ < kUtf8BufferSize; ++i) {
117 uc16 c = utf16_buffer[i];
119 utf8_buffer_[utf8_pos_++] =
static_cast<char>(c);
122 if (utf8_pos_ + char_length > kUtf8BufferSize)
break;
124 utf8_pos_ += char_length;
131 size =
Min(size, kUtf8BufferSize - utf8_pos_);
132 OS::MemCopy(utf8_buffer_ + utf8_pos_, bytes, size);
141 if (utf8_pos_ >= kUtf8BufferSize)
return;
142 utf8_buffer_[utf8_pos_++] = c;
147 kUtf8BufferSize - utf8_pos_);
149 if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
156 kUtf8BufferSize - utf8_pos_);
158 if (size > 0 && utf8_pos_ + size <= kUtf8BufferSize) {
163 const char*
get() {
return utf8_buffer_; }
164 int size()
const {
return utf8_pos_; }
167 static const int kUtf8BufferSize = 512;
168 static const int kUtf16BufferSize = 128;
171 char utf8_buffer_[kUtf8BufferSize];
172 uc16 utf16_buffer[kUtf16BufferSize];
183 const char* comment) {
184 name_buffer_->
Init(tag);
186 LogRecordedBuffer(code,
NULL, name_buffer_->
get(), name_buffer_->
size());
193 name_buffer_->
Init(tag);
195 LogRecordedBuffer(code,
NULL, name_buffer_->
get(), name_buffer_->
size());
204 name_buffer_->
Init(tag);
207 LogRecordedBuffer(code, shared, name_buffer_->
get(), name_buffer_->
size());
215 Name* source,
int line,
int column) {
216 name_buffer_->
Init(tag);
220 if (source->IsString()) {
229 LogRecordedBuffer(code, shared, name_buffer_->
get(), name_buffer_->
size());
236 name_buffer_->
Init(tag);
238 LogRecordedBuffer(code,
NULL, name_buffer_->
get(), name_buffer_->
size());
243 name_buffer_->
Init(Logger::REG_EXP_TAG);
245 LogRecordedBuffer(code,
NULL, name_buffer_->
get(), name_buffer_->
size());
259 virtual void LogRecordedBuffer(
Code*
code,
265 static const char kFilenameFormatString[];
266 static const int kFilenameBufferPadding;
270 static const int kLogBufferSize = 2 *
MB;
272 FILE* perf_output_handle_;
275 const char PerfBasicLogger::kFilenameFormatString[] =
"/tmp/perf-%d.map";
277 const int PerfBasicLogger::kFilenameBufferPadding = 16;
280 : perf_output_handle_(
NULL) {
282 int bufferSize =
sizeof(kFilenameFormatString) + kFilenameBufferPadding;
286 kFilenameFormatString,
291 setvbuf(perf_output_handle_,
NULL, _IOFBF, kLogBufferSize);
296 fclose(perf_output_handle_);
297 perf_output_handle_ =
NULL;
301 void PerfBasicLogger::LogRecordedBuffer(
Code*
code,
307 OS::FPrint(perf_output_handle_,
"%llx %x %.*s\n",
324 virtual void LogRecordedBuffer(
Code* code,
330 static const char kFilenameFormatString[];
331 static const int kFilenameBufferPadding;
335 static const int kLogBufferSize = 2 *
MB;
337 void LogWriteBytes(
const char* bytes,
int size);
338 void LogWriteHeader();
340 static const uint32_t kJitHeaderMagic = 0x4F74496A;
341 static const uint32_t kJitHeaderVersion = 0x2;
342 static const uint32_t kElfMachIA32 = 3;
343 static const uint32_t kElfMachX64 = 62;
344 static const uint32_t kElfMachARM = 40;
345 static const uint32_t kElfMachMIPS = 10;
357 enum jit_record_type {
366 struct jr_code_load {
376 uint32_t GetElfMach() {
377 #if V8_TARGET_ARCH_IA32
379 #elif V8_TARGET_ARCH_X64
381 #elif V8_TARGET_ARCH_ARM
383 #elif V8_TARGET_ARCH_MIPS
391 FILE* perf_output_handle_;
394 const char PerfJitLogger::kFilenameFormatString[] =
"/tmp/jit-%d.dump";
397 const int PerfJitLogger::kFilenameBufferPadding = 16;
400 : perf_output_handle_(
NULL) {
402 int bufferSize =
sizeof(kFilenameFormatString) + kFilenameBufferPadding;
406 kFilenameFormatString,
411 setvbuf(perf_output_handle_,
NULL, _IOFBF, kLogBufferSize);
418 fclose(perf_output_handle_);
419 perf_output_handle_ =
NULL;
423 void PerfJitLogger::LogRecordedBuffer(
Code* code,
430 const char* code_name =
name;
434 static const char string_terminator[] =
"\0";
436 jr_code_load code_load;
437 code_load.id = JIT_CODE_LOAD;
438 code_load.total_size =
sizeof(code_load) + length + 1 + code_size;
439 code_load.timestamp =
443 code_load.code_size = code_size;
446 LogWriteBytes(reinterpret_cast<const char*>(&code_load),
sizeof(code_load));
447 LogWriteBytes(code_name, length);
448 LogWriteBytes(string_terminator, 1);
449 LogWriteBytes(reinterpret_cast<const char*>(code_pointer), code_size);
453 void PerfJitLogger::LogWriteBytes(
const char* bytes,
int size) {
454 size_t rv = fwrite(bytes, 1, size, perf_output_handle_);
455 ASSERT(static_cast<size_t>(size) == rv);
460 void PerfJitLogger::LogWriteHeader() {
463 header.magic = kJitHeaderMagic;
464 header.version = kJitHeaderVersion;
465 header.total_size =
sizeof(jitheader);
466 header.pad1 = 0xdeadbeef;
467 header.elf_mach = GetElfMach();
470 LogWriteBytes(reinterpret_cast<const char*>(&header),
sizeof(header));
475 #define LL_LOG(Call) if (ll_logger_) ll_logger_->Call;
488 virtual void LogRecordedBuffer(
Code* code,
494 struct CodeCreateStruct {
495 static const char kTag =
'C';
503 struct CodeMoveStruct {
504 static const char kTag =
'M';
511 struct CodeDeleteStruct {
512 static const char kTag =
'D';
518 struct SnapshotPositionStruct {
519 static const char kTag =
'P';
526 static const char kCodeMovingGCTag =
'G';
530 static const char kLogExt[];
534 static const int kLogBufferSize = 2 *
MB;
537 void LogWriteBytes(
const char* bytes,
int size);
539 template <
typename T>
540 void LogWriteStruct(
const T& s) {
542 LogWriteBytes(reinterpret_cast<const char*>(&tag),
sizeof(tag));
543 LogWriteBytes(reinterpret_cast<const char*>(&s),
sizeof(s));
546 FILE* ll_output_handle_;
549 const char LowLevelLogger::kLogExt[] =
".ll";
552 : ll_output_handle_(
NULL) {
554 size_t len = strlen(name);
559 setvbuf(ll_output_handle_,
NULL, _IOFBF, kLogBufferSize);
566 fclose(ll_output_handle_);
567 ll_output_handle_ =
NULL;
571 void LowLevelLogger::LogCodeInfo() {
572 #if V8_TARGET_ARCH_IA32
573 const char arch[] =
"ia32";
574 #elif V8_TARGET_ARCH_X64
575 const char arch[] =
"x64";
576 #elif V8_TARGET_ARCH_ARM
577 const char arch[] =
"arm";
578 #elif V8_TARGET_ARCH_MIPS
579 const char arch[] =
"mips";
581 const char arch[] =
"unknown";
583 LogWriteBytes(arch,
sizeof(arch));
587 void LowLevelLogger::LogRecordedBuffer(Code* code,
591 CodeCreateStruct event;
592 event.name_size = length;
593 event.code_address = code->instruction_start();
595 event.code_size = code->instruction_size();
596 LogWriteStruct(event);
597 LogWriteBytes(name, length);
599 reinterpret_cast<const char*>(code->instruction_start()),
600 code->instruction_size());
605 CodeMoveStruct event;
608 LogWriteStruct(event);
613 CodeDeleteStruct event;
615 LogWriteStruct(event);
620 SnapshotPositionStruct event;
622 event.position = pos;
623 LogWriteStruct(event);
627 void LowLevelLogger::LogWriteBytes(
const char* bytes,
int size) {
628 size_t rv = fwrite(bytes, 1, size, ll_output_handle_);
629 ASSERT(static_cast<size_t>(size) == rv);
635 const char tag = kCodeMovingGCTag;
637 LogWriteBytes(&tag,
sizeof(tag));
641 #define JIT_LOG(Call) if (jit_logger_) jit_logger_->Call;
651 void* jit_handler_data,
660 virtual void LogRecordedBuffer(
Code* code,
670 : code_event_handler_(code_event_handler) {
674 void JitLogger::LogRecordedBuffer(
Code* code,
679 memset(&event, 0,
sizeof(event));
684 if (shared && shared->script()->IsScript()) {
687 event.script = ToApiHandle<v8::Script>(script_handle);
688 event.name.str =
name;
689 event.name.len = length;
690 code_event_handler_(&event);
703 const size_t header_size =
707 event.new_code_start =
710 code_event_handler_(&event);
722 code_event_handler_(&event);
726 void* jit_handler_data,
731 memset(&event, 0,
sizeof(event));
733 event.user_data = jit_handler_data;
734 event.line_info.offset = pc_offset;
735 event.line_info.pos = position;
736 event.line_info.position_type = position_type;
738 code_event_handler_(&event);
744 memset(&event, 0,
sizeof(event));
747 code_event_handler_(&event);
748 return event.user_data;
754 memset(&event, 0,
sizeof(event));
757 event.user_data = jit_handler_data;
759 code_event_handler_(&event);
779 if (Succ(head_) == tail_) {
784 buffer_semaphore_.Signal();
797 buffer_semaphore_.Wait();
798 *sample = buffer_[tail_];
799 bool result = overflow_;
806 int Succ(
int index) {
return (index + 1) % kBufferSize; }
811 static const int kBufferSize = 128;
812 TickSample buffer_[kBufferSize];
817 Semaphore buffer_semaphore_;
843 if (profiler_) profiler_->
Insert(sample);
873 buffer_semaphore_(0),
881 if (engaged_)
return;
894 logger->ProfilerBeginEvent();
899 if (!engaged_)
return;
914 LOG(isolate_, UncheckedStringEvent(
"profiler",
"end"));
922 LOG(isolate_, TickEvent(&sample, overflow));
923 overflow = Remove(&sample);
932 Logger::Logger(
Isolate* isolate)
939 perf_basic_logger_(
NULL),
940 perf_jit_logger_(
NULL),
944 is_initialized_(
false) {
955 listeners_.Add(listener);
961 listeners_.RemoveElement(listener);
966 return listeners_.Contains(listener);
970 void Logger::ProfilerBeginEvent() {
972 Log::MessageBuilder msg(log_);
974 msg.WriteToLogFile();
979 if (FLAG_log) UncheckedStringEvent(name, value);
983 void Logger::UncheckedStringEvent(
const char* name,
const char* value) {
985 Log::MessageBuilder msg(log_);
986 msg.Append(
"%s,\"%s\"\n", name, value);
987 msg.WriteToLogFile();
992 if (FLAG_log) UncheckedIntEvent(name, value);
997 if (FLAG_log) UncheckedIntPtrTEvent(name, value);
1001 void Logger::UncheckedIntEvent(
const char* name,
int value) {
1003 Log::MessageBuilder msg(log_);
1004 msg.Append(
"%s,%d\n", name, value);
1005 msg.WriteToLogFile();
1009 void Logger::UncheckedIntPtrTEvent(
const char* name, intptr_t value) {
1011 Log::MessageBuilder msg(log_);
1013 msg.WriteToLogFile();
1018 if (!log_->
IsEnabled() || !FLAG_log_handles)
return;
1019 Log::MessageBuilder msg(log_);
1020 msg.Append(
"%s,0x%" V8PRIxPTR "\n", name, location);
1021 msg.WriteToLogFile();
1028 void Logger::ApiEvent(
const char* format, ...) {
1030 Log::MessageBuilder msg(log_);
1032 va_start(ap, format);
1033 msg.AppendVA(format, ap);
1035 msg.WriteToLogFile();
1040 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1041 if (key->IsString()) {
1044 ApiEvent(
"api,check-security,\"%s\"\n", str.
get());
1045 }
else if (key->IsSymbol()) {
1047 if (symbol->name()->IsUndefined()) {
1048 ApiEvent(
"api,check-security,symbol(hash %x)\n",
1053 ApiEvent(
"api,check-security,symbol(\"%s\" hash %x)\n",
1057 }
else if (key->IsUndefined()) {
1058 ApiEvent(
"api,check-security,undefined\n");
1060 ApiEvent(
"api,check-security,['no-name']\n");
1068 if (!log_->
IsEnabled() || !FLAG_prof)
return;
1069 Log::MessageBuilder msg(log_);
1074 msg.WriteToLogFile();
1081 if (!log_->
IsEnabled() || !FLAG_prof)
return;
1082 Log::MessageBuilder msg(log_);
1087 msg.WriteToLogFile();
1093 ASSERT(FLAG_log_internal_timer_events);
1094 Log::MessageBuilder msg(log_);
1095 int since_epoch =
static_cast<int>(timer_.Elapsed().InMicroseconds());
1096 msg.Append(
"code-deopt,%ld,%d\n", since_epoch, code->
CodeSize());
1097 msg.WriteToLogFile();
1103 ASSERT(FLAG_log_internal_timer_events);
1104 Log::MessageBuilder msg(log_);
1105 int since_epoch =
static_cast<int>(timer_.Elapsed().InMicroseconds());
1106 const char* format = (se ==
START) ?
"timer-event-start,\"%s\",%ld\n"
1107 :
"timer-event-end,\"%s\",%ld\n";
1108 msg.Append(format, name, since_epoch);
1109 msg.WriteToLogFile();
1115 ASSERT(isolate->current_vm_state() ==
JS);
1116 isolate->set_current_vm_state(
EXTERNAL);
1123 isolate->set_current_vm_state(
JS);
1128 Isolate* isolate = Isolate::Current();
1134 isolate_->event_logger()(name_, se);
1139 "V8.RecompileSynchronous";
1141 "V8.RecompileConcurrent";
1143 "V8.CompileFullCode";
1151 Log::MessageBuilder msg(log_);
1155 msg.Append(
"no source");
1159 switch (regexp->TypeTag()) {
1176 Handle<Object> ignorecase =
GetProperty(regexp,
"ignoreCase");
1177 if (ignorecase->IsTrue()) {
1181 Handle<Object> multiline =
GetProperty(regexp,
"multiline");
1182 if (multiline->IsTrue()) {
1186 msg.WriteToLogFile();
1191 if (!log_->
IsEnabled() || !FLAG_log_regexp)
return;
1192 Log::MessageBuilder msg(log_);
1193 msg.Append(
"regexp-compile,");
1194 LogRegExpSource(regexp);
1195 msg.Append(in_cache ?
",hit\n" :
",miss\n");
1196 msg.WriteToLogFile();
1202 if (!log_->
IsEnabled() || !FLAG_log_runtime)
return;
1203 Log::MessageBuilder msg(log_);
1204 for (
int i = 0; i < format.
length(); i++) {
1206 if (c ==
'%' && i <= format.
length() - 2) {
1208 ASSERT(
'0' <= format[i] && format[i] <=
'9');
1213 switch (format[i]) {
1237 msg.WriteToLogFile();
1242 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1243 ApiEvent(
"api,check-security,%u\n", index);
1251 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1255 if (name->IsString()) {
1258 ApiEvent(
"api,%s,\"%s\",\"%s\"\n", tag, class_name.
get(),
1259 property_name.
get());
1262 uint32_t hash = symbol->
Hash();
1263 if (symbol->name()->IsUndefined()) {
1264 ApiEvent(
"api,%s,\"%s\",symbol(hash %x)\n", tag, class_name.
get(), hash);
1268 ApiEvent(
"api,%s,\"%s\",symbol(\"%s\" hash %x)\n",
1269 tag, class_name.
get(), str.
get(), hash);
1277 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1281 ApiEvent(
"api,%s,\"%s\",%u\n", tag, class_name.
get(), index);
1286 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1287 String* class_name_obj =
object->class_name();
1290 ApiEvent(
"api,%s,\"%s\"\n", tag, class_name.
get());
1295 if (!log_->
IsEnabled() || !FLAG_log_api)
return;
1296 ApiEvent(
"api,%s\n", name);
1301 if (!log_->
IsEnabled() || !FLAG_log)
return;
1302 Log::MessageBuilder msg(log_);
1303 msg.Append(
"new,%s,0x%" V8PRIxPTR ",%u\n", name,
object,
1304 static_cast<unsigned int>(size));
1305 msg.WriteToLogFile();
1310 if (!log_->
IsEnabled() || !FLAG_log)
return;
1311 Log::MessageBuilder msg(log_);
1312 msg.Append(
"delete,%s,0x%" V8PRIxPTR "\n", name,
object);
1313 msg.WriteToLogFile();
1318 Isolate::Current()->logger()->NewEvent(name,
object, size);
1323 Isolate::Current()->logger()->DeleteEvent(name,
object);
1327 void Logger::CallbackEventInternal(
const char* prefix,
Name* name,
1329 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1330 Log::MessageBuilder msg(log_);
1331 msg.Append(
"%s,%s,-2,",
1332 kLogEventsNames[CODE_CREATION_EVENT],
1333 kLogEventsNames[CALLBACK_TAG]);
1334 msg.AppendAddress(entry_point);
1335 if (name->IsString()) {
1338 msg.Append(
",1,\"%s%s\"", prefix, str.
get());
1342 msg.Append(
",1,symbol(hash %x)", prefix, symbol->Hash());
1346 msg.Append(
",1,symbol(\"%s\" hash %x)", prefix, str.get(),
1351 msg.WriteToLogFile();
1357 CallbackEventInternal(
"", name, entry_point);
1363 CallbackEventInternal(
"get ", name, entry_point);
1369 CallbackEventInternal(
"set ", name, entry_point);
1373 static void AppendCodeCreateHeader(Log::MessageBuilder* msg,
1377 msg->Append(
"%s,%s,%d,",
1378 kLogEventsNames[Logger::CODE_CREATION_EVENT],
1379 kLogEventsNames[tag],
1381 msg->AppendAddress(code->
address());
1388 const char* comment) {
1394 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1395 Log::MessageBuilder msg(log_);
1396 AppendCodeCreateHeader(&msg, tag, code);
1397 msg.AppendDoubleQuotedString(comment);
1399 msg.WriteToLogFile();
1411 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1412 Log::MessageBuilder msg(log_);
1413 AppendCodeCreateHeader(&msg, tag, code);
1414 if (name->IsString()) {
1422 msg.WriteToLogFile();
1436 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1437 if (code == isolate_->
builtins()->
builtin(Builtins::kCompileUnoptimized))
1440 Log::MessageBuilder msg(log_);
1441 AppendCodeCreateHeader(&msg, tag, code);
1442 if (name->IsString()) {
1445 msg.Append(
"\"%s\"", str.
get());
1450 msg.AppendAddress(shared->
address());
1451 msg.Append(
",%s", ComputeMarker(code));
1453 msg.WriteToLogFile();
1464 Name* source,
int line,
int column) {
1471 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1472 Log::MessageBuilder msg(log_);
1473 AppendCodeCreateHeader(&msg, tag, code);
1476 msg.Append(
"\"%s ", name.
get());
1477 if (source->IsString()) {
1480 msg.Append(
"%s", sourcestr.
get());
1484 msg.Append(
":%d:%d\",", line, column);
1485 msg.AppendAddress(shared->
address());
1486 msg.Append(
",%s", ComputeMarker(code));
1488 msg.WriteToLogFile();
1500 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1501 Log::MessageBuilder msg(log_);
1502 AppendCodeCreateHeader(&msg, tag, code);
1503 msg.Append(
"\"args_count: %d\"", args_count);
1505 msg.WriteToLogFile();
1513 if (!log_->
IsEnabled() || !FLAG_ll_prof)
return;
1525 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1526 Log::MessageBuilder msg(log_);
1527 AppendCodeCreateHeader(&msg, REG_EXP_TAG, code);
1529 msg.AppendDetailed(source,
false);
1532 msg.WriteToLogFile();
1541 MoveEventInternal(CODE_MOVE_EVENT, from, to);
1551 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1552 Log::MessageBuilder msg(log_);
1553 msg.Append(
"%s,", kLogEventsNames[CODE_DELETE_EVENT]);
1554 msg.AppendAddress(from);
1556 msg.WriteToLogFile();
1563 JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1573 JIT_LOG(AddCodeLinePosInfoEvent(jit_handler_data,
1581 if (jit_logger_ !=
NULL) {
1588 void* jit_handler_data) {
1589 JIT_LOG(EndCodePosInfoEvent(code, jit_handler_data));
1594 if (code_name ==
NULL)
return;
1595 Log::MessageBuilder msg(log_);
1596 msg.Append(
"%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos);
1597 msg.AppendDoubleQuotedString(code_name);
1599 msg.WriteToLogFile();
1606 if (!FLAG_log_snapshot_positions)
return;
1607 Log::MessageBuilder msg(log_);
1608 msg.Append(
"%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
1609 msg.AppendAddress(addr);
1610 msg.Append(
",%d", pos);
1612 msg.WriteToLogFile();
1620 MoveEventInternal(SHARED_FUNC_MOVE_EVENT, from, to);
1627 if (!FLAG_log_code || !log_->
IsEnabled())
return;
1628 Log::MessageBuilder msg(log_);
1629 msg.Append(
"%s,", kLogEventsNames[event]);
1630 msg.AppendAddress(from);
1632 msg.AppendAddress(to);
1634 msg.WriteToLogFile();
1639 if (!log_->
IsEnabled() || !FLAG_log)
return;
1640 Log::MessageBuilder msg(log_);
1641 msg.Append(
"%s,%s,", name, tag);
1645 msg.Append(
"%d,%d,", sec, usec);
1650 msg.WriteToLogFile();
1655 if (!log_->
IsEnabled() || !FLAG_log_suspect)
return;
1656 Log::MessageBuilder msg(log_);
1657 String* class_name = obj->IsJSObject()
1659 : isolate_->
heap()->empty_string();
1660 msg.Append(
"suspect-read,");
1661 msg.Append(class_name);
1663 if (name->IsString()) {
1671 msg.WriteToLogFile();
1676 if (!log_->
IsEnabled() || !FLAG_log_gc)
return;
1677 Log::MessageBuilder msg(log_);
1680 msg.Append(
"heap-sample-begin,\"%s\",\"%s\",%.0f\n",
1682 msg.WriteToLogFile();
1687 if (!log_->
IsEnabled() || !FLAG_log_gc)
return;
1688 Log::MessageBuilder msg(log_);
1689 msg.Append(
"heap-sample-end,\"%s\",\"%s\"\n", space, kind);
1690 msg.WriteToLogFile();
1695 if (!log_->
IsEnabled() || !FLAG_log_gc)
return;
1696 Log::MessageBuilder msg(log_);
1697 msg.Append(
"heap-sample-item,%s,%d,%d\n", type, number, bytes);
1698 msg.WriteToLogFile();
1703 if (!log_->
IsEnabled() || !FLAG_log)
return;
1704 Log::MessageBuilder msg(log_);
1705 msg.Append(
"debug-tag,%s\n", call_site_tag);
1706 msg.WriteToLogFile();
1711 if (!log_->
IsEnabled() || !FLAG_log)
return;
1713 for (
int i = 0; i < parameter.
length(); ++i) {
1716 char* parameter_string = s.Finalize();
1717 Log::MessageBuilder msg(log_);
1718 msg.Append(
"debug-queue-event,%s,%15.3f,%s\n",
1723 msg.WriteToLogFile();
1728 if (!log_->
IsEnabled() || !FLAG_prof)
return;
1729 Log::MessageBuilder msg(log_);
1730 msg.Append(
"%s,", kLogEventsNames[TICK_EVENT]);
1731 msg.AppendAddress(sample->
pc);
1732 msg.Append(
",%ld", static_cast<int>(timer_.Elapsed().InMicroseconds()));
1738 msg.AppendAddress(sample->
tos);
1740 msg.Append(
",%d", static_cast<int>(sample->
state));
1742 msg.Append(
",overflow");
1746 msg.AppendAddress(sample->
stack[i]);
1749 msg.WriteToLogFile();
1755 if (profiler_ !=
NULL) {
1757 is_logging_ =
false;
1774 : sfis_(sfis), code_objects_(code_objects), count_(count) { }
1781 Object* maybe_script = sfi->script();
1782 if (maybe_script->IsScript()
1784 if (sfis_ !=
NULL) {
1787 if (code_objects_ !=
NULL) {
1788 ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION);
1789 code_objects_[*count_] =
Handle<Code>(
function->code());
1791 *count_ = *count_ + 1;
1801 static int EnumerateCompiledFunctions(Heap* heap,
1804 HeapIterator iterator(heap);
1806 int compiled_funcs_count = 0;
1810 for (HeapObject*
obj = iterator.next();
obj !=
NULL;
obj = iterator.next()) {
1811 if (!
obj->IsSharedFunctionInfo())
continue;
1813 if (sfi->is_compiled()
1814 && (!sfi->script()->IsScript()
1819 if (code_objects !=
NULL) {
1820 code_objects[compiled_funcs_count] = Handle<Code>(sfi->code());
1822 ++compiled_funcs_count;
1827 EnumerateOptimizedFunctionsVisitor visitor(sfis,
1829 &compiled_funcs_count);
1832 return compiled_funcs_count;
1836 void Logger::LogCodeObject(
Object*
object) {
1839 const char* description =
"Unknown code from the snapshot";
1840 switch (code_object->kind()) {
1841 case Code::FUNCTION:
1842 case Code::OPTIMIZED_FUNCTION:
1844 case Code::BINARY_OP_IC:
1845 case Code::COMPARE_IC:
1846 case Code::COMPARE_NIL_IC:
1847 case Code::TO_BOOLEAN_IC:
1850 CodeStub::MajorName(CodeStub::GetMajorKey(code_object),
true);
1851 if (description ==
NULL)
1852 description =
"A stub from the snapshot";
1853 tag = Logger::STUB_TAG;
1856 description =
"Regular expression code";
1857 tag = Logger::REG_EXP_TAG;
1860 description =
"A builtin from the snapshot";
1861 tag = Logger::BUILTIN_TAG;
1864 description =
"An IC handler from the snapshot";
1865 tag = Logger::HANDLER_TAG;
1867 case Code::KEYED_LOAD_IC:
1868 description =
"A keyed load IC from the snapshot";
1869 tag = Logger::KEYED_LOAD_IC_TAG;
1872 description =
"A load IC from the snapshot";
1873 tag = Logger::LOAD_IC_TAG;
1875 case Code::STORE_IC:
1876 description =
"A store IC from the snapshot";
1877 tag = Logger::STORE_IC_TAG;
1879 case Code::KEYED_STORE_IC:
1880 description =
"A keyed store IC from the snapshot";
1881 tag = Logger::KEYED_STORE_IC_TAG;
1893 "Logger::LogCodeObjects");
1894 HeapIterator iterator(heap);
1897 if (
obj->IsCode()) LogCodeObject(
obj);
1905 if (shared->script()->IsScript()) {
1910 if (script->name()->IsString()) {
1915 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1916 *code, *shared,
NULL,
1917 *script_name, line_num, column_num));
1922 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script),
1923 *code, *shared,
NULL, *script_name));
1928 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script),
1929 *code, *shared,
NULL,
1930 isolate_->
heap()->empty_string(), line_num, column_num));
1932 }
else if (shared->IsApiFunction()) {
1935 Object* raw_call_data = fun_data->call_code();
1936 if (!raw_call_data->IsUndefined()) {
1938 Object* callback_obj = call_data->callback();
1939 Address entry_point = v8::ToCData<Address>(callback_obj);
1945 Logger::LAZY_COMPILE_TAG, *code, *shared,
NULL, *func_name));
1953 "Logger::LogCompiledFunctions");
1955 const int compiled_funcs_count = EnumerateCompiledFunctions(heap,
NULL,
NULL);
1958 EnumerateCompiledFunctions(heap, sfis.
start(), code_objects.
start());
1962 for (
int i = 0; i < compiled_funcs_count; ++i) {
1963 if (code_objects[i].is_identical_to(
1964 isolate_->
builtins()->CompileUnoptimized()))
1974 "Logger::LogAccessorCallbacks");
1975 HeapIterator iterator(heap);
1978 if (!
obj->IsExecutableAccessorInfo())
continue;
1980 if (!ai->name()->IsName())
continue;
1981 Address getter_entry = v8::ToCData<Address>(ai->getter());
1983 if (getter_entry != 0) {
1986 Address setter_entry = v8::ToCData<Address>(ai->setter());
1987 if (setter_entry != 0) {
1996 stream->
Add(
"isolate-%p-", isolate);
2000 static SmartArrayPointer<const char> PrepareLogFileName(
2001 Isolate* isolate,
const char* file_name) {
2002 if (strchr(file_name,
'%') !=
NULL || !isolate->IsDefaultIsolate()) {
2005 HeapStringAllocator allocator;
2006 StringStream stream(&allocator);
2007 AddIsolateIdIfNeeded(isolate, &stream);
2008 for (
const char* p = file_name; *p; p++) {
2023 stream.
Add(
"%.0f", FmtElm(time));
2040 return SmartArrayPointer<const char>(stream.
ToCString());
2043 char* str = NewArray<char>(length + 1);
2046 return SmartArrayPointer<const char>(str);
2052 if (is_initialized_)
return true;
2053 is_initialized_ =
true;
2057 FLAG_log_snapshot_positions =
true;
2061 PrepareLogFileName(isolate, FLAG_logfile);
2065 if (FLAG_perf_basic_prof) {
2070 if (FLAG_perf_jit_prof) {
2092 if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start();
2106 if (event_handler) {
2107 jit_logger_ =
new JitLogger(event_handler);
2124 if (!is_initialized_)
return NULL;
2125 is_initialized_ =
false;
2128 if (profiler_ !=
NULL) {
2137 if (perf_basic_logger_) {
2139 delete perf_basic_logger_;
2140 perf_basic_logger_ =
NULL;
2143 if (perf_jit_logger_) {
2145 delete perf_jit_logger_;
2146 perf_jit_logger_ =
NULL;
2161 return log_->
Close();
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static void LogInternalEvents(const char *name, int se)
virtual void CodeMoveEvent(Address from, Address to)
Code * builtin(Name name)
static void NewEventStatic(const char *name, void *object, size_t size)
void RegExpCodeCreateEvent(Code *code, String *source)
void EndCodePosInfoEvent(Code *code, void *jit_handler_data)
static CallHandlerInfo * cast(Object *obj)
static const char * v8_recompile_concurrent
const char * ToCString(const v8::String::Utf8Value &value)
void CodeMoveEvent(Address from, Address to)
#define PROFILE(IsolateGetter, Call)
virtual void VisitFunction(JSFunction *function)
#define CALL_LISTENERS(Call)
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
static void LogSharedLibraryAddresses(Isolate *isolate)
static ExecutableAccessorInfo * cast(Object *obj)
static String * cast(Object *obj)
static void EnterExternal(Isolate *isolate)
void CallbackEvent(Name *name, Address entry_point)
#define LOG(isolate, Call)
static void DeleteEventStatic(const char *name, void *object)
static void SignalCodeMovingGC()
void GetterCallbackEvent(Name *name, Address entry_point)
virtual void CodeDeleteEvent(Address from)
Address external_callback
void DecreaseProfilingDepth()
kSerializedDataOffset Object
virtual void Tick(TickSample *sample)
bool is_logging_code_events()
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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 expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage including on console Map counters to a file Enable debugger compile events enable GDBJIT enable GDBJIT interface for all code objects dump only objects containing this substring stress the GC compactor to flush out pretty print source code print source AST function name where to insert a breakpoint print scopes for builtins trace contexts operations print stuff during garbage collection report code statistics after GC report handles after GC trace cache state transitions print interface inference details prints when objects are turned into dictionaries report heap spill statistics along with trace isolate state changes trace regexp bytecode execution Minimal Log all events to the log file Log API events to the log file Log heap samples on garbage collection for the hp2ps tool log positions Log suspect operations Used with turns on browser compatible mode for profiling v8 Specify the name of the log file Enable low level linux profiler Enable perf linux profiler(experimental annotate support).") DEFINE_string(gc_fake_mmap
static int GetUserTime(uint32_t *secs, uint32_t *usecs)
void LogCompiledFunctions()
void CodeDeleteEvent(Address from)
void CodeNameEvent(Address addr, int pos, const char *code_name)
static Handle< Object > GetElementNoExceptionThrown(Isolate *isolate, Handle< Object > object, uint32_t index)
static bool InitLogAtStart()
void SetProfiler(Profiler *profiler)
void IntPtrTEvent(const char *name, intptr_t value)
virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, Code *code, const char *comment)
#define ASSERT(condition)
static Script * cast(Object *obj)
virtual void CodeDeleteEvent(Address from)
bool has_external_callback
static SharedFunctionInfo * cast(Object *obj)
void ApiNamedSecurityCheck(Object *key)
int GetScriptColumnNumber(Handle< Script > script, int code_pos)
void LogTimerEvent(StartEnd se)
Handle< Object > GetProperty(Handle< JSReceiver > obj, const char *name)
virtual void CodeDeleteEvent(Address from)
void HandleEvent(const char *name, Object **location)
static Code * cast(Object *obj)
void Init(Logger::LogEventsAndTags tag)
bool IsDefaultIsolate() const
static Symbol * cast(Object *obj)
static Smi * cast(Object *object)
void ApiIndexedSecurityCheck(uint32_t index)
void CodeStartLinePosInfoRecordEvent(PositionsRecorder *pos_recorder)
void SnapshotPositionEvent(Address addr, int pos)
void Add(Vector< const char > format, Vector< FmtElm > elms)
static void VisitAllOptimizedFunctions(Isolate *isolate, OptimizedFunctionVisitor *visitor)
void CodeDeoptEvent(Code *code)
#define PROFILER_LOG(Call)
SmartArrayPointer< char > ToCString(AllowNullsFlag allow_nulls, RobustnessFlag robustness_flag, int offset, int length, int *length_output=0)
void HeapSampleBeginEvent(const char *space, const char *kind)
void CodeLinePosInfoAddPositionEvent(void *jit_handler_data, int pc_offset, int position)
virtual void CodeMoveEvent(Address from, Address to)
static uchar Length(uchar chr, int previous)
virtual void SnapshotPositionEvent(Address addr, int pos)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
void addCodeEventListener(CodeEventListener *listener)
LowLevelLogger(const char *file_name)
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
void AppendHex(uint32_t n)
static const char * v8_external
void Insert(TickSample *sample)
void IncreaseProfilingDepth()
static void MemCopy(void *dest, const void *src, size_t size)
void CodeEndLinePosInfoRecordEvent(Code *code, void *jit_handler_data)
byte * instruction_start()
void AppendName(Name *name)
virtual void EnterContext(Context *context)
Profiler(Isolate *isolate)
bool SetUp(Isolate *isolate)
static FILE * FOpen(const char *path, const char *mode)
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
virtual void CodeDeleteEvent(Address from)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
void RegExpCompileEvent(Handle< JSRegExp > regexp, bool in_cache)
static int GetCurrentProcessId()
void * StartCodePosInfoEvent()
static double TimeCurrentMillis()
virtual void AddCodeLinePosInfoEvent(void *jit_handler_data, int pc_offset, int position, JitCodeEvent::PositionType position_type)
static const int kMakeHeapIterableMask
Address stack[kMaxFramesCount]
void LogRuntime(Vector< const char > format, Handle< JSArray > args)
Ticker(Isolate *isolate, int interval)
virtual void LeaveContext(Context *context)
virtual ~CodeEventLogger()
void SuspectReadEvent(Name *name, Object *obj)
static unsigned Encode(char *out, uchar c, int previous, bool replace_invalid=false)
V8_INLINE bool IsUndefined() const
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
#define CHECK_NE(unexpected, value)
int StrLength(const char *string)
#define T(name, string, precedence)
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
void SharedLibraryEvent(const char *library_path, uintptr_t start, uintptr_t end)
static const char * v8_execute
V8_INLINE bool IsString() const
void ApiEntryCall(const char *name)
void(* JitCodeEventHandler)(const JitCodeEvent *event)
static int SNPrintF(Vector< char > str, const char *format,...)
bool hasCodeEventListener(CodeEventListener *listener)
void HeapSampleEndEvent(const char *space, const char *kind)
void AppendBytes(const char *bytes)
int GetScriptLineNumber(Handle< Script > script, int code_pos)
#define DECLARE_EVENT(ignore1, name)
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
EnumerateOptimizedFunctionsVisitor(Handle< SharedFunctionInfo > *sfis, Handle< Code > *code_objects, int *count)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
void AddCharacter(char c)
void HeapSampleItemEvent(const char *type, int number, int bytes)
void DeleteEvent(const char *name, void *object)
virtual void RegExpCodeCreateEvent(Code *code, String *source)
static const char * v8_recompile_synchronous
virtual ~PerfBasicLogger()
void ApiObjectAccess(const char *tag, JSObject *obj)
static const int kHeaderSize
void CodeLinePosInfoAddStatementPositionEvent(void *jit_handler_data, int pc_offset, int position)
static void LeaveExternal(Isolate *isolate)
static const int kSamplingIntervalMs
JitLogger(JitCodeEventHandler code_event_handler)
static const char * v8_compile_full_code
static HeapObject * FromAddress(Address address)
PerThreadAssertScopeDebugOnly< HEAP_ALLOCATION_ASSERT, false > DisallowHeapAllocation
static const unsigned kMaxOneByteChar
void SharedFunctionInfoMoveEvent(Address from, Address to)
virtual void CodeMoveEvent(Address from, Address to)
void IntEvent(const char *name, int value)
void LogAccessorCallbacks()
void AppendString(String *str)
static Name * cast(Object *obj)
void Initialize(const char *log_file_name)
static void FPrint(FILE *out, const char *format,...)
void removeCodeEventListener(CodeEventListener *listener)
SmartArrayPointer< const char > ToCString() const
virtual ~LowLevelLogger()
void DeleteArray(T *array)
void AppendBytes(const char *bytes, int size)
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
void DebugTag(const char *call_site_tag)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV 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 expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
static const char *const LogFileOpenMode
void ResourceEvent(const char *name, const char *tag)
static JSObject * cast(Object *obj)
void NewEvent(const char *name, void *object, size_t size)
virtual void CodeMovingGCEvent()
static const int kNoPreviousCharacter
#define LOG_EVENTS_AND_TAGS_LIST(V)
void TimerEvent(StartEnd se, const char *name)
virtual void CodeMoveEvent(Address from, Address to)
void StringEvent(const char *name, const char *value)
void SetterCallbackEvent(Name *name, Address entry_point)
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)