| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/dart.h" | 5 #include "vm/dart.h" |
| 6 | 6 |
| 7 #include "vm/code_observers.h" | 7 #include "vm/code_observers.h" |
| 8 #include "vm/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "vm/stub_code.h" | 26 #include "vm/stub_code.h" |
| 27 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
| 28 #include "vm/thread_interrupter.h" | 28 #include "vm/thread_interrupter.h" |
| 29 #include "vm/thread_pool.h" | 29 #include "vm/thread_pool.h" |
| 30 #include "vm/timeline.h" | 30 #include "vm/timeline.h" |
| 31 #include "vm/virtual_memory.h" | 31 #include "vm/virtual_memory.h" |
| 32 #include "vm/zone.h" | 32 #include "vm/zone.h" |
| 33 | 33 |
| 34 namespace dart { | 34 namespace dart { |
| 35 | 35 |
| 36 DECLARE_FLAG(bool, complete_timeline); |
| 37 DECLARE_FLAG(bool, print_class_table); |
| 38 DECLARE_FLAG(bool, trace_isolates); |
| 36 DEFINE_FLAG(bool, keep_code, false, | 39 DEFINE_FLAG(bool, keep_code, false, |
| 37 "Keep deoptimized code for profiling."); | 40 "Keep deoptimized code for profiling."); |
| 38 DECLARE_FLAG(bool, print_class_table); | |
| 39 DECLARE_FLAG(bool, trace_isolates); | |
| 40 | 41 |
| 41 Isolate* Dart::vm_isolate_ = NULL; | 42 Isolate* Dart::vm_isolate_ = NULL; |
| 42 ThreadPool* Dart::thread_pool_ = NULL; | 43 ThreadPool* Dart::thread_pool_ = NULL; |
| 43 DebugInfo* Dart::pprof_symbol_generator_ = NULL; | 44 DebugInfo* Dart::pprof_symbol_generator_ = NULL; |
| 44 ReadOnlyHandles* Dart::predefined_handles_ = NULL; | 45 ReadOnlyHandles* Dart::predefined_handles_ = NULL; |
| 45 | 46 |
| 46 // Structure for managing read-only global handles allocation used for | 47 // Structure for managing read-only global handles allocation used for |
| 47 // creating global read-only handles that are pre created and initialized | 48 // creating global read-only handles that are pre created and initialized |
| 48 // for use across all isolates. Having these global pre created handles | 49 // for use across all isolates. Having these global pre created handles |
| 49 // stored in the vm isolate ensures that we don't constantly create and | 50 // stored in the vm isolate ensures that we don't constantly create and |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 ServiceIsolate::SendIsolateStartupMessage(); | 302 ServiceIsolate::SendIsolateStartupMessage(); |
| 302 isolate->debugger()->NotifyIsolateCreated(); | 303 isolate->debugger()->NotifyIsolateCreated(); |
| 303 | 304 |
| 304 // Create tag table. | 305 // Create tag table. |
| 305 isolate->set_tag_table( | 306 isolate->set_tag_table( |
| 306 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 307 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
| 307 // Set up default UserTag. | 308 // Set up default UserTag. |
| 308 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); | 309 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); |
| 309 isolate->set_current_tag(default_tag); | 310 isolate->set_current_tag(default_tag); |
| 310 | 311 |
| 311 isolate->SetTimelineEventRecorder(new TimelineEventRingRecorder()); | 312 if (FLAG_complete_timeline) { |
| 313 isolate->SetTimelineEventRecorder(new TimelineEventEndlessRecorder()); |
| 314 } else { |
| 315 isolate->SetTimelineEventRecorder(new TimelineEventRingRecorder()); |
| 316 } |
| 317 |
| 312 | 318 |
| 313 if (FLAG_keep_code) { | 319 if (FLAG_keep_code) { |
| 314 isolate->set_deoptimized_code_array( | 320 isolate->set_deoptimized_code_array( |
| 315 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 321 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
| 316 } | 322 } |
| 317 return Error::null(); | 323 return Error::null(); |
| 318 } | 324 } |
| 319 | 325 |
| 320 | 326 |
| 321 void Dart::RunShutdownCallback() { | 327 void Dart::RunShutdownCallback() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return predefined_handles_->handles_.IsValidScopedHandle(address); | 361 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 356 } | 362 } |
| 357 | 363 |
| 358 | 364 |
| 359 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 365 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 360 ASSERT(predefined_handles_ != NULL); | 366 ASSERT(predefined_handles_ != NULL); |
| 361 return predefined_handles_->api_handles_.IsValidHandle(handle); | 367 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 362 } | 368 } |
| 363 | 369 |
| 364 } // namespace dart | 370 } // namespace dart |
| OLD | NEW |