| 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/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 AddFunctionsFromClass(cls, &invoked_functions); | 367 AddFunctionsFromClass(cls, &invoked_functions); |
| 368 } | 368 } |
| 369 Array& anon_classes = Array::Handle(library.raw_ptr()->anonymous_classes_); | 369 Array& anon_classes = Array::Handle(library.raw_ptr()->anonymous_classes_); |
| 370 for (int i = 0; i < library.raw_ptr()->num_anonymous_; i++) { | 370 for (int i = 0; i < library.raw_ptr()->num_anonymous_; i++) { |
| 371 cls ^= anon_classes.At(i); | 371 cls ^= anon_classes.At(i); |
| 372 AddFunctionsFromClass(cls, &invoked_functions); | 372 AddFunctionsFromClass(cls, &invoked_functions); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 invoked_functions.Sort(MostUsedFunctionFirst); | 375 invoked_functions.Sort(MostUsedFunctionFirst); |
| 376 for (int i = 0; i < invoked_functions.length(); i++) { | 376 for (int i = 0; i < invoked_functions.length(); i++) { |
| 377 OS::Print("%10d x %s\n", | 377 OS::Print("%10"Pd" x %s\n", |
| 378 invoked_functions[i]->usage_counter(), | 378 invoked_functions[i]->usage_counter(), |
| 379 invoked_functions[i]->ToFullyQualifiedCString()); | 379 invoked_functions[i]->ToFullyQualifiedCString()); |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 void Isolate::Shutdown() { | 384 void Isolate::Shutdown() { |
| 385 ASSERT(this == Isolate::Current()); | 385 ASSERT(this == Isolate::Current()); |
| 386 ASSERT(top_resource() == NULL); | 386 ASSERT(top_resource() == NULL); |
| 387 ASSERT((heap_ == NULL) || heap_->Verify()); | 387 ASSERT((heap_ == NULL) || heap_->Verify()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 407 if (FLAG_report_usage_count) { | 407 if (FLAG_report_usage_count) { |
| 408 PrintInvokedFunctions(); | 408 PrintInvokedFunctions(); |
| 409 } | 409 } |
| 410 CompilerStats::Print(); | 410 CompilerStats::Print(); |
| 411 if (FLAG_generate_gdb_symbols) { | 411 if (FLAG_generate_gdb_symbols) { |
| 412 DebugInfo::UnregisterAllSections(); | 412 DebugInfo::UnregisterAllSections(); |
| 413 } | 413 } |
| 414 if (FLAG_trace_isolates) { | 414 if (FLAG_trace_isolates) { |
| 415 Zone zone(this); | 415 Zone zone(this); |
| 416 HandleScope handle_scope(this); | 416 HandleScope handle_scope(this); |
| 417 OS::Print("Number of symbols added = %d\n", Symbols::Size(this)); | 417 OS::Print("Number of symbols added = %"Pd"\n", Symbols::Size(this)); |
| 418 OS::Print("[-] Stopping isolate:\n" | 418 OS::Print("[-] Stopping isolate:\n" |
| 419 "\tisolate: %s\n", name()); | 419 "\tisolate: %s\n", name()); |
| 420 } | 420 } |
| 421 // TODO(5411455): For now just make sure there are no current isolates | 421 // TODO(5411455): For now just make sure there are no current isolates |
| 422 // as we are shutting down the isolate. | 422 // as we are shutting down the isolate. |
| 423 SetCurrent(NULL); | 423 SetCurrent(NULL); |
| 424 } | 424 } |
| 425 | 425 |
| 426 | 426 |
| 427 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; | 427 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 | 472 |
| 473 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 473 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 474 bool visit_prologue_weak_handles) { | 474 bool visit_prologue_weak_handles) { |
| 475 if (api_state() != NULL) { | 475 if (api_state() != NULL) { |
| 476 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 476 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace dart | 480 } // namespace dart |
| OLD | NEW |