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/vm/message_handler.cc

Issue 1423473004: Switch profiler from isolates to threads [second landing] (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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/vm/isolate.cc ('k') | runtime/vm/object.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/message_handler.h" 5 #include "vm/message_handler.h"
6 6
7 #include "vm/dart.h" 7 #include "vm/dart.h"
8 #include "vm/lockers.h" 8 #include "vm/lockers.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 177
178 MessageHandler::MessageStatus MessageHandler::HandleMessages( 178 MessageHandler::MessageStatus MessageHandler::HandleMessages(
179 bool allow_normal_messages, 179 bool allow_normal_messages,
180 bool allow_multiple_normal_messages) { 180 bool allow_multiple_normal_messages) {
181 // TODO(turnidge): Add assert that monitor_ is held here. 181 // TODO(turnidge): Add assert that monitor_ is held here.
182 182
183 // If isolate() returns NULL StartIsolateScope does nothing. 183 // If isolate() returns NULL StartIsolateScope does nothing.
184 StartIsolateScope start_isolate(isolate()); 184 StartIsolateScope start_isolate(isolate());
185 185
186 // ThreadInterrupter may have gone to sleep while waiting for
187 // an isolate to start handling messages.
188 ThreadInterrupter::WakeUp();
189
190 MessageStatus max_status = kOK; 186 MessageStatus max_status = kOK;
191 Message::Priority min_priority = ((allow_normal_messages && !paused()) 187 Message::Priority min_priority = ((allow_normal_messages && !paused())
192 ? Message::kNormalPriority 188 ? Message::kNormalPriority
193 : Message::kOOBPriority); 189 : Message::kOOBPriority);
194 Message* message = DequeueMessage(min_priority); 190 Message* message = DequeueMessage(min_priority);
195 while (message != NULL) { 191 while (message != NULL) {
196 intptr_t message_len = message->len(); 192 intptr_t message_len = message->len();
197 if (FLAG_trace_isolates) { 193 if (FLAG_trace_isolates) {
198 OS::Print("[<] Handling message:\n" 194 OS::Print("[<] Handling message:\n"
199 "\tlen: %" Pd "\n" 195 "\tlen: %" Pd "\n"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 471
476 472
477 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) { 473 void MessageHandler::AcquireQueues(AcquiredQueues* acquired_queues) {
478 ASSERT(acquired_queues != NULL); 474 ASSERT(acquired_queues != NULL);
479 // No double dipping. 475 // No double dipping.
480 ASSERT(acquired_queues->handler_ == NULL); 476 ASSERT(acquired_queues->handler_ == NULL);
481 acquired_queues->Reset(this); 477 acquired_queues->Reset(this);
482 } 478 }
483 479
484 } // namespace dart 480 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698