Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Unified Diff: runtime/vm/isolate.cc

Issue 23875015: - Base JSON stream printing on stack objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/heap_histogram.cc ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 27342)
+++ runtime/vm/isolate.cc (working copy)
@@ -10,6 +10,7 @@
#include "lib/mirrors.h"
#include "vm/code_observers.h"
#include "vm/compiler_stats.h"
+#include "vm/coverage.h"
#include "vm/dart_api_state.h"
#include "vm/dart_entry.h"
#include "vm/debugger.h"
@@ -712,8 +713,6 @@
void Isolate::PrintInvokedFunctions() {
ASSERT(this == Isolate::Current());
- StackZone zone(this);
- HandleScope handle_scope(this);
const GrowableObjectArray& libraries =
GrowableObjectArray::Handle(object_store()->libraries());
Library& library = Library::Handle();
@@ -758,51 +757,54 @@
ASSERT(top_resource() == NULL);
ASSERT((heap_ == NULL) || heap_->Verify());
- if (FLAG_print_object_histogram) {
+ // Create an area where we do have a zone and a handle scope so that we can
+ // call VM functions while tearing this isolate down.
+ {
StackZone stack_zone(this);
HandleScope handle_scope(this);
- heap()->CollectAllGarbage();
- object_histogram()->Print();
- }
- // Clean up debugger resources. Shutting down the debugger
- // requires a handle zone. We must set up a temporary zone because
- // Isolate::Shutdown is called without a zone.
- {
- StackZone zone(this);
- HandleScope handle_scope(this);
- debugger_->Shutdown();
- }
+ if (FLAG_print_object_histogram) {
+ heap()->CollectAllGarbage();
+ object_histogram()->Print();
+ }
- // Close all the ports owned by this isolate.
- PortMap::ClosePorts(message_handler());
+ // Clean up debugger resources.
+ debugger()->Shutdown();
- // Fail fast if anybody tries to post any more messsages to this isolate.
- delete message_handler();
- set_message_handler(NULL);
+ // Close all the ports owned by this isolate.
+ PortMap::ClosePorts(message_handler());
- // Finalize any weak persistent handles with a non-null referent.
- FinalizeWeakPersistentHandlesVisitor visitor;
- api_state()->weak_persistent_handles().VisitHandles(&visitor);
+ // Fail fast if anybody tries to post any more messsages to this isolate.
+ delete message_handler();
+ set_message_handler(NULL);
- // Dump all accumalated timer data for the isolate.
- timer_list_.ReportTimers();
- if (FLAG_report_usage_count) {
- PrintInvokedFunctions();
+ // Dump all accumalated timer data for the isolate.
+ timer_list_.ReportTimers();
+ if (FLAG_report_usage_count) {
+ PrintInvokedFunctions();
+ }
+
+ if (FLAG_print_coverage) {
+ CodeCoverage::Print(this);
+ }
+
+ // Finalize any weak persistent handles with a non-null referent.
+ FinalizeWeakPersistentHandlesVisitor visitor;
+ api_state()->weak_persistent_handles().VisitHandles(&visitor);
+
+ CompilerStats::Print();
+ // TODO(asiva): Move this code to Dart::Cleanup when we have that method
+ // as the cleanup for Dart::InitOnce.
+ CodeObservers::DeleteAll();
+ if (FLAG_trace_isolates) {
+ heap()->PrintSizes();
+ megamorphic_cache_table()->PrintSizes();
+ Symbols::DumpStats();
+ OS::Print("[-] Stopping isolate:\n"
+ "\tisolate: %s\n", name());
+ }
}
- CompilerStats::Print();
- // TODO(asiva): Move this code to Dart::Cleanup when we have that method
- // as the cleanup for Dart::InitOnce.
- CodeObservers::DeleteAll();
- if (FLAG_trace_isolates) {
- StackZone zone(this);
- HandleScope handle_scope(this);
- heap()->PrintSizes();
- megamorphic_cache_table()->PrintSizes();
- Symbols::DumpStats();
- OS::Print("[-] Stopping isolate:\n"
- "\tisolate: %s\n", name());
- }
+
// TODO(5411455): For now just make sure there are no current isolates
// as we are shutting down the isolate.
SetCurrent(NULL);
« no previous file with comments | « runtime/vm/heap_histogram.cc ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698