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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); | 201 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
202 if (snapshot == NULL) { | 202 if (snapshot == NULL) { |
203 return strdup("Invalid vm isolate snapshot seen"); | 203 return strdup("Invalid vm isolate snapshot seen"); |
204 } | 204 } |
205 vm_snapshot_kind_ = snapshot->kind(); | 205 vm_snapshot_kind_ = snapshot->kind(); |
206 | 206 |
207 if (Snapshot::IncludesCode(vm_snapshot_kind_)) { | 207 if (Snapshot::IncludesCode(vm_snapshot_kind_)) { |
208 if (vm_snapshot_kind_ == Snapshot::kFullAOT) { | 208 if (vm_snapshot_kind_ == Snapshot::kFullAOT) { |
209 #if defined(DART_PRECOMPILED_RUNTIME) | 209 #if defined(DART_PRECOMPILED_RUNTIME) |
210 vm_isolate_->set_compilation_allowed(false); | 210 vm_isolate_->set_compilation_allowed(false); |
211 if (!FLAG_precompiled_runtime) { | |
212 return strdup("Flag --precompilation was not specified"); | |
213 } | |
214 #else | 211 #else |
215 return strdup("JIT runtime cannot run a precompiled snapshot"); | 212 return strdup("JIT runtime cannot run a precompiled snapshot"); |
216 #endif | 213 #endif |
217 } | 214 } |
218 if (instructions_snapshot == NULL) { | 215 if (instructions_snapshot == NULL) { |
219 return strdup("Missing instructions snapshot"); | 216 return strdup("Missing instructions snapshot"); |
220 } | 217 } |
221 } else if (Snapshot::IsFull(vm_snapshot_kind_)) { | 218 } else if (Snapshot::IsFull(vm_snapshot_kind_)) { |
222 #if defined(DART_PRECOMPILED_RUNTIME) | 219 #if defined(DART_PRECOMPILED_RUNTIME) |
223 return strdup("Precompiled runtime requires a precompiled snapshot"); | 220 return strdup("Precompiled runtime requires a precompiled snapshot"); |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 return predefined_handles_->handles_.IsValidScopedHandle(address); | 764 return predefined_handles_->handles_.IsValidScopedHandle(address); |
768 } | 765 } |
769 | 766 |
770 | 767 |
771 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 768 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
772 ASSERT(predefined_handles_ != NULL); | 769 ASSERT(predefined_handles_ != NULL); |
773 return predefined_handles_->api_handles_.IsValidHandle(handle); | 770 return predefined_handles_->api_handles_.IsValidHandle(handle); |
774 } | 771 } |
775 | 772 |
776 } // namespace dart | 773 } // namespace dart |
OLD | NEW |