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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 case Dart_kSourceTag: { | 363 case Dart_kSourceTag: { |
364 ASSERT(library_uri != Dart_Null()); | 364 ASSERT(library_uri != Dart_Null()); |
365 Dart_Handle library = Dart_LookupLibrary(library_uri); | 365 Dart_Handle library = Dart_LookupLibrary(library_uri); |
366 ASSERT(!Dart_IsError(library)); | 366 ASSERT(!Dart_IsError(library)); |
367 dart_result = Dart_LoadSource(library, uri, resolved_uri, source, 0, 0); | 367 dart_result = Dart_LoadSource(library, uri, resolved_uri, source, 0, 0); |
368 } break; | 368 } break; |
369 case Dart_kScriptTag: | 369 case Dart_kScriptTag: |
370 if (payload_type == DartUtils::kSnapshotMagicNumber) { | 370 if (payload_type == DartUtils::kSnapshotMagicNumber) { |
371 dart_result = Dart_LoadScriptFromSnapshot(payload, payload_length); | 371 dart_result = Dart_LoadScriptFromSnapshot(payload, payload_length); |
372 reload_extensions = true; | 372 reload_extensions = true; |
373 } else if (payload_type == DartUtils::kKernelMagicNumber) { | |
374 dart_result = Dart_LoadKernel(payload, payload_length); | |
375 } else { | 373 } else { |
376 dart_result = Dart_LoadScript(uri, resolved_uri, source, 0, 0); | 374 dart_result = Dart_LoadScript(uri, resolved_uri, source, 0, 0); |
377 } | 375 } |
378 break; | 376 break; |
379 default: | 377 default: |
380 UNREACHABLE(); | 378 UNREACHABLE(); |
381 } | 379 } |
382 | 380 |
383 // Re-acquire the lock before exiting the function (it was held before entry), | 381 // Re-acquire the lock before exiting the function (it was held before entry), |
384 loader->monitor_->Enter(); | 382 loader->monitor_->Enter(); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 MutexLocker ml(loader_infos_lock_); | 793 MutexLocker ml(loader_infos_lock_); |
796 Loader* loader = LoaderForLocked(dest_port_id); | 794 Loader* loader = LoaderForLocked(dest_port_id); |
797 if (loader == NULL) { | 795 if (loader == NULL) { |
798 return; | 796 return; |
799 } | 797 } |
800 loader->QueueMessage(message); | 798 loader->QueueMessage(message); |
801 } | 799 } |
802 | 800 |
803 } // namespace bin | 801 } // namespace bin |
804 } // namespace dart | 802 } // namespace dart |
OLD | NEW |