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 | 5 |
6 #include "bin/loader.h" | 6 #include "bin/loader.h" |
7 | 7 |
8 #include "bin/builtin.h" | 8 #include "bin/builtin.h" |
9 #include "bin/dartutils.h" | 9 #include "bin/dartutils.h" |
10 #include "bin/extensions.h" | 10 #include "bin/extensions.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 } | 645 } |
646 Dart_Handle library_url = Dart_LibraryUrl(library); | 646 Dart_Handle library_url = Dart_LibraryUrl(library); |
647 if (Dart_IsError(library_url)) { | 647 if (Dart_IsError(library_url)) { |
648 return library_url; | 648 return library_url; |
649 } | 649 } |
650 } | 650 } |
651 | 651 |
652 IsolateData* isolate_data = | 652 IsolateData* isolate_data = |
653 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); | 653 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); |
654 ASSERT(isolate_data != NULL); | 654 ASSERT(isolate_data != NULL); |
655 | 655 if ((tag == Dart_kScriptTag) && Dart_IsString(library)) { |
| 656 // Update packages file for isolate. |
| 657 const char* packages_file = NULL; |
| 658 Dart_Handle result = Dart_StringToCString(library, &packages_file); |
| 659 if (Dart_IsError(result)) { |
| 660 return result; |
| 661 } |
| 662 isolate_data->UpdatePackagesFile(packages_file); |
| 663 } |
656 // Grab this isolate's loader. | 664 // Grab this isolate's loader. |
657 Loader* loader = NULL; | 665 Loader* loader = NULL; |
658 | 666 |
659 // The outer invocation of the tag handler for this isolate. We make the outer | 667 // The outer invocation of the tag handler for this isolate. We make the outer |
660 // invocation block and allow any nested invocations to operate in parallel. | 668 // invocation block and allow any nested invocations to operate in parallel. |
661 const bool blocking_call = !isolate_data->HasLoader(); | 669 const bool blocking_call = !isolate_data->HasLoader(); |
662 | 670 |
663 // If we are the outer invocation of the tag handler and the tag is an import | 671 // If we are the outer invocation of the tag handler and the tag is an import |
664 // this means that we are starting a deferred library load. | 672 // this means that we are starting a deferred library load. |
665 const bool is_deferred_import = blocking_call && (tag == Dart_kImportTag); | 673 const bool is_deferred_import = blocking_call && (tag == Dart_kImportTag); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 MutexLocker ml(loader_infos_lock_); | 871 MutexLocker ml(loader_infos_lock_); |
864 Loader* loader = LoaderForLocked(dest_port_id); | 872 Loader* loader = LoaderForLocked(dest_port_id); |
865 if (loader == NULL) { | 873 if (loader == NULL) { |
866 return; | 874 return; |
867 } | 875 } |
868 loader->QueueMessage(message); | 876 loader->QueueMessage(message); |
869 } | 877 } |
870 | 878 |
871 } // namespace bin | 879 } // namespace bin |
872 } // namespace dart | 880 } // namespace dart |
OLD | NEW |