Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Side by Side Diff: runtime/vm/dart.cc

Issue 1168933002: Fixes crashes in VM isolate shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add asserts Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 Dart_IsolateFlags api_flags; 124 Dart_IsolateFlags api_flags;
125 vm_flags.CopyTo(&api_flags); 125 vm_flags.CopyTo(&api_flags);
126 vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate); 126 vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate);
127 127
128 StackZone zone(vm_isolate_); 128 StackZone zone(vm_isolate_);
129 HandleScope handle_scope(vm_isolate_); 129 HandleScope handle_scope(vm_isolate_);
130 Heap::Init(vm_isolate_, 130 Heap::Init(vm_isolate_,
131 0, // New gen size 0; VM isolate should only allocate in old. 131 0, // New gen size 0; VM isolate should only allocate in old.
132 FLAG_old_gen_heap_size * MBInWords, 132 FLAG_old_gen_heap_size * MBInWords,
133 FLAG_external_max_size * MBInWords); 133 FLAG_external_max_size * MBInWords);
134 Object::InitNull(vm_isolate_);
134 ObjectStore::Init(vm_isolate_); 135 ObjectStore::Init(vm_isolate_);
135 TargetCPUFeatures::InitOnce(); 136 TargetCPUFeatures::InitOnce();
136 Object::InitOnce(vm_isolate_); 137 Object::InitOnce(vm_isolate_);
137 ArgumentsDescriptor::InitOnce(); 138 ArgumentsDescriptor::InitOnce();
138 StubCode::InitOnce(); 139 StubCode::InitOnce();
139 // Now that the needed stub has been generated, set the stack limit. 140 // Now that the needed stub has been generated, set the stack limit.
140 vm_isolate_->InitializeStackLimit(); 141 vm_isolate_->InitializeStackLimit();
141 if (vm_isolate_snapshot != NULL) { 142 if (vm_isolate_snapshot != NULL) {
142 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); 143 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
143 if (snapshot == NULL) { 144 if (snapshot == NULL) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 isolate->heap()->EnableGrowthControl(); 309 isolate->heap()->EnableGrowthControl();
309 isolate->set_init_callback_data(data); 310 isolate->set_init_callback_data(data);
310 Api::SetupAcquiredError(isolate); 311 Api::SetupAcquiredError(isolate);
311 if (FLAG_print_class_table) { 312 if (FLAG_print_class_table) {
312 isolate->class_table()->Print(); 313 isolate->class_table()->Print();
313 } 314 }
314 315
315 ServiceIsolate::MaybeInjectVMServiceLibrary(isolate); 316 ServiceIsolate::MaybeInjectVMServiceLibrary(isolate);
316 317
317 ServiceIsolate::SendIsolateStartupMessage(); 318 ServiceIsolate::SendIsolateStartupMessage();
319 ASSERT(isolate->debugger() != NULL);
318 isolate->debugger()->NotifyIsolateCreated(); 320 isolate->debugger()->NotifyIsolateCreated();
319 321
320 // Create tag table. 322 // Create tag table.
321 isolate->set_tag_table( 323 isolate->set_tag_table(
322 GrowableObjectArray::Handle(GrowableObjectArray::New())); 324 GrowableObjectArray::Handle(GrowableObjectArray::New()));
323 // Set up default UserTag. 325 // Set up default UserTag.
324 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); 326 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag());
325 isolate->set_current_tag(default_tag); 327 isolate->set_current_tag(default_tag);
326 328
327 if (FLAG_keep_code) { 329 if (FLAG_keep_code) {
(...skipping 28 matching lines...) Expand all
356 return predefined_handles_->handles_.AllocateScopedHandle(); 358 return predefined_handles_->handles_.AllocateScopedHandle();
357 } 359 }
358 360
359 361
360 bool Dart::IsReadOnlyHandle(uword address) { 362 bool Dart::IsReadOnlyHandle(uword address) {
361 ASSERT(predefined_handles_ != NULL); 363 ASSERT(predefined_handles_ != NULL);
362 return predefined_handles_->handles_.IsValidScopedHandle(address); 364 return predefined_handles_->handles_.IsValidScopedHandle(address);
363 } 365 }
364 366
365 } // namespace dart 367 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698