OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 18790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18801 const char* Capability::ToCString() const { | 18801 const char* Capability::ToCString() const { |
18802 return "Capability"; | 18802 return "Capability"; |
18803 } | 18803 } |
18804 | 18804 |
18805 | 18805 |
18806 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { | 18806 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { |
18807 Instance::PrintJSONImpl(stream, ref); | 18807 Instance::PrintJSONImpl(stream, ref); |
18808 } | 18808 } |
18809 | 18809 |
18810 | 18810 |
18811 RawReceivePort* ReceivePort::New(Dart_Port id, Heap::Space space) { | 18811 RawReceivePort* ReceivePort::New(Dart_Port id, |
| 18812 bool is_control_port, |
| 18813 Heap::Space space) { |
18812 Isolate* isolate = Isolate::Current(); | 18814 Isolate* isolate = Isolate::Current(); |
18813 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); | 18815 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); |
18814 | 18816 |
18815 ReceivePort& result = ReceivePort::Handle(isolate); | 18817 ReceivePort& result = ReceivePort::Handle(isolate); |
18816 { | 18818 { |
18817 RawObject* raw = Object::Allocate(ReceivePort::kClassId, | 18819 RawObject* raw = Object::Allocate(ReceivePort::kClassId, |
18818 ReceivePort::InstanceSize(), | 18820 ReceivePort::InstanceSize(), |
18819 space); | 18821 space); |
18820 NoGCScope no_gc; | 18822 NoGCScope no_gc; |
18821 result ^= raw; | 18823 result ^= raw; |
18822 result.raw_ptr()->send_port_ = send_port.raw(); | 18824 result.raw_ptr()->send_port_ = send_port.raw(); |
18823 } | 18825 } |
18824 PortMap::SetLive(id); | 18826 if (is_control_port) { |
| 18827 PortMap::SetPortState(id, PortMap::kControlPort); |
| 18828 } else { |
| 18829 PortMap::SetPortState(id, PortMap::kLivePort); |
| 18830 } |
18825 return result.raw(); | 18831 return result.raw(); |
18826 } | 18832 } |
18827 | 18833 |
18828 | 18834 |
18829 const char* ReceivePort::ToCString() const { | 18835 const char* ReceivePort::ToCString() const { |
18830 return "ReceivePort"; | 18836 return "ReceivePort"; |
18831 } | 18837 } |
18832 | 18838 |
18833 | 18839 |
18834 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { | 18840 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19473 return tag_label.ToCString(); | 19479 return tag_label.ToCString(); |
19474 } | 19480 } |
19475 | 19481 |
19476 | 19482 |
19477 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19483 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19478 Instance::PrintJSONImpl(stream, ref); | 19484 Instance::PrintJSONImpl(stream, ref); |
19479 } | 19485 } |
19480 | 19486 |
19481 | 19487 |
19482 } // namespace dart | 19488 } // namespace dart |
OLD | NEW |