OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 "bin/loader.h" | 5 #include "bin/loader.h" |
6 | 6 |
7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
8 #include "bin/dartutils.h" | 8 #include "bin/dartutils.h" |
9 #include "bin/dfe.h" | 9 #include "bin/dfe.h" |
10 #include "bin/extensions.h" | 10 #include "bin/extensions.h" |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 return library_url; | 628 return library_url; |
629 } | 629 } |
630 return Dart_DefaultCanonicalizeUrl(library_url, url); | 630 return Dart_DefaultCanonicalizeUrl(library_url, url); |
631 } | 631 } |
632 const char* url_string = NULL; | 632 const char* url_string = NULL; |
633 Dart_Handle result = Dart_StringToCString(url, &url_string); | 633 Dart_Handle result = Dart_StringToCString(url, &url_string); |
634 if (Dart_IsError(result)) { | 634 if (Dart_IsError(result)) { |
635 return result; | 635 return result; |
636 } | 636 } |
637 if (tag == Dart_kScriptTag) { | 637 if (tag == Dart_kScriptTag) { |
638 if (dfe.UseDartFrontend()) { | 638 if (dfe.UseDartFrontend() || dfe.kernel_file_specified()) { |
639 Dart_Isolate current = Dart_CurrentIsolate(); | 639 Dart_Isolate current = Dart_CurrentIsolate(); |
640 // Check if we are trying to reload a kernel file or if the '--dfe' | 640 // Check if we are trying to reload a kernel file or if the '--dfe' |
641 // option was specified and we need to compile sources using DFE. | 641 // option was specified and we need to compile sources using DFE. |
642 if (!Dart_IsServiceIsolate(current) && !Dart_IsKernelIsolate(current)) { | 642 if (!Dart_IsServiceIsolate(current) && !Dart_IsKernelIsolate(current)) { |
643 // When using DFE the library tag handler should be called only when | 643 // When using DFE the library tag handler should be called only when |
644 // we are reloading scripts. | 644 // we are reloading scripts. |
645 return dfe.ReloadScript(current, url_string); | 645 return dfe.ReloadScript(current, url_string); |
646 } | 646 } |
647 } | 647 } |
648 // TODO(asiva) We need to ensure that the kernel and service isolates | 648 // TODO(asiva) We need to ensure that the kernel and service isolates |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 MutexLocker ml(loader_infos_lock_); | 895 MutexLocker ml(loader_infos_lock_); |
896 Loader* loader = LoaderForLocked(dest_port_id); | 896 Loader* loader = LoaderForLocked(dest_port_id); |
897 if (loader == NULL) { | 897 if (loader == NULL) { |
898 return; | 898 return; |
899 } | 899 } |
900 loader->QueueMessage(message); | 900 loader->QueueMessage(message); |
901 } | 901 } |
902 | 902 |
903 } // namespace bin | 903 } // namespace bin |
904 } // namespace dart | 904 } // namespace dart |
OLD | NEW |