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

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

Issue 867113003: Revert r43217, r43215, r43208, r43207, and r43202. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 75
76 const char* Dart::InitOnce(Dart_IsolateCreateCallback create, 76 const char* Dart::InitOnce(Dart_IsolateCreateCallback create,
77 Dart_IsolateInterruptCallback interrupt, 77 Dart_IsolateInterruptCallback interrupt,
78 Dart_IsolateUnhandledExceptionCallback unhandled, 78 Dart_IsolateUnhandledExceptionCallback unhandled,
79 Dart_IsolateShutdownCallback shutdown, 79 Dart_IsolateShutdownCallback shutdown,
80 Dart_FileOpenCallback file_open, 80 Dart_FileOpenCallback file_open,
81 Dart_FileReadCallback file_read, 81 Dart_FileReadCallback file_read,
82 Dart_FileWriteCallback file_write, 82 Dart_FileWriteCallback file_write,
83 Dart_FileCloseCallback file_close, 83 Dart_FileCloseCallback file_close,
84 Dart_EntropySource entropy_source) { 84 Dart_EntropySource entropy_source,
85 Dart_ServiceIsolateCreateCalback service_create) {
85 // TODO(iposva): Fix race condition here. 86 // TODO(iposva): Fix race condition here.
86 if (vm_isolate_ != NULL || !Flags::Initialized()) { 87 if (vm_isolate_ != NULL || !Flags::Initialized()) {
87 return "VM already initialized or flags not initialized."; 88 return "VM already initialized or flags not initialized.";
88 } 89 }
89 Isolate::SetFileCallbacks(file_open, file_read, file_write, file_close); 90 Isolate::SetFileCallbacks(file_open, file_read, file_write, file_close);
90 Isolate::SetEntropySourceCallback(entropy_source); 91 Isolate::SetEntropySourceCallback(entropy_source);
91 OS::InitOnce(); 92 OS::InitOnce();
92 VirtualMemory::InitOnce(); 93 VirtualMemory::InitOnce();
93 Isolate::InitOnce(); 94 Isolate::InitOnce();
94 PortMap::InitOnce(); 95 PortMap::InitOnce();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 Object::FinalizeVMIsolate(vm_isolate_); 136 Object::FinalizeVMIsolate(vm_isolate_);
136 } 137 }
137 // There is a planned and known asymmetry here: We enter one scope for the VM 138 // There is a planned and known asymmetry here: We enter one scope for the VM
138 // isolate so that we can allocate the "persistent" scoped handles for the 139 // isolate so that we can allocate the "persistent" scoped handles for the
139 // predefined API values (such as Dart_True, Dart_False and Dart_Null). 140 // predefined API values (such as Dart_True, Dart_False and Dart_Null).
140 Dart_EnterScope(); 141 Dart_EnterScope();
141 Api::InitHandles(); 142 Api::InitHandles();
142 143
143 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. 144 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread.
144 Isolate::SetCreateCallback(create); 145 Isolate::SetCreateCallback(create);
146 Isolate::SetServiceCreateCallback(service_create);
145 Isolate::SetInterruptCallback(interrupt); 147 Isolate::SetInterruptCallback(interrupt);
146 Isolate::SetUnhandledExceptionCallback(unhandled); 148 Isolate::SetUnhandledExceptionCallback(unhandled);
147 Isolate::SetShutdownCallback(shutdown); 149 Isolate::SetShutdownCallback(shutdown);
148
149 Service::RunService();
150
151 return NULL; 150 return NULL;
152 } 151 }
153 152
154 153
155 const char* Dart::Cleanup() { 154 const char* Dart::Cleanup() {
156 #if 0 155 #if 0
157 // Ideally we should shutdown the VM isolate here, but the thread pool 156 // Ideally we should shutdown the VM isolate here, but the thread pool
158 // shutdown does not seem to ensure that all the threads have stopped 157 // shutdown does not seem to ensure that all the threads have stopped
159 // execution before it terminates, this results in racing isolates. 158 // execution before it terminates, this results in racing isolates.
160 if (vm_isolate_ == NULL) { 159 if (vm_isolate_ == NULL) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 } 253 }
255 isolate->megamorphic_cache_table()->InitMissHandler(); 254 isolate->megamorphic_cache_table()->InitMissHandler();
256 255
257 isolate->heap()->EnableGrowthControl(); 256 isolate->heap()->EnableGrowthControl();
258 isolate->set_init_callback_data(data); 257 isolate->set_init_callback_data(data);
259 Api::SetupAcquiredError(isolate); 258 Api::SetupAcquiredError(isolate);
260 if (FLAG_print_class_table) { 259 if (FLAG_print_class_table) {
261 isolate->class_table()->Print(); 260 isolate->class_table()->Print();
262 } 261 }
263 262
264 Service::MaybeInjectVMServiceLibrary(isolate); 263 isolate->debugger()->NotifyIsolateCreated();
265
266 Service::SendIsolateStartupMessage(); 264 Service::SendIsolateStartupMessage();
267 isolate->debugger()->NotifyIsolateCreated();
268
269 // Create tag table. 265 // Create tag table.
270 isolate->set_tag_table( 266 isolate->set_tag_table(
271 GrowableObjectArray::Handle(GrowableObjectArray::New())); 267 GrowableObjectArray::Handle(GrowableObjectArray::New()));
272 // Set up default UserTag. 268 // Set up default UserTag.
273 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); 269 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag());
274 isolate->set_current_tag(default_tag); 270 isolate->set_current_tag(default_tag);
275 271
276 return Error::null(); 272 return Error::null();
277 } 273 }
278 274
(...skipping 22 matching lines...) Expand all
301 return predefined_handles_->handles_.AllocateScopedHandle(); 297 return predefined_handles_->handles_.AllocateScopedHandle();
302 } 298 }
303 299
304 300
305 bool Dart::IsReadOnlyHandle(uword address) { 301 bool Dart::IsReadOnlyHandle(uword address) {
306 ASSERT(predefined_handles_ != NULL); 302 ASSERT(predefined_handles_ != NULL);
307 return predefined_handles_->handles_.IsValidScopedHandle(address); 303 return predefined_handles_->handles_.IsValidScopedHandle(address);
308 } 304 }
309 305
310 } // namespace dart 306 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698