| 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 18800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18811 const char* Capability::ToCString() const { | 18811 const char* Capability::ToCString() const { |
| 18812 return "Capability"; | 18812 return "Capability"; |
| 18813 } | 18813 } |
| 18814 | 18814 |
| 18815 | 18815 |
| 18816 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { | 18816 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 18817 Instance::PrintJSONImpl(stream, ref); | 18817 Instance::PrintJSONImpl(stream, ref); |
| 18818 } | 18818 } |
| 18819 | 18819 |
| 18820 | 18820 |
| 18821 RawReceivePort* ReceivePort::New(Dart_Port id, Heap::Space space) { | 18821 RawReceivePort* ReceivePort::New(Dart_Port id, |
| 18822 bool is_control_port, |
| 18823 Heap::Space space) { |
| 18822 Isolate* isolate = Isolate::Current(); | 18824 Isolate* isolate = Isolate::Current(); |
| 18823 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); | 18825 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); |
| 18824 | 18826 |
| 18825 ReceivePort& result = ReceivePort::Handle(isolate); | 18827 ReceivePort& result = ReceivePort::Handle(isolate); |
| 18826 { | 18828 { |
| 18827 RawObject* raw = Object::Allocate(ReceivePort::kClassId, | 18829 RawObject* raw = Object::Allocate(ReceivePort::kClassId, |
| 18828 ReceivePort::InstanceSize(), | 18830 ReceivePort::InstanceSize(), |
| 18829 space); | 18831 space); |
| 18830 NoGCScope no_gc; | 18832 NoGCScope no_gc; |
| 18831 result ^= raw; | 18833 result ^= raw; |
| 18832 result.raw_ptr()->send_port_ = send_port.raw(); | 18834 result.raw_ptr()->send_port_ = send_port.raw(); |
| 18833 } | 18835 } |
| 18834 PortMap::SetLive(id); | 18836 if (is_control_port) { |
| 18837 PortMap::SetPortState(id, PortMap::kControlPort); |
| 18838 } else { |
| 18839 PortMap::SetPortState(id, PortMap::kLivePort); |
| 18840 } |
| 18835 return result.raw(); | 18841 return result.raw(); |
| 18836 } | 18842 } |
| 18837 | 18843 |
| 18838 | 18844 |
| 18839 const char* ReceivePort::ToCString() const { | 18845 const char* ReceivePort::ToCString() const { |
| 18840 return "ReceivePort"; | 18846 return "ReceivePort"; |
| 18841 } | 18847 } |
| 18842 | 18848 |
| 18843 | 18849 |
| 18844 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { | 18850 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19483 return tag_label.ToCString(); | 19489 return tag_label.ToCString(); |
| 19484 } | 19490 } |
| 19485 | 19491 |
| 19486 | 19492 |
| 19487 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19493 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 19488 Instance::PrintJSONImpl(stream, ref); | 19494 Instance::PrintJSONImpl(stream, ref); |
| 19489 } | 19495 } |
| 19490 | 19496 |
| 19491 | 19497 |
| 19492 } // namespace dart | 19498 } // namespace dart |
| OLD | NEW |