| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #include "src/vm/message_mailbox.h" | 5 #include "src/vm/message_mailbox.h" |
| 6 #include "src/vm/process.h" | 6 #include "src/vm/process.h" |
| 7 | 7 |
| 8 namespace fletch { | 8 namespace dartino { |
| 9 | 9 |
| 10 ExitReference::ExitReference(Object* message) : message_(message) {} | 10 ExitReference::ExitReference(Object* message) : message_(message) {} |
| 11 | 11 |
| 12 Message::~Message() { | 12 Message::~Message() { |
| 13 port_->DecrementRef(); | 13 port_->DecrementRef(); |
| 14 if (kind() == EXIT) { | 14 if (kind() == EXIT) { |
| 15 ExitReference* ref = reinterpret_cast<ExitReference*>(value()); | 15 ExitReference* ref = reinterpret_cast<ExitReference*>(value()); |
| 16 delete ref; | 16 delete ref; |
| 17 } else if (kind() == PROCESS_DEATH_SIGNAL) { | 17 } else if (kind() == PROCESS_DEATH_SIGNAL) { |
| 18 Signal* signal = reinterpret_cast<Signal*>(value()); | 18 Signal* signal = reinterpret_cast<Signal*>(value()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 48 Message* entry = new Message(port, address, size, kind); | 48 Message* entry = new Message(port, address, size, kind); |
| 49 EnqueueEntry(entry); | 49 EnqueueEntry(entry); |
| 50 } | 50 } |
| 51 | 51 |
| 52 void MessageMailbox::EnqueueExit(Process* sender, Port* port, Object* message) { | 52 void MessageMailbox::EnqueueExit(Process* sender, Port* port, Object* message) { |
| 53 uint64 address = reinterpret_cast<uint64>(message); | 53 uint64 address = reinterpret_cast<uint64>(message); |
| 54 Message* entry = new Message(port, address, 0, Message::IMMUTABLE_OBJECT); | 54 Message* entry = new Message(port, address, 0, Message::IMMUTABLE_OBJECT); |
| 55 EnqueueEntry(entry); | 55 EnqueueEntry(entry); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace fletch | 58 } // namespace dartino |
| OLD | NEW |