| 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/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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 Dart_FileReadCallback file_read, | 132 Dart_FileReadCallback file_read, |
| 133 Dart_FileWriteCallback file_write, | 133 Dart_FileWriteCallback file_write, |
| 134 Dart_FileCloseCallback file_close, | 134 Dart_FileCloseCallback file_close, |
| 135 Dart_EntropySource entropy_source, | 135 Dart_EntropySource entropy_source, |
| 136 Dart_GetVMServiceAssetsArchive get_service_assets) { | 136 Dart_GetVMServiceAssetsArchive get_service_assets) { |
| 137 CheckOffsets(); | 137 CheckOffsets(); |
| 138 // TODO(iposva): Fix race condition here. | 138 // TODO(iposva): Fix race condition here. |
| 139 if (vm_isolate_ != NULL || !Flags::Initialized()) { | 139 if (vm_isolate_ != NULL || !Flags::Initialized()) { |
| 140 return strdup("VM already initialized or flags not initialized."); | 140 return strdup("VM already initialized or flags not initialized."); |
| 141 } | 141 } |
| 142 #if defined(DEBUG) |
| 143 // Turn on verify_gc_contains if any of the other GC verification flag |
| 144 // is turned on. |
| 145 if (FLAG_verify_before_gc || FLAG_verify_after_gc || |
| 146 FLAG_verify_on_transition) { |
| 147 FLAG_verify_gc_contains = true; |
| 148 } |
| 149 #endif |
| 142 set_thread_exit_callback(thread_exit); | 150 set_thread_exit_callback(thread_exit); |
| 143 SetFileCallbacks(file_open, file_read, file_write, file_close); | 151 SetFileCallbacks(file_open, file_read, file_write, file_close); |
| 144 set_entropy_source_callback(entropy_source); | 152 set_entropy_source_callback(entropy_source); |
| 145 OS::InitOnce(); | 153 OS::InitOnce(); |
| 146 start_time_micros_ = OS::GetCurrentMonotonicMicros(); | 154 start_time_micros_ = OS::GetCurrentMonotonicMicros(); |
| 147 VirtualMemory::InitOnce(); | 155 VirtualMemory::InitOnce(); |
| 148 OSThread::InitOnce(); | 156 OSThread::InitOnce(); |
| 149 if (FLAG_support_timeline) { | 157 if (FLAG_support_timeline) { |
| 150 Timeline::InitOnce(); | 158 Timeline::InitOnce(); |
| 151 } | 159 } |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 return predefined_handles_->handles_.IsValidScopedHandle(address); | 749 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 742 } | 750 } |
| 743 | 751 |
| 744 | 752 |
| 745 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
| 746 ASSERT(predefined_handles_ != NULL); | 754 ASSERT(predefined_handles_ != NULL); |
| 747 return predefined_handles_->api_handles_.IsValidHandle(handle); | 755 return predefined_handles_->api_handles_.IsValidHandle(handle); |
| 748 } | 756 } |
| 749 | 757 |
| 750 } // namespace dart | 758 } // namespace dart |
| OLD | NEW |