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 20084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20095 | 20095 |
20096 | 20096 |
20097 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20097 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20098 Instance::PrintJSONImpl(stream, ref); | 20098 Instance::PrintJSONImpl(stream, ref); |
20099 } | 20099 } |
20100 | 20100 |
20101 | 20101 |
20102 RawReceivePort* ReceivePort::New(Dart_Port id, | 20102 RawReceivePort* ReceivePort::New(Dart_Port id, |
20103 bool is_control_port, | 20103 bool is_control_port, |
20104 Heap::Space space) { | 20104 Heap::Space space) { |
20105 ASSERT(id != ILLEGAL_PORT); | 20105 ASSERT(id != DART_ILLEGAL_PORT); |
20106 Isolate* isolate = Isolate::Current(); | 20106 Isolate* isolate = Isolate::Current(); |
20107 const SendPort& send_port = | 20107 const SendPort& send_port = |
20108 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id())); | 20108 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id())); |
20109 | 20109 |
20110 ReceivePort& result = ReceivePort::Handle(isolate); | 20110 ReceivePort& result = ReceivePort::Handle(isolate); |
20111 { | 20111 { |
20112 RawObject* raw = Object::Allocate(ReceivePort::kClassId, | 20112 RawObject* raw = Object::Allocate(ReceivePort::kClassId, |
20113 ReceivePort::InstanceSize(), | 20113 ReceivePort::InstanceSize(), |
20114 space); | 20114 space); |
20115 NoSafepointScope no_safepoint; | 20115 NoSafepointScope no_safepoint; |
(...skipping 20 matching lines...) Expand all Loading... |
20136 | 20136 |
20137 | 20137 |
20138 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { | 20138 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { |
20139 return New(id, Isolate::Current()->origin_id(), space); | 20139 return New(id, Isolate::Current()->origin_id(), space); |
20140 } | 20140 } |
20141 | 20141 |
20142 | 20142 |
20143 RawSendPort* SendPort::New(Dart_Port id, | 20143 RawSendPort* SendPort::New(Dart_Port id, |
20144 Dart_Port origin_id, | 20144 Dart_Port origin_id, |
20145 Heap::Space space) { | 20145 Heap::Space space) { |
20146 ASSERT(id != ILLEGAL_PORT); | 20146 ASSERT(id != DART_ILLEGAL_PORT); |
20147 SendPort& result = SendPort::Handle(); | 20147 SendPort& result = SendPort::Handle(); |
20148 { | 20148 { |
20149 RawObject* raw = Object::Allocate(SendPort::kClassId, | 20149 RawObject* raw = Object::Allocate(SendPort::kClassId, |
20150 SendPort::InstanceSize(), | 20150 SendPort::InstanceSize(), |
20151 space); | 20151 space); |
20152 NoSafepointScope no_safepoint; | 20152 NoSafepointScope no_safepoint; |
20153 result ^= raw; | 20153 result ^= raw; |
20154 result.StoreNonPointer(&result.raw_ptr()->id_, id); | 20154 result.StoreNonPointer(&result.raw_ptr()->id_, id); |
20155 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id); | 20155 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id); |
20156 } | 20156 } |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20741 return tag_label.ToCString(); | 20741 return tag_label.ToCString(); |
20742 } | 20742 } |
20743 | 20743 |
20744 | 20744 |
20745 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20745 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20746 Instance::PrintJSONImpl(stream, ref); | 20746 Instance::PrintJSONImpl(stream, ref); |
20747 } | 20747 } |
20748 | 20748 |
20749 | 20749 |
20750 } // namespace dart | 20750 } // namespace dart |
OLD | NEW |