| 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 | 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 task_running = pool_->Run(task_); | 118 task_running = pool_->Run(task_); |
| 119 ASSERT(task_running); | 119 ASSERT(task_running); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void MessageHandler::PostMessage(Message* message, bool before_events) { | 122 void MessageHandler::PostMessage(Message* message, bool before_events) { |
| 123 Message::Priority saved_priority; | 123 Message::Priority saved_priority; |
| 124 bool task_running = true; | 124 bool task_running = true; |
| 125 { | 125 { |
| 126 MonitorLocker ml(&monitor_); | 126 MonitorLocker ml(&monitor_); |
| 127 if (FLAG_trace_isolates) { | 127 if (FLAG_trace_isolates) { |
| 128 const char* source_name = "<native code>"; | |
| 129 Isolate* source_isolate = Isolate::Current(); | 128 Isolate* source_isolate = Isolate::Current(); |
| 130 if (source_isolate) { | 129 if (source_isolate) { |
| 131 source_name = source_isolate->name(); | 130 OS::Print( |
| 131 "[>] Posting message:\n" |
| 132 "\tlen: %" Pd "\n\tsource: (%" Pd64 |
| 133 ") %s\n\tdest: %s\n" |
| 134 "\tdest_port: %" Pd64 "\n", |
| 135 message->len(), static_cast<int64_t>(source_isolate->main_port()), |
| 136 source_isolate->name(), name(), message->dest_port()); |
| 137 } else { |
| 138 OS::Print( |
| 139 "[>] Posting message:\n" |
| 140 "\tlen: %" Pd |
| 141 "\n\tsource: <native code>\n" |
| 142 "\tdest: %s\n" |
| 143 "\tdest_port: %" Pd64 "\n", |
| 144 message->len(), name(), message->dest_port()); |
| 132 } | 145 } |
| 133 OS::Print( | |
| 134 "[>] Posting message:\n" | |
| 135 "\tlen: %" Pd | |
| 136 "\n" | |
| 137 "\tsource: %s\n" | |
| 138 "\tdest: %s\n" | |
| 139 "\tdest_port: %" Pd64 "\n", | |
| 140 message->len(), source_name, name(), message->dest_port()); | |
| 141 } | 146 } |
| 142 | 147 |
| 143 saved_priority = message->priority(); | 148 saved_priority = message->priority(); |
| 144 if (message->IsOOB()) { | 149 if (message->IsOOB()) { |
| 145 oob_queue_->Enqueue(message, before_events); | 150 oob_queue_->Enqueue(message, before_events); |
| 146 } else { | 151 } else { |
| 147 queue_->Enqueue(message, before_events); | 152 queue_->Enqueue(message, before_events); |
| 148 } | 153 } |
| 149 message = NULL; // Do not access message. May have been deleted. | 154 message = NULL; // Do not access message. May have been deleted. |
| 150 | 155 |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 ASSERT(handler != NULL); | 570 ASSERT(handler != NULL); |
| 566 handler_->oob_message_handling_allowed_ = false; | 571 handler_->oob_message_handling_allowed_ = false; |
| 567 } | 572 } |
| 568 | 573 |
| 569 MessageHandler::AcquiredQueues::~AcquiredQueues() { | 574 MessageHandler::AcquiredQueues::~AcquiredQueues() { |
| 570 ASSERT(handler_ != NULL); | 575 ASSERT(handler_ != NULL); |
| 571 handler_->oob_message_handling_allowed_ = true; | 576 handler_->oob_message_handling_allowed_ = true; |
| 572 } | 577 } |
| 573 | 578 |
| 574 } // namespace dart | 579 } // namespace dart |
| OLD | NEW |