| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 TIMERSCOPE(isolate, time_isolate_initialization); | 210 TIMERSCOPE(isolate, time_isolate_initialization); |
| 211 ASSERT(isolate != NULL); | 211 ASSERT(isolate != NULL); |
| 212 StackZone zone(isolate); | 212 StackZone zone(isolate); |
| 213 HandleScope handle_scope(isolate); | 213 HandleScope handle_scope(isolate); |
| 214 Heap::Init(isolate, | 214 Heap::Init(isolate, |
| 215 FLAG_new_gen_heap_size * MBInWords, | 215 FLAG_new_gen_heap_size * MBInWords, |
| 216 FLAG_old_gen_heap_size * MBInWords); | 216 FLAG_old_gen_heap_size * MBInWords); |
| 217 ObjectIdRing::Init(isolate); | 217 ObjectIdRing::Init(isolate); |
| 218 ObjectStore::Init(isolate); | 218 ObjectStore::Init(isolate); |
| 219 | 219 |
| 220 // Setup for profiling. |
| 221 Profiler::InitProfilingForIsolate(isolate); |
| 222 |
| 220 if (snapshot_buffer == NULL) { | 223 if (snapshot_buffer == NULL) { |
| 221 const Error& error = Error::Handle(Object::Init(isolate)); | 224 const Error& error = Error::Handle(Object::Init(isolate)); |
| 222 if (!error.IsNull()) { | 225 if (!error.IsNull()) { |
| 223 return error.raw(); | 226 return error.raw(); |
| 224 } | 227 } |
| 225 } else { | 228 } else { |
| 226 // Initialize from snapshot (this should replicate the functionality | 229 // Initialize from snapshot (this should replicate the functionality |
| 227 // of Object::Init(..) in a regular isolate creation path. | 230 // of Object::Init(..) in a regular isolate creation path. |
| 228 Object::InitFromSnapshot(isolate); | 231 Object::InitFromSnapshot(isolate); |
| 229 | 232 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 252 } | 255 } |
| 253 isolate->megamorphic_cache_table()->InitMissHandler(); | 256 isolate->megamorphic_cache_table()->InitMissHandler(); |
| 254 | 257 |
| 255 isolate->heap()->EnableGrowthControl(); | 258 isolate->heap()->EnableGrowthControl(); |
| 256 isolate->set_init_callback_data(data); | 259 isolate->set_init_callback_data(data); |
| 257 Api::SetupAcquiredError(isolate); | 260 Api::SetupAcquiredError(isolate); |
| 258 if (FLAG_print_class_table) { | 261 if (FLAG_print_class_table) { |
| 259 isolate->class_table()->Print(); | 262 isolate->class_table()->Print(); |
| 260 } | 263 } |
| 261 | 264 |
| 262 // Setup for profiling. | |
| 263 Profiler::InitProfilingForIsolate(isolate); | |
| 264 | 265 |
| 265 Service::SendIsolateStartupMessage(); | 266 Service::SendIsolateStartupMessage(); |
| 266 // Create tag table. | 267 // Create tag table. |
| 267 isolate->set_tag_table( | 268 isolate->set_tag_table( |
| 268 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 269 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
| 269 return Error::null(); | 270 return Error::null(); |
| 270 } | 271 } |
| 271 | 272 |
| 272 | 273 |
| 273 void Dart::RunShutdownCallback() { | 274 void Dart::RunShutdownCallback() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 294 return predefined_handles_->handles_.AllocateScopedHandle(); | 295 return predefined_handles_->handles_.AllocateScopedHandle(); |
| 295 } | 296 } |
| 296 | 297 |
| 297 | 298 |
| 298 bool Dart::IsReadOnlyHandle(uword address) { | 299 bool Dart::IsReadOnlyHandle(uword address) { |
| 299 ASSERT(predefined_handles_ != NULL); | 300 ASSERT(predefined_handles_ != NULL); |
| 300 return predefined_handles_->handles_.IsValidScopedHandle(address); | 301 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 301 } | 302 } |
| 302 | 303 |
| 303 } // namespace dart | 304 } // namespace dart |
| OLD | NEW |