OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include <stdarg.h> | 28 #include <stdarg.h> |
29 | 29 |
30 #include "v8.h" | 30 #include "v8.h" |
31 | 31 |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
| 34 #include "cpu-profiler.h" |
34 #include "deoptimizer.h" | 35 #include "deoptimizer.h" |
35 #include "global-handles.h" | 36 #include "global-handles.h" |
36 #include "log.h" | 37 #include "log.h" |
37 #include "macro-assembler.h" | 38 #include "macro-assembler.h" |
38 #include "platform.h" | 39 #include "platform.h" |
39 #include "runtime-profiler.h" | 40 #include "runtime-profiler.h" |
40 #include "serialize.h" | 41 #include "serialize.h" |
41 #include "string-stream.h" | 42 #include "string-stream.h" |
42 #include "vm-state-inl.h" | 43 #include "vm-state-inl.h" |
43 | 44 |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 memset(&event, 0, sizeof(event)); | 484 memset(&event, 0, sizeof(event)); |
484 event.type = JitCodeEvent::CODE_ADD_LINE_POS_INFO; | 485 event.type = JitCodeEvent::CODE_ADD_LINE_POS_INFO; |
485 event.user_data = jit_handler_data; | 486 event.user_data = jit_handler_data; |
486 event.line_info.offset = pc_offset; | 487 event.line_info.offset = pc_offset; |
487 event.line_info.pos = position; | 488 event.line_info.pos = position; |
488 event.line_info.position_type = position_type; | 489 event.line_info.position_type = position_type; |
489 | 490 |
490 code_event_handler_(&event); | 491 code_event_handler_(&event); |
491 } | 492 } |
492 | 493 |
| 494 |
493 void* Logger::IssueStartCodePosInfoEvent() { | 495 void* Logger::IssueStartCodePosInfoEvent() { |
494 JitCodeEvent event; | 496 JitCodeEvent event; |
495 memset(&event, 0, sizeof(event)); | 497 memset(&event, 0, sizeof(event)); |
496 event.type = JitCodeEvent::CODE_START_LINE_INFO_RECORDING; | 498 event.type = JitCodeEvent::CODE_START_LINE_INFO_RECORDING; |
497 | 499 |
498 code_event_handler_(&event); | 500 code_event_handler_(&event); |
499 return event.user_data; | 501 return event.user_data; |
500 } | 502 } |
501 | 503 |
| 504 |
502 void Logger::IssueEndCodePosInfoEvent(Code* code, void* jit_handler_data) { | 505 void Logger::IssueEndCodePosInfoEvent(Code* code, void* jit_handler_data) { |
503 JitCodeEvent event; | 506 JitCodeEvent event; |
504 memset(&event, 0, sizeof(event)); | 507 memset(&event, 0, sizeof(event)); |
505 event.type = JitCodeEvent::CODE_END_LINE_INFO_RECORDING; | 508 event.type = JitCodeEvent::CODE_END_LINE_INFO_RECORDING; |
506 event.code_start = code->instruction_start(); | 509 event.code_start = code->instruction_start(); |
507 event.user_data = jit_handler_data; | 510 event.user_data = jit_handler_data; |
508 | 511 |
509 code_event_handler_(&event); | 512 code_event_handler_(&event); |
510 } | 513 } |
511 | 514 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 if (!log_->IsEnabled() || !FLAG_prof) return; | 633 if (!log_->IsEnabled() || !FLAG_prof) return; |
631 LogMessageBuilder msg(this); | 634 LogMessageBuilder msg(this); |
632 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n", | 635 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n", |
633 library_path, | 636 library_path, |
634 start, | 637 start, |
635 end); | 638 end); |
636 msg.WriteToLogFile(); | 639 msg.WriteToLogFile(); |
637 } | 640 } |
638 | 641 |
639 | 642 |
| 643 void Logger::CodeDeoptEvent(Code* code) { |
| 644 if (!log_->IsEnabled()) return; |
| 645 ASSERT(FLAG_log_internal_timer_events); |
| 646 LogMessageBuilder msg(this); |
| 647 int since_epoch = static_cast<int>(OS::Ticks() - epoch_); |
| 648 msg.Append("code-deopt,%ld,%d\n", since_epoch, code->CodeSize()); |
| 649 msg.WriteToLogFile(); |
| 650 } |
| 651 |
| 652 |
640 void Logger::TimerEvent(StartEnd se, const char* name) { | 653 void Logger::TimerEvent(StartEnd se, const char* name) { |
641 if (!log_->IsEnabled()) return; | 654 if (!log_->IsEnabled()) return; |
642 ASSERT(FLAG_log_internal_timer_events); | 655 ASSERT(FLAG_log_internal_timer_events); |
643 LogMessageBuilder msg(this); | 656 LogMessageBuilder msg(this); |
644 int since_epoch = static_cast<int>(OS::Ticks() - epoch_); | 657 int since_epoch = static_cast<int>(OS::Ticks() - epoch_); |
645 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n" | 658 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n" |
646 : "timer-event-end,\"%s\",%ld\n"; | 659 : "timer-event-end,\"%s\",%ld\n"; |
647 msg.Append(format, name, since_epoch); | 660 msg.Append(format, name, since_epoch); |
648 msg.WriteToLogFile(); | 661 msg.WriteToLogFile(); |
649 } | 662 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 void Logger::ApiIndexedPropertyAccess(const char* tag, | 823 void Logger::ApiIndexedPropertyAccess(const char* tag, |
811 JSObject* holder, | 824 JSObject* holder, |
812 uint32_t index) { | 825 uint32_t index) { |
813 if (!log_->IsEnabled() || !FLAG_log_api) return; | 826 if (!log_->IsEnabled() || !FLAG_log_api) return; |
814 String* class_name_obj = holder->class_name(); | 827 String* class_name_obj = holder->class_name(); |
815 SmartArrayPointer<char> class_name = | 828 SmartArrayPointer<char> class_name = |
816 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 829 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
817 ApiEvent("api,%s,\"%s\",%u\n", tag, *class_name, index); | 830 ApiEvent("api,%s,\"%s\",%u\n", tag, *class_name, index); |
818 } | 831 } |
819 | 832 |
| 833 |
820 void Logger::ApiObjectAccess(const char* tag, JSObject* object) { | 834 void Logger::ApiObjectAccess(const char* tag, JSObject* object) { |
821 if (!log_->IsEnabled() || !FLAG_log_api) return; | 835 if (!log_->IsEnabled() || !FLAG_log_api) return; |
822 String* class_name_obj = object->class_name(); | 836 String* class_name_obj = object->class_name(); |
823 SmartArrayPointer<char> class_name = | 837 SmartArrayPointer<char> class_name = |
824 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 838 class_name_obj->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
825 ApiEvent("api,%s,\"%s\"\n", tag, *class_name); | 839 ApiEvent("api,%s,\"%s\"\n", tag, *class_name); |
826 } | 840 } |
827 | 841 |
828 | 842 |
829 void Logger::ApiEntryCall(const char* name) { | 843 void Logger::ApiEntryCall(const char* name) { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 Name* name) { | 1048 Name* name) { |
1035 if (!is_logging_code_events()) return; | 1049 if (!is_logging_code_events()) return; |
1036 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { | 1050 if (FLAG_ll_prof || Serializer::enabled() || code_event_handler_ != NULL) { |
1037 InitNameBuffer(tag); | 1051 InitNameBuffer(tag); |
1038 name_buffer_->AppendBytes(ComputeMarker(code)); | 1052 name_buffer_->AppendBytes(ComputeMarker(code)); |
1039 AppendName(name); | 1053 AppendName(name); |
1040 LogRecordedBuffer(code, shared); | 1054 LogRecordedBuffer(code, shared); |
1041 } | 1055 } |
1042 | 1056 |
1043 if (!FLAG_log_code || !log_->IsEnabled()) return; | 1057 if (!FLAG_log_code || !log_->IsEnabled()) return; |
1044 if (code == Isolate::Current()->builtins()->builtin( | 1058 if (code == isolate_->builtins()->builtin( |
1045 Builtins::kLazyCompile)) | 1059 Builtins::kLazyCompile)) |
1046 return; | 1060 return; |
1047 | 1061 |
1048 LogMessageBuilder msg(this); | 1062 LogMessageBuilder msg(this); |
1049 AppendCodeCreateHeader(&msg, tag, code); | 1063 AppendCodeCreateHeader(&msg, tag, code); |
1050 if (name->IsString()) { | 1064 if (name->IsString()) { |
1051 SmartArrayPointer<char> str = | 1065 SmartArrayPointer<char> str = |
1052 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); | 1066 String::cast(name)->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
1053 msg.Append("\"%s\"", *str); | 1067 msg.Append("\"%s\"", *str); |
1054 } else { | 1068 } else { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 int pc_offset, | 1202 int pc_offset, |
1189 int position) { | 1203 int position) { |
1190 if (code_event_handler_ != NULL) { | 1204 if (code_event_handler_ != NULL) { |
1191 IssueAddCodeLinePosInfoEvent(jit_handler_data, | 1205 IssueAddCodeLinePosInfoEvent(jit_handler_data, |
1192 pc_offset, | 1206 pc_offset, |
1193 position, | 1207 position, |
1194 JitCodeEvent::STATEMENT_POSITION); | 1208 JitCodeEvent::STATEMENT_POSITION); |
1195 } | 1209 } |
1196 } | 1210 } |
1197 | 1211 |
| 1212 |
1198 void Logger::CodeStartLinePosInfoRecordEvent(PositionsRecorder* pos_recorder) { | 1213 void Logger::CodeStartLinePosInfoRecordEvent(PositionsRecorder* pos_recorder) { |
1199 if (code_event_handler_ != NULL) { | 1214 if (code_event_handler_ != NULL) { |
1200 pos_recorder->AttachJITHandlerData(IssueStartCodePosInfoEvent()); | 1215 pos_recorder->AttachJITHandlerData(IssueStartCodePosInfoEvent()); |
1201 } | 1216 } |
1202 } | 1217 } |
1203 | 1218 |
1204 void Logger::CodeEndLinePosInfoRecordEvent(Code* code, | 1219 void Logger::CodeEndLinePosInfoRecordEvent(Code* code, |
1205 void* jit_handler_data) { | 1220 void* jit_handler_data) { |
1206 if (code_event_handler_ != NULL) { | 1221 if (code_event_handler_ != NULL) { |
1207 IssueEndCodePosInfoEvent(code, jit_handler_data); | 1222 IssueEndCodePosInfoEvent(code, jit_handler_data); |
1208 } | 1223 } |
1209 } | 1224 } |
1210 | 1225 |
| 1226 |
1211 void Logger::SnapshotPositionEvent(Address addr, int pos) { | 1227 void Logger::SnapshotPositionEvent(Address addr, int pos) { |
1212 if (!log_->IsEnabled()) return; | 1228 if (!log_->IsEnabled()) return; |
1213 if (FLAG_ll_prof) LowLevelSnapshotPositionEvent(addr, pos); | 1229 if (FLAG_ll_prof) LowLevelSnapshotPositionEvent(addr, pos); |
1214 if (Serializer::enabled() && address_to_name_map_ != NULL) { | 1230 if (Serializer::enabled() && address_to_name_map_ != NULL) { |
1215 const char* code_name = address_to_name_map_->Lookup(addr); | 1231 const char* code_name = address_to_name_map_->Lookup(addr); |
1216 if (code_name == NULL) return; // Not a code object. | 1232 if (code_name == NULL) return; // Not a code object. |
1217 LogMessageBuilder msg(this); | 1233 LogMessageBuilder msg(this); |
1218 msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); | 1234 msg.Append("%s,%d,", kLogEventsNames[SNAPSHOT_CODE_NAME_EVENT], pos); |
1219 msg.AppendDoubleQuotedString(code_name); | 1235 msg.AppendDoubleQuotedString(code_name); |
1220 msg.Append("\n"); | 1236 msg.Append("\n"); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 DeleteArray(parameter_string); | 1362 DeleteArray(parameter_string); |
1347 msg.WriteToLogFile(); | 1363 msg.WriteToLogFile(); |
1348 } | 1364 } |
1349 | 1365 |
1350 | 1366 |
1351 void Logger::TickEvent(TickSample* sample, bool overflow) { | 1367 void Logger::TickEvent(TickSample* sample, bool overflow) { |
1352 if (!log_->IsEnabled() || !FLAG_prof) return; | 1368 if (!log_->IsEnabled() || !FLAG_prof) return; |
1353 LogMessageBuilder msg(this); | 1369 LogMessageBuilder msg(this); |
1354 msg.Append("%s,", kLogEventsNames[TICK_EVENT]); | 1370 msg.Append("%s,", kLogEventsNames[TICK_EVENT]); |
1355 msg.AppendAddress(sample->pc); | 1371 msg.AppendAddress(sample->pc); |
1356 msg.Append(','); | |
1357 msg.AppendAddress(sample->sp); | |
1358 msg.Append(",%ld", static_cast<int>(OS::Ticks() - epoch_)); | 1372 msg.Append(",%ld", static_cast<int>(OS::Ticks() - epoch_)); |
1359 if (sample->has_external_callback) { | 1373 if (sample->has_external_callback) { |
1360 msg.Append(",1,"); | 1374 msg.Append(",1,"); |
1361 msg.AppendAddress(sample->external_callback); | 1375 msg.AppendAddress(sample->external_callback); |
1362 } else { | 1376 } else { |
1363 msg.Append(",0,"); | 1377 msg.Append(",0,"); |
1364 msg.AppendAddress(sample->tos); | 1378 msg.AppendAddress(sample->tos); |
1365 } | 1379 } |
1366 msg.Append(",%d", static_cast<int>(sample->state)); | 1380 msg.Append(",%d", static_cast<int>(sample->state)); |
1367 if (overflow) { | 1381 if (overflow) { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 if (obj->IsCode()) LogCodeObject(obj); | 1652 if (obj->IsCode()) LogCodeObject(obj); |
1639 } | 1653 } |
1640 } | 1654 } |
1641 | 1655 |
1642 | 1656 |
1643 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, | 1657 void Logger::LogExistingFunction(Handle<SharedFunctionInfo> shared, |
1644 Handle<Code> code) { | 1658 Handle<Code> code) { |
1645 Handle<String> func_name(shared->DebugName()); | 1659 Handle<String> func_name(shared->DebugName()); |
1646 if (shared->script()->IsScript()) { | 1660 if (shared->script()->IsScript()) { |
1647 Handle<Script> script(Script::cast(shared->script())); | 1661 Handle<Script> script(Script::cast(shared->script())); |
| 1662 int line_num = GetScriptLineNumber(script, shared->start_position()) + 1; |
1648 if (script->name()->IsString()) { | 1663 if (script->name()->IsString()) { |
1649 Handle<String> script_name(String::cast(script->name())); | 1664 Handle<String> script_name(String::cast(script->name())); |
1650 int line_num = GetScriptLineNumber(script, shared->start_position()); | |
1651 if (line_num > 0) { | 1665 if (line_num > 0) { |
1652 PROFILE(isolate_, | 1666 PROFILE(isolate_, |
1653 CodeCreateEvent( | 1667 CodeCreateEvent( |
1654 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), | 1668 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), |
1655 *code, *shared, NULL, | 1669 *code, *shared, NULL, |
1656 *script_name, line_num + 1)); | 1670 *script_name, line_num)); |
1657 } else { | 1671 } else { |
1658 // Can't distinguish eval and script here, so always use Script. | 1672 // Can't distinguish eval and script here, so always use Script. |
1659 PROFILE(isolate_, | 1673 PROFILE(isolate_, |
1660 CodeCreateEvent( | 1674 CodeCreateEvent( |
1661 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), | 1675 Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script), |
1662 *code, *shared, NULL, *script_name)); | 1676 *code, *shared, NULL, *script_name)); |
1663 } | 1677 } |
1664 } else { | 1678 } else { |
1665 PROFILE(isolate_, | 1679 PROFILE(isolate_, |
1666 CodeCreateEvent( | 1680 CodeCreateEvent( |
1667 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), | 1681 Logger::ToNativeByScript(Logger::LAZY_COMPILE_TAG, *script), |
1668 *code, *shared, NULL, *func_name)); | 1682 *code, *shared, NULL, |
| 1683 isolate_->heap()->empty_string(), line_num)); |
1669 } | 1684 } |
1670 } else if (shared->IsApiFunction()) { | 1685 } else if (shared->IsApiFunction()) { |
1671 // API function. | 1686 // API function. |
1672 FunctionTemplateInfo* fun_data = shared->get_api_func_data(); | 1687 FunctionTemplateInfo* fun_data = shared->get_api_func_data(); |
1673 Object* raw_call_data = fun_data->call_code(); | 1688 Object* raw_call_data = fun_data->call_code(); |
1674 if (!raw_call_data->IsUndefined()) { | 1689 if (!raw_call_data->IsUndefined()) { |
1675 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); | 1690 CallHandlerInfo* call_data = CallHandlerInfo::cast(raw_call_data); |
1676 Object* callback_obj = call_data->callback(); | 1691 Object* callback_obj = call_data->callback(); |
1677 Address entry_point = v8::ToCData<Address>(callback_obj); | 1692 Address entry_point = v8::ToCData<Address>(callback_obj); |
1678 PROFILE(isolate_, CallbackEvent(*func_name, entry_point)); | 1693 PROFILE(isolate_, CallbackEvent(*func_name, entry_point)); |
(...skipping 12 matching lines...) Expand all Loading... |
1691 "Logger::LogCompiledFunctions"); | 1706 "Logger::LogCompiledFunctions"); |
1692 HandleScope scope(isolate_); | 1707 HandleScope scope(isolate_); |
1693 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL); | 1708 const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL); |
1694 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); | 1709 ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count); |
1695 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); | 1710 ScopedVector< Handle<Code> > code_objects(compiled_funcs_count); |
1696 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start()); | 1711 EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start()); |
1697 | 1712 |
1698 // During iteration, there can be heap allocation due to | 1713 // During iteration, there can be heap allocation due to |
1699 // GetScriptLineNumber call. | 1714 // GetScriptLineNumber call. |
1700 for (int i = 0; i < compiled_funcs_count; ++i) { | 1715 for (int i = 0; i < compiled_funcs_count; ++i) { |
1701 if (*code_objects[i] == Isolate::Current()->builtins()->builtin( | 1716 if (*code_objects[i] == isolate_->builtins()->builtin( |
1702 Builtins::kLazyCompile)) | 1717 Builtins::kLazyCompile)) |
1703 continue; | 1718 continue; |
1704 LogExistingFunction(sfis[i], code_objects[i]); | 1719 LogExistingFunction(sfis[i], code_objects[i]); |
1705 } | 1720 } |
1706 } | 1721 } |
1707 | 1722 |
1708 | 1723 |
1709 void Logger::LogAccessorCallbacks() { | 1724 void Logger::LogAccessorCallbacks() { |
1710 Heap* heap = isolate_->heap(); | 1725 Heap* heap = isolate_->heap(); |
1711 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1726 heap->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 | 1786 |
1772 return true; | 1787 return true; |
1773 } | 1788 } |
1774 | 1789 |
1775 | 1790 |
1776 void Logger::SetCodeEventHandler(uint32_t options, | 1791 void Logger::SetCodeEventHandler(uint32_t options, |
1777 JitCodeEventHandler event_handler) { | 1792 JitCodeEventHandler event_handler) { |
1778 code_event_handler_ = event_handler; | 1793 code_event_handler_ = event_handler; |
1779 | 1794 |
1780 if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) { | 1795 if (code_event_handler_ != NULL && (options & kJitCodeEventEnumExisting)) { |
1781 HandleScope scope(Isolate::Current()); | 1796 HandleScope scope(isolate_); |
1782 LogCodeObjects(); | 1797 LogCodeObjects(); |
1783 LogCompiledFunctions(); | 1798 LogCompiledFunctions(); |
1784 } | 1799 } |
1785 } | 1800 } |
1786 | 1801 |
1787 | 1802 |
1788 Sampler* Logger::sampler() { | 1803 Sampler* Logger::sampler() { |
1789 return ticker_; | 1804 return ticker_; |
1790 } | 1805 } |
1791 | 1806 |
1792 | 1807 |
1793 FILE* Logger::TearDown() { | 1808 FILE* Logger::TearDown() { |
1794 if (!is_initialized_) return NULL; | 1809 if (!is_initialized_) return NULL; |
1795 is_initialized_ = false; | 1810 is_initialized_ = false; |
1796 | 1811 |
1797 // Stop the profiler before closing the file. | 1812 // Stop the profiler before closing the file. |
1798 if (profiler_ != NULL) { | 1813 if (profiler_ != NULL) { |
1799 profiler_->Disengage(); | 1814 profiler_->Disengage(); |
1800 delete profiler_; | 1815 delete profiler_; |
1801 profiler_ = NULL; | 1816 profiler_ = NULL; |
1802 } | 1817 } |
1803 | 1818 |
1804 delete ticker_; | 1819 delete ticker_; |
1805 ticker_ = NULL; | 1820 ticker_ = NULL; |
1806 | 1821 |
1807 return log_->Close(); | 1822 return log_->Close(); |
1808 } | 1823 } |
1809 | 1824 |
1810 } } // namespace v8::internal | 1825 } } // namespace v8::internal |
OLD | NEW |