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

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

Issue 2995723002: - Convert all isolate flags to a bit field. (Closed)
Patch Set: Address build error. Created 3 years, 4 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
« 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/become.h" 7 #include "vm/become.h"
8 #include "vm/clustered_snapshot.h" 8 #include "vm/clustered_snapshot.h"
9 #include "vm/code_observers.h" 9 #include "vm/code_observers.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 const uint8_t* instructions_snapshot, 111 const uint8_t* instructions_snapshot,
112 Dart_IsolateCreateCallback create, 112 Dart_IsolateCreateCallback create,
113 Dart_IsolateShutdownCallback shutdown, 113 Dart_IsolateShutdownCallback shutdown,
114 Dart_IsolateCleanupCallback cleanup, 114 Dart_IsolateCleanupCallback cleanup,
115 Dart_ThreadExitCallback thread_exit, 115 Dart_ThreadExitCallback thread_exit,
116 Dart_FileOpenCallback file_open, 116 Dart_FileOpenCallback file_open,
117 Dart_FileReadCallback file_read, 117 Dart_FileReadCallback file_read,
118 Dart_FileWriteCallback file_write, 118 Dart_FileWriteCallback file_write,
119 Dart_FileCloseCallback file_close, 119 Dart_FileCloseCallback file_close,
120 Dart_EntropySource entropy_source, 120 Dart_EntropySource entropy_source,
121 Dart_GetVMServiceAssetsArchive get_service_assets) { 121 Dart_GetVMServiceAssetsArchive get_service_assets,
122 bool start_kernel_isolate) {
122 CheckOffsets(); 123 CheckOffsets();
123 // TODO(iposva): Fix race condition here. 124 // TODO(iposva): Fix race condition here.
124 if (vm_isolate_ != NULL || !Flags::Initialized()) { 125 if (vm_isolate_ != NULL || !Flags::Initialized()) {
125 return strdup("VM already initialized or flags not initialized."); 126 return strdup("VM already initialized or flags not initialized.");
126 } 127 }
127 #if defined(DEBUG) 128 #if defined(DEBUG)
128 // Turn on verify_gc_contains if any of the other GC verification flag 129 // Turn on verify_gc_contains if any of the other GC verification flag
129 // is turned on. 130 // is turned on.
130 if (FLAG_verify_before_gc || FLAG_verify_after_gc || 131 if (FLAG_verify_before_gc || FLAG_verify_after_gc ||
131 FLAG_verify_on_transition) { 132 FLAG_verify_on_transition) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 Isolate::SetShutdownCallback(shutdown); 301 Isolate::SetShutdownCallback(shutdown);
301 Isolate::SetCleanupCallback(cleanup); 302 Isolate::SetCleanupCallback(cleanup);
302 303
303 if (FLAG_support_service) { 304 if (FLAG_support_service) {
304 Service::SetGetServiceAssetsCallback(get_service_assets); 305 Service::SetGetServiceAssetsCallback(get_service_assets);
305 } 306 }
306 307
307 ServiceIsolate::Run(); 308 ServiceIsolate::Run();
308 309
309 #ifndef DART_PRECOMPILED_RUNTIME 310 #ifndef DART_PRECOMPILED_RUNTIME
310 KernelIsolate::Run(); 311 if (start_kernel_isolate) {
312 KernelIsolate::Run();
313 }
311 #endif // DART_PRECOMPILED_RUNTIME 314 #endif // DART_PRECOMPILED_RUNTIME
312 315
313 return NULL; 316 return NULL;
314 } 317 }
315 318
316 // This waits until only the VM isolate and the service isolate remains in the 319 // This waits until only the VM isolate and the service isolate remains in the
317 // list, i.e. list length == 2. 320 // list, i.e. list length == 2.
318 void Dart::WaitForApplicationIsolateShutdown() { 321 void Dart::WaitForApplicationIsolateShutdown() {
319 ASSERT(!Isolate::creation_enabled_); 322 ASSERT(!Isolate::creation_enabled_);
320 MonitorLocker ml(Isolate::isolates_list_monitor_); 323 MonitorLocker ml(Isolate::isolates_list_monitor_);
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 ASSERT(predefined_handles_ != NULL); 751 ASSERT(predefined_handles_ != NULL);
749 return predefined_handles_->handles_.IsValidScopedHandle(address); 752 return predefined_handles_->handles_.IsValidScopedHandle(address);
750 } 753 }
751 754
752 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 755 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
753 ASSERT(predefined_handles_ != NULL); 756 ASSERT(predefined_handles_ != NULL);
754 return predefined_handles_->api_handles_.IsValidHandle(handle); 757 return predefined_handles_->api_handles_.IsValidHandle(handle);
755 } 758 }
756 759
757 } // namespace dart 760 } // 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