| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 } break; | 424 } break; |
| 425 case Dart_kScriptTag: | 425 case Dart_kScriptTag: |
| 426 if (payload_type == DartUtils::kSnapshotMagicNumber) { | 426 if (payload_type == DartUtils::kSnapshotMagicNumber) { |
| 427 dart_result = Dart_LoadScriptFromSnapshot(payload, payload_length); | 427 dart_result = Dart_LoadScriptFromSnapshot(payload, payload_length); |
| 428 reload_extensions = true; | 428 reload_extensions = true; |
| 429 } else if (payload_type == DartUtils::kKernelMagicNumber) { | 429 } else if (payload_type == DartUtils::kKernelMagicNumber) { |
| 430 // TODO(27590): This code path is only hit when trying to spawn | 430 // TODO(27590): This code path is only hit when trying to spawn |
| 431 // isolates. We currently do not have support for neither | 431 // isolates. We currently do not have support for neither |
| 432 // `Isolate.spawn()` nor `Isolate.spawnUri()` with kernel-based | 432 // `Isolate.spawn()` nor `Isolate.spawnUri()` with kernel-based |
| 433 // frontend. | 433 // frontend. |
| 434 void* kernel_binary = Dart_ReadKernelBinary(payload, payload_length); | 434 Dart_Handle kernel_binary = reinterpret_cast<Dart_Handle>( |
| 435 dart_result = Dart_LoadKernel(kernel_binary); | 435 Dart_ReadKernelBinary(payload, payload_length)); |
| 436 dart_result = Dart_LoadScript(uri, resolved_uri, kernel_binary, 0, 0); |
| 436 } else { | 437 } else { |
| 437 dart_result = Dart_LoadScript(uri, resolved_uri, source, 0, 0); | 438 dart_result = Dart_LoadScript(uri, resolved_uri, source, 0, 0); |
| 438 } | 439 } |
| 439 break; | 440 break; |
| 440 default: | 441 default: |
| 441 UNREACHABLE(); | 442 UNREACHABLE(); |
| 442 } | 443 } |
| 443 | 444 |
| 444 // Re-acquire the lock before exiting the function (it was held before entry), | 445 // Re-acquire the lock before exiting the function (it was held before entry), |
| 445 loader->monitor_->Enter(); | 446 loader->monitor_->Enter(); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 MutexLocker ml(loader_infos_lock_); | 895 MutexLocker ml(loader_infos_lock_); |
| 895 Loader* loader = LoaderForLocked(dest_port_id); | 896 Loader* loader = LoaderForLocked(dest_port_id); |
| 896 if (loader == NULL) { | 897 if (loader == NULL) { |
| 897 return; | 898 return; |
| 898 } | 899 } |
| 899 loader->QueueMessage(message); | 900 loader->QueueMessage(message); |
| 900 } | 901 } |
| 901 | 902 |
| 902 } // namespace bin | 903 } // namespace bin |
| 903 } // namespace dart | 904 } // namespace dart |
| OLD | NEW |