OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "lib/mirrors.h" | 9 #include "lib/mirrors.h" |
10 #include "vm/code_observers.h" | |
10 #include "vm/compiler_stats.h" | 11 #include "vm/compiler_stats.h" |
11 #include "vm/dart_api_state.h" | 12 #include "vm/dart_api_state.h" |
12 #include "vm/dart_entry.h" | 13 #include "vm/dart_entry.h" |
13 #include "vm/debugger.h" | 14 #include "vm/debugger.h" |
14 #include "vm/debuginfo.h" | |
15 #include "vm/heap.h" | 15 #include "vm/heap.h" |
16 #include "vm/message_handler.h" | 16 #include "vm/message_handler.h" |
17 #include "vm/object_store.h" | 17 #include "vm/object_store.h" |
18 #include "vm/parser.h" | 18 #include "vm/parser.h" |
19 #include "vm/port.h" | 19 #include "vm/port.h" |
20 #include "vm/stack_frame.h" | 20 #include "vm/stack_frame.h" |
21 #include "vm/stub_code.h" | 21 #include "vm/stub_code.h" |
22 #include "vm/symbols.h" | 22 #include "vm/symbols.h" |
23 #include "vm/thread.h" | 23 #include "vm/thread.h" |
24 #include "vm/timer.h" | 24 #include "vm/timer.h" |
25 #include "vm/visitor.h" | 25 #include "vm/visitor.h" |
26 | 26 |
27 namespace dart { | 27 namespace dart { |
28 | 28 |
29 DEFINE_FLAG(bool, report_usage_count, false, | 29 DEFINE_FLAG(bool, report_usage_count, false, |
30 "Track function usage and report."); | 30 "Track function usage and report."); |
31 DEFINE_FLAG(bool, trace_isolates, false, | 31 DEFINE_FLAG(bool, trace_isolates, false, |
32 "Trace isolate creation and shut down."); | 32 "Trace isolate creation and shut down."); |
33 DECLARE_FLAG(bool, generate_gdb_symbols); | |
34 | 33 |
35 | 34 |
36 class IsolateMessageHandler : public MessageHandler { | 35 class IsolateMessageHandler : public MessageHandler { |
37 public: | 36 public: |
38 explicit IsolateMessageHandler(Isolate* isolate); | 37 explicit IsolateMessageHandler(Isolate* isolate); |
39 ~IsolateMessageHandler(); | 38 ~IsolateMessageHandler(); |
40 | 39 |
41 const char* name() const; | 40 const char* name() const; |
42 void MessageNotify(Message::Priority priority); | 41 void MessageNotify(Message::Priority priority); |
43 bool HandleMessage(Message* message); | 42 bool HandleMessage(Message* message); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 // Finalize any weak persistent handles with a non-null referent. | 520 // Finalize any weak persistent handles with a non-null referent. |
522 FinalizeWeakPersistentHandlesVisitor visitor; | 521 FinalizeWeakPersistentHandlesVisitor visitor; |
523 api_state()->weak_persistent_handles().VisitHandles(&visitor); | 522 api_state()->weak_persistent_handles().VisitHandles(&visitor); |
524 | 523 |
525 // Dump all accumalated timer data for the isolate. | 524 // Dump all accumalated timer data for the isolate. |
526 timer_list_.ReportTimers(); | 525 timer_list_.ReportTimers(); |
527 if (FLAG_report_usage_count) { | 526 if (FLAG_report_usage_count) { |
528 PrintInvokedFunctions(); | 527 PrintInvokedFunctions(); |
529 } | 528 } |
530 CompilerStats::Print(); | 529 CompilerStats::Print(); |
531 if (FLAG_generate_gdb_symbols) { | 530 CodeObservers::DeleteAll(); |
siva
2012/12/20 22:40:15
Can you add a TODO here that this piece of code ne
| |
532 DebugInfo::UnregisterAllSections(); | |
533 } | |
534 if (FLAG_trace_isolates) { | 531 if (FLAG_trace_isolates) { |
535 StackZone zone(this); | 532 StackZone zone(this); |
536 HandleScope handle_scope(this); | 533 HandleScope handle_scope(this); |
537 heap()->PrintSizes(); | 534 heap()->PrintSizes(); |
538 megamorphic_cache_table()->PrintSizes(); | 535 megamorphic_cache_table()->PrintSizes(); |
539 Symbols::DumpStats(); | 536 Symbols::DumpStats(); |
540 OS::Print("[-] Stopping isolate:\n" | 537 OS::Print("[-] Stopping isolate:\n" |
541 "\tisolate: %s\n", name()); | 538 "\tisolate: %s\n", name()); |
542 } | 539 } |
543 // TODO(5411455): For now just make sure there are no current isolates | 540 // TODO(5411455): For now just make sure there are no current isolates |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 | 598 |
602 | 599 |
603 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 600 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
604 bool visit_prologue_weak_handles) { | 601 bool visit_prologue_weak_handles) { |
605 if (api_state() != NULL) { | 602 if (api_state() != NULL) { |
606 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 603 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
607 } | 604 } |
608 } | 605 } |
609 | 606 |
610 } // namespace dart | 607 } // namespace dart |
OLD | NEW |