OLD | NEW |
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 #include "vm/port.h" | 6 #include "vm/port.h" |
7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
8 | 8 |
9 namespace dart { | 9 namespace dart { |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void MessageHandler::PostMessage(Message* message) { | 90 void MessageHandler::PostMessage(Message* message) { |
91 MonitorLocker ml(&monitor_); | 91 MonitorLocker ml(&monitor_); |
92 if (FLAG_trace_isolates) { | 92 if (FLAG_trace_isolates) { |
93 const char* source_name = "<native code>"; | 93 const char* source_name = "<native code>"; |
94 Isolate* source_isolate = Isolate::Current(); | 94 Isolate* source_isolate = Isolate::Current(); |
95 if (source_isolate) { | 95 if (source_isolate) { |
96 source_name = source_isolate->name(); | 96 source_name = source_isolate->name(); |
97 } | 97 } |
98 OS::Print("[>] Posting message:\n" | 98 OS::Print("[>] Posting message:\n" |
99 "\tsource: %s\n" | 99 "\tsource: %s\n" |
100 "\treply_port: %" Pd64 "\n" | |
101 "\tdest: %s\n" | 100 "\tdest: %s\n" |
102 "\tdest_port: %" Pd64 "\n", | 101 "\tdest_port: %" Pd64 "\n", |
103 source_name, message->reply_port(), name(), message->dest_port()); | 102 source_name, name(), message->dest_port()); |
104 } | 103 } |
105 | 104 |
106 Message::Priority saved_priority = message->priority(); | 105 Message::Priority saved_priority = message->priority(); |
107 if (message->IsOOB()) { | 106 if (message->IsOOB()) { |
108 oob_queue_->Enqueue(message); | 107 oob_queue_->Enqueue(message); |
109 } else { | 108 } else { |
110 queue_->Enqueue(message); | 109 queue_->Enqueue(message); |
111 } | 110 } |
112 message = NULL; // Do not access message. May have been deleted. | 111 message = NULL; // Do not access message. May have been deleted. |
113 | 112 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 281 |
283 void MessageHandler::decrement_control_ports() { | 282 void MessageHandler::decrement_control_ports() { |
284 MonitorLocker ml(&monitor_); | 283 MonitorLocker ml(&monitor_); |
285 #if defined(DEBUG) | 284 #if defined(DEBUG) |
286 CheckAccess(); | 285 CheckAccess(); |
287 #endif | 286 #endif |
288 control_ports_--; | 287 control_ports_--; |
289 } | 288 } |
290 | 289 |
291 } // namespace dart | 290 } // namespace dart |
OLD | NEW |