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 19927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19938 | 19938 |
19939 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19939 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19940 Instance::PrintJSONImpl(stream, ref); | 19940 Instance::PrintJSONImpl(stream, ref); |
19941 } | 19941 } |
19942 | 19942 |
19943 | 19943 |
19944 RawReceivePort* ReceivePort::New(Dart_Port id, | 19944 RawReceivePort* ReceivePort::New(Dart_Port id, |
19945 bool is_control_port, | 19945 bool is_control_port, |
19946 Heap::Space space) { | 19946 Heap::Space space) { |
19947 Isolate* isolate = Isolate::Current(); | 19947 Isolate* isolate = Isolate::Current(); |
19948 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); | 19948 const SendPort& send_port = |
| 19949 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id())); |
19949 | 19950 |
19950 ReceivePort& result = ReceivePort::Handle(isolate); | 19951 ReceivePort& result = ReceivePort::Handle(isolate); |
19951 { | 19952 { |
19952 RawObject* raw = Object::Allocate(ReceivePort::kClassId, | 19953 RawObject* raw = Object::Allocate(ReceivePort::kClassId, |
19953 ReceivePort::InstanceSize(), | 19954 ReceivePort::InstanceSize(), |
19954 space); | 19955 space); |
19955 NoGCScope no_gc; | 19956 NoGCScope no_gc; |
19956 result ^= raw; | 19957 result ^= raw; |
19957 result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw()); | 19958 result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw()); |
19958 } | 19959 } |
(...skipping 10 matching lines...) Expand all Loading... |
19969 return "ReceivePort"; | 19970 return "ReceivePort"; |
19970 } | 19971 } |
19971 | 19972 |
19972 | 19973 |
19973 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19974 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19974 Instance::PrintJSONImpl(stream, ref); | 19975 Instance::PrintJSONImpl(stream, ref); |
19975 } | 19976 } |
19976 | 19977 |
19977 | 19978 |
19978 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { | 19979 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { |
| 19980 return New(id, Isolate::Current()->origin_id(), space); |
| 19981 } |
| 19982 |
| 19983 |
| 19984 RawSendPort* SendPort::New(Dart_Port id, |
| 19985 Dart_Port origin_id, |
| 19986 Heap::Space space) { |
19979 SendPort& result = SendPort::Handle(); | 19987 SendPort& result = SendPort::Handle(); |
19980 { | 19988 { |
19981 RawObject* raw = Object::Allocate(SendPort::kClassId, | 19989 RawObject* raw = Object::Allocate(SendPort::kClassId, |
19982 SendPort::InstanceSize(), | 19990 SendPort::InstanceSize(), |
19983 space); | 19991 space); |
19984 NoGCScope no_gc; | 19992 NoGCScope no_gc; |
19985 result ^= raw; | 19993 result ^= raw; |
19986 result.StoreNonPointer(&result.raw_ptr()->id_, id); | 19994 result.StoreNonPointer(&result.raw_ptr()->id_, id); |
| 19995 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id); |
19987 } | 19996 } |
19988 return result.raw(); | 19997 return result.raw(); |
19989 } | 19998 } |
19990 | 19999 |
19991 | 20000 |
19992 const char* SendPort::ToCString() const { | 20001 const char* SendPort::ToCString() const { |
19993 return "SendPort"; | 20002 return "SendPort"; |
19994 } | 20003 } |
19995 | 20004 |
19996 | 20005 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20638 return tag_label.ToCString(); | 20647 return tag_label.ToCString(); |
20639 } | 20648 } |
20640 | 20649 |
20641 | 20650 |
20642 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20651 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20643 Instance::PrintJSONImpl(stream, ref); | 20652 Instance::PrintJSONImpl(stream, ref); |
20644 } | 20653 } |
20645 | 20654 |
20646 | 20655 |
20647 } // namespace dart | 20656 } // namespace dart |
OLD | NEW |