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

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

Issue 2651633002: VM: [Kernel] Fix bootstraping when Kernel isolate is used. (Closed)
Patch Set: Landing issue Created 3 years, 10 months 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/loader.h ('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 16 matching lines...) Expand all
27 error_(Dart_Null()), 27 error_(Dart_Null()),
28 monitor_(NULL), 28 monitor_(NULL),
29 pending_operations_(0), 29 pending_operations_(0),
30 results_(NULL), 30 results_(NULL),
31 results_length_(0), 31 results_length_(0),
32 results_capacity_(0), 32 results_capacity_(0),
33 payload_(NULL), 33 payload_(NULL),
34 payload_length_(0) { 34 payload_length_(0) {
35 monitor_ = new Monitor(); 35 monitor_ = new Monitor();
36 ASSERT(isolate_data_ != NULL); 36 ASSERT(isolate_data_ != NULL);
37 port_ = Dart_NewNativePort("Loader", Loader::NativeMessageHandler, false); 37 port_ =
38 Dart_NewNativePort("Loader", Loader::NativeMessageHandler, false, this);
38 isolate_data_->set_loader(this); 39 isolate_data_->set_loader(this);
39 AddLoader(port_, isolate_data_); 40 AddLoader(port_, isolate_data_);
40 } 41 }
41 42
42 43
43 Loader::~Loader() { 44 Loader::~Loader() {
44 ASSERT(port_ != ILLEGAL_PORT); 45 ASSERT(port_ != ILLEGAL_PORT);
45 // Enter the monitor while we close the Dart port. After the Dart port is 46 // Enter the monitor while we close the Dart port. After the Dart port is
46 // closed, no more results can be queued. 47 // closed, no more results can be queued.
47 monitor_->Enter(); 48 monitor_->Enter();
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 } 811 }
811 812
812 813
813 Loader* Loader::LoaderFor(Dart_Port port) { 814 Loader* Loader::LoaderFor(Dart_Port port) {
814 MutexLocker ml(loader_infos_lock_); 815 MutexLocker ml(loader_infos_lock_);
815 return LoaderForLocked(port); 816 return LoaderForLocked(port);
816 } 817 }
817 818
818 819
819 void Loader::NativeMessageHandler(Dart_Port dest_port_id, 820 void Loader::NativeMessageHandler(Dart_Port dest_port_id,
820 Dart_CObject* message) { 821 Dart_CObject* message,
822 void* peer) {
821 MutexLocker ml(loader_infos_lock_); 823 MutexLocker ml(loader_infos_lock_);
822 Loader* loader = LoaderForLocked(dest_port_id); 824 static_cast<Loader*>(peer)->QueueMessage(message);
823 if (loader == NULL) {
824 return;
825 }
826 loader->QueueMessage(message);
827 } 825 }
828 826
829 } // namespace bin 827 } // namespace bin
830 } // namespace dart 828 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/loader.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698