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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); | 196 const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot); |
197 if (snapshot == NULL) { | 197 if (snapshot == NULL) { |
198 return strdup("Invalid vm isolate snapshot seen"); | 198 return strdup("Invalid vm isolate snapshot seen"); |
199 } | 199 } |
200 vm_snapshot_kind_ = snapshot->kind(); | 200 vm_snapshot_kind_ = snapshot->kind(); |
201 | 201 |
202 if (Snapshot::IncludesCode(vm_snapshot_kind_)) { | 202 if (Snapshot::IncludesCode(vm_snapshot_kind_)) { |
203 if (vm_snapshot_kind_ == Snapshot::kFullAOT) { | 203 if (vm_snapshot_kind_ == Snapshot::kFullAOT) { |
204 #if defined(DART_PRECOMPILED_RUNTIME) | 204 #if defined(DART_PRECOMPILED_RUNTIME) |
205 vm_isolate_->set_compilation_allowed(false); | 205 vm_isolate_->set_compilation_allowed(false); |
| 206 if (!FLAG_precompiled_runtime) { |
| 207 return strdup("Flag --precompilation was not specified"); |
| 208 } |
206 #else | 209 #else |
207 return strdup("JIT runtime cannot run a precompiled snapshot"); | 210 return strdup("JIT runtime cannot run a precompiled snapshot"); |
208 #endif | 211 #endif |
209 } | 212 } |
210 if (instructions_snapshot == NULL) { | 213 if (instructions_snapshot == NULL) { |
211 return strdup("Missing instructions snapshot"); | 214 return strdup("Missing instructions snapshot"); |
212 } | 215 } |
213 } else if (Snapshot::IsFull(vm_snapshot_kind_)) { | 216 } else if (Snapshot::IsFull(vm_snapshot_kind_)) { |
214 #if defined(DART_PRECOMPILED_RUNTIME) | 217 #if defined(DART_PRECOMPILED_RUNTIME) |
215 return strdup("Precompiled runtime requires a precompiled snapshot"); | 218 return strdup("Precompiled runtime requires a precompiled snapshot"); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |