Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: runtime/bin/loader.cc

Issue 2525623002: VM: [Kernel] Split kernel API into 3 steps: ([read binary], parse-binary, bootstrap, load program) (Closed)
Patch Set: addressed comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698