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

Side by Side Diff: runtime/vm/message_handler.cc

Issue 861813003: Move StartIsolateScope into MessageHandler::HandleMessages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | no next file » | 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/port.h" 9 #include "vm/port.h"
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 Message* message = oob_queue_->Dequeue(); 130 Message* message = oob_queue_->Dequeue();
131 if ((message == NULL) && (min_priority < Message::kOOBPriority)) { 131 if ((message == NULL) && (min_priority < Message::kOOBPriority)) {
132 message = queue_->Dequeue(); 132 message = queue_->Dequeue();
133 } 133 }
134 return message; 134 return message;
135 } 135 }
136 136
137 137
138 bool MessageHandler::HandleMessages(bool allow_normal_messages, 138 bool MessageHandler::HandleMessages(bool allow_normal_messages,
139 bool allow_multiple_normal_messages) { 139 bool allow_multiple_normal_messages) {
140 // If isolate() returns NULL StartIsolateScope does nothing.
141 StartIsolateScope start_isolate(isolate());
142
140 // TODO(turnidge): Add assert that monitor_ is held here. 143 // TODO(turnidge): Add assert that monitor_ is held here.
141 bool result = true; 144 bool result = true;
142 Message::Priority min_priority = (allow_normal_messages && !paused()) ? 145 Message::Priority min_priority = (allow_normal_messages && !paused()) ?
143 Message::kNormalPriority : Message::kOOBPriority; 146 Message::kNormalPriority : Message::kOOBPriority;
144 Message* message = DequeueMessage(min_priority); 147 Message* message = DequeueMessage(min_priority);
145 while (message != NULL) { 148 while (message != NULL) {
146 if (FLAG_trace_isolates) { 149 if (FLAG_trace_isolates) {
147 OS::Print("[<] Handling message:\n" 150 OS::Print("[<] Handling message:\n"
148 "\thandler: %s\n" 151 "\thandler: %s\n"
149 "\tport: %" Pd64 "\n", 152 "\tport: %" Pd64 "\n",
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 309
307 void MessageHandler::decrement_live_ports() { 310 void MessageHandler::decrement_live_ports() {
308 MonitorLocker ml(&monitor_); 311 MonitorLocker ml(&monitor_);
309 #if defined(DEBUG) 312 #if defined(DEBUG)
310 CheckAccess(); 313 CheckAccess();
311 #endif 314 #endif
312 live_ports_--; 315 live_ports_--;
313 } 316 }
314 317
315 } // namespace dart 318 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698