| 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 12 matching lines...) Expand all Loading... |
| 23 #include "vm/snapshot.h" | 23 #include "vm/snapshot.h" |
| 24 #include "vm/stub_code.h" | 24 #include "vm/stub_code.h" |
| 25 #include "vm/symbols.h" | 25 #include "vm/symbols.h" |
| 26 #include "vm/thread_interrupter.h" | 26 #include "vm/thread_interrupter.h" |
| 27 #include "vm/thread_pool.h" | 27 #include "vm/thread_pool.h" |
| 28 #include "vm/virtual_memory.h" | 28 #include "vm/virtual_memory.h" |
| 29 #include "vm/zone.h" | 29 #include "vm/zone.h" |
| 30 | 30 |
| 31 namespace dart { | 31 namespace dart { |
| 32 | 32 |
| 33 DEFINE_FLAG(int, new_gen_heap_size, 32, "new gen heap size in MB," | 33 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32, |
| 34 "e.g: --new_gen_heap_size=64 allocates a 64MB new gen heap"); | 34 "Max size of new gen semi space in MB"); |
| 35 DEFINE_FLAG(int, old_gen_heap_size, Heap::kHeapSizeInMB, | 35 DEFINE_FLAG(int, old_gen_heap_size, Heap::kHeapSizeInMB, |
| 36 "old gen heap size in MB," | 36 "Max size of old gen heap size in MB," |
| 37 "e.g: --old_gen_heap_size=1024 allocates a 1024MB old gen heap"); | 37 "e.g: --old_gen_heap_size=1024 allows up to 1024MB old gen heap"); |
| 38 | 38 |
| 39 DECLARE_FLAG(bool, print_class_table); | 39 DECLARE_FLAG(bool, print_class_table); |
| 40 DECLARE_FLAG(bool, trace_isolates); | 40 DECLARE_FLAG(bool, trace_isolates); |
| 41 | 41 |
| 42 Isolate* Dart::vm_isolate_ = NULL; | 42 Isolate* Dart::vm_isolate_ = NULL; |
| 43 ThreadPool* Dart::thread_pool_ = NULL; | 43 ThreadPool* Dart::thread_pool_ = NULL; |
| 44 DebugInfo* Dart::pprof_symbol_generator_ = NULL; | 44 DebugInfo* Dart::pprof_symbol_generator_ = NULL; |
| 45 ReadOnlyHandles* Dart::predefined_handles_ = NULL; | 45 ReadOnlyHandles* Dart::predefined_handles_ = NULL; |
| 46 | 46 |
| 47 // An object visitor which will mark all visited objects. This is used to | 47 // An object visitor which will mark all visited objects. This is used to |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 | 207 |
| 208 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { | 208 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { |
| 209 // Initialize the new isolate. | 209 // Initialize the new isolate. |
| 210 Isolate* isolate = Isolate::Current(); | 210 Isolate* isolate = Isolate::Current(); |
| 211 TIMERSCOPE(isolate, time_isolate_initialization); | 211 TIMERSCOPE(isolate, time_isolate_initialization); |
| 212 ASSERT(isolate != NULL); | 212 ASSERT(isolate != NULL); |
| 213 StackZone zone(isolate); | 213 StackZone zone(isolate); |
| 214 HandleScope handle_scope(isolate); | 214 HandleScope handle_scope(isolate); |
| 215 Heap::Init(isolate, | 215 Heap::Init(isolate, |
| 216 FLAG_new_gen_heap_size * MBInWords, | 216 FLAG_new_gen_semi_max_size * MBInWords, |
| 217 FLAG_old_gen_heap_size * MBInWords); | 217 FLAG_old_gen_heap_size * MBInWords); |
| 218 ObjectIdRing::Init(isolate); | 218 ObjectIdRing::Init(isolate); |
| 219 ObjectStore::Init(isolate); | 219 ObjectStore::Init(isolate); |
| 220 | 220 |
| 221 // Setup for profiling. | 221 // Setup for profiling. |
| 222 Profiler::InitProfilingForIsolate(isolate); | 222 Profiler::InitProfilingForIsolate(isolate); |
| 223 | 223 |
| 224 if (snapshot_buffer == NULL) { | 224 if (snapshot_buffer == NULL) { |
| 225 const Error& error = Error::Handle(Object::Init(isolate)); | 225 const Error& error = Error::Handle(Object::Init(isolate)); |
| 226 if (!error.IsNull()) { | 226 if (!error.IsNull()) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 return predefined_handles_->handles_.AllocateScopedHandle(); | 300 return predefined_handles_->handles_.AllocateScopedHandle(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 | 303 |
| 304 bool Dart::IsReadOnlyHandle(uword address) { | 304 bool Dart::IsReadOnlyHandle(uword address) { |
| 305 ASSERT(predefined_handles_ != NULL); | 305 ASSERT(predefined_handles_ != NULL); |
| 306 return predefined_handles_->handles_.IsValidScopedHandle(address); | 306 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace dart | 309 } // namespace dart |
| OLD | NEW |