| 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/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 }; | 2447 }; |
| 2448 | 2448 |
| 2449 | 2449 |
| 2450 static bool ReloadSources(Thread* thread, JSONStream* js) { | 2450 static bool ReloadSources(Thread* thread, JSONStream* js) { |
| 2451 Isolate* isolate = thread->isolate(); | 2451 Isolate* isolate = thread->isolate(); |
| 2452 if (!isolate->compilation_allowed()) { | 2452 if (!isolate->compilation_allowed()) { |
| 2453 js->PrintError(kFeatureDisabled, | 2453 js->PrintError(kFeatureDisabled, |
| 2454 "Cannot reload source when running a precompiled program."); | 2454 "Cannot reload source when running a precompiled program."); |
| 2455 return true; | 2455 return true; |
| 2456 } | 2456 } |
| 2457 if (Dart::snapshot_kind() == Snapshot::kAppWithJIT) { | |
| 2458 js->PrintError(kFeatureDisabled, | |
| 2459 "Cannot reload source when running an app snapshot."); | |
| 2460 return true; | |
| 2461 } | |
| 2462 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); | 2457 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); |
| 2463 if (handler == NULL) { | 2458 if (handler == NULL) { |
| 2464 js->PrintError(kFeatureDisabled, | 2459 js->PrintError(kFeatureDisabled, |
| 2465 "A library tag handler must be installed."); | 2460 "A library tag handler must be installed."); |
| 2466 return true; | 2461 return true; |
| 2467 } | 2462 } |
| 2468 if ((isolate->sticky_error() != Error::null()) || | 2463 if ((isolate->sticky_error() != Error::null()) || |
| 2469 (Thread::Current()->sticky_error() != Error::null())) { | 2464 (Thread::Current()->sticky_error() != Error::null())) { |
| 2470 js->PrintError(kIsolateReloadBarred, | 2465 js->PrintError(kIsolateReloadBarred, |
| 2471 "This isolate cannot reload sources anymore because there " | 2466 "This isolate cannot reload sources anymore because there " |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4072 if (strcmp(method_name, method.name) == 0) { | 4067 if (strcmp(method_name, method.name) == 0) { |
| 4073 return &method; | 4068 return &method; |
| 4074 } | 4069 } |
| 4075 } | 4070 } |
| 4076 return NULL; | 4071 return NULL; |
| 4077 } | 4072 } |
| 4078 | 4073 |
| 4079 #endif // !PRODUCT | 4074 #endif // !PRODUCT |
| 4080 | 4075 |
| 4081 } // namespace dart | 4076 } // namespace dart |
| OLD | NEW |