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

Unified Diff: runtime/vm/dart.cc

Issue 10823028: - Improve the formatting of generated source text. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
===================================================================
--- runtime/vm/dart.cc (revision 9912)
+++ runtime/vm/dart.cc (working copy)
@@ -22,6 +22,7 @@
namespace dart {
+DECLARE_FLAG(bool, print_bootstrap);
DECLARE_FLAG(bool, print_class_table);
DECLARE_FLAG(bool, trace_isolates);
@@ -93,6 +94,32 @@
}
+static void PrintLibrarySources(Isolate* isolate) {
+ const GrowableObjectArray& libs = GrowableObjectArray::Handle(
+ isolate->object_store()->libraries());
+ intptr_t lib_count = libs.Length();
+ Library& lib = Library::Handle();
+ Array& scripts = Array::Handle();
+ Script& script = Script::Handle();
+ String& url = String::Handle();
+ String& source = String::Handle();
+ for (int i = 0; i < lib_count; i++) {
+ lib ^= libs.At(i);
+ url = lib.url();
+ OS::Print("Library %s:\n", url.ToCString());
+ scripts = lib.LoadedScripts();
+ intptr_t script_count = scripts.Length();
+ for (intptr_t i = 0; i < script_count; i++) {
+ script ^= scripts.At(i);
+ url = script.url();
+ source = script.Source();
+ OS::Print("Source for %s:\n", url.ToCString());
+ OS::Print("%s\n", source.ToCString());
+ }
siva 2012/07/26 00:51:05 In the non snapshot case the print-bootstrap flat
+ }
+}
+
+
RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
// Initialize the new isolate.
TIMERSCOPE(time_isolate_initialization);
@@ -121,6 +148,9 @@
if (FLAG_trace_isolates) {
isolate->heap()->PrintSizes();
}
+ if (FLAG_print_bootstrap) {
+ PrintLibrarySources(isolate);
+ }
}
StubCode::Init(isolate);
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698