| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32, | 35 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32, |
| 36 "Max size of new gen semi space in MB"); | 36 "Max size of new gen semi space in MB"); |
| 37 DEFINE_FLAG(int, old_gen_heap_size, 0, | 37 DEFINE_FLAG(int, old_gen_heap_size, 0, |
| 38 "Max size of old gen heap size in MB, or 0 for unlimited," | 38 "Max size of old gen heap size in MB, or 0 for unlimited," |
| 39 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap"); | 39 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap"); |
| 40 DEFINE_FLAG(int, external_max_size, (kWordSize <= 4) ? 512 : 1024, | 40 DEFINE_FLAG(int, external_max_size, (kWordSize <= 4) ? 512 : 1024, |
| 41 "Max total size of external allocations in MB, or 0 for unlimited," | 41 "Max total size of external allocations in MB, or 0 for unlimited," |
| 42 "e.g: --external_max_size=1024 allows up to 1024MB of externals"); | 42 "e.g: --external_max_size=1024 allows up to 1024MB of externals"); |
| 43 | 43 |
| 44 DEFINE_FLAG(bool, keep_code, false, |
| 45 "Keep deoptimized code for profiling."); |
| 44 | 46 |
| 45 DECLARE_FLAG(bool, print_class_table); | 47 DECLARE_FLAG(bool, print_class_table); |
| 46 DECLARE_FLAG(bool, trace_isolates); | 48 DECLARE_FLAG(bool, trace_isolates); |
| 47 | 49 |
| 48 Isolate* Dart::vm_isolate_ = NULL; | 50 Isolate* Dart::vm_isolate_ = NULL; |
| 49 ThreadPool* Dart::thread_pool_ = NULL; | 51 ThreadPool* Dart::thread_pool_ = NULL; |
| 50 DebugInfo* Dart::pprof_symbol_generator_ = NULL; | 52 DebugInfo* Dart::pprof_symbol_generator_ = NULL; |
| 51 ReadOnlyHandles* Dart::predefined_handles_ = NULL; | 53 ReadOnlyHandles* Dart::predefined_handles_ = NULL; |
| 52 | 54 |
| 53 // Structure for managing read-only global handles allocation used for | 55 // Structure for managing read-only global handles allocation used for |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 ServiceIsolate::SendIsolateStartupMessage(); | 271 ServiceIsolate::SendIsolateStartupMessage(); |
| 270 isolate->debugger()->NotifyIsolateCreated(); | 272 isolate->debugger()->NotifyIsolateCreated(); |
| 271 | 273 |
| 272 // Create tag table. | 274 // Create tag table. |
| 273 isolate->set_tag_table( | 275 isolate->set_tag_table( |
| 274 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 276 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
| 275 // Set up default UserTag. | 277 // Set up default UserTag. |
| 276 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); | 278 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); |
| 277 isolate->set_current_tag(default_tag); | 279 isolate->set_current_tag(default_tag); |
| 278 | 280 |
| 281 if (FLAG_keep_code) { |
| 282 isolate->set_deoptimized_code_array( |
| 283 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
| 284 } |
| 279 return Error::null(); | 285 return Error::null(); |
| 280 } | 286 } |
| 281 | 287 |
| 282 | 288 |
| 283 void Dart::RunShutdownCallback() { | 289 void Dart::RunShutdownCallback() { |
| 284 Isolate* isolate = Isolate::Current(); | 290 Isolate* isolate = Isolate::Current(); |
| 285 void* callback_data = isolate->init_callback_data(); | 291 void* callback_data = isolate->init_callback_data(); |
| 286 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 292 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
| 287 ServiceIsolate::SendIsolateShutdownMessage(); | 293 ServiceIsolate::SendIsolateShutdownMessage(); |
| 288 if (callback != NULL) { | 294 if (callback != NULL) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 304 return predefined_handles_->handles_.AllocateScopedHandle(); | 310 return predefined_handles_->handles_.AllocateScopedHandle(); |
| 305 } | 311 } |
| 306 | 312 |
| 307 | 313 |
| 308 bool Dart::IsReadOnlyHandle(uword address) { | 314 bool Dart::IsReadOnlyHandle(uword address) { |
| 309 ASSERT(predefined_handles_ != NULL); | 315 ASSERT(predefined_handles_ != NULL); |
| 310 return predefined_handles_->handles_.IsValidScopedHandle(address); | 316 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 311 } | 317 } |
| 312 | 318 |
| 313 } // namespace dart | 319 } // namespace dart |
| OLD | NEW |