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 19921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19932 | 19932 |
19933 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19933 void Capability::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19934 Instance::PrintJSONImpl(stream, ref); | 19934 Instance::PrintJSONImpl(stream, ref); |
19935 } | 19935 } |
19936 | 19936 |
19937 | 19937 |
19938 RawReceivePort* ReceivePort::New(Dart_Port id, | 19938 RawReceivePort* ReceivePort::New(Dart_Port id, |
19939 bool is_control_port, | 19939 bool is_control_port, |
19940 Heap::Space space) { | 19940 Heap::Space space) { |
19941 Isolate* isolate = Isolate::Current(); | 19941 Isolate* isolate = Isolate::Current(); |
19942 const SendPort& send_port = SendPort::Handle(isolate, SendPort::New(id)); | 19942 const SendPort& send_port = |
| 19943 SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id())); |
19943 | 19944 |
19944 ReceivePort& result = ReceivePort::Handle(isolate); | 19945 ReceivePort& result = ReceivePort::Handle(isolate); |
19945 { | 19946 { |
19946 RawObject* raw = Object::Allocate(ReceivePort::kClassId, | 19947 RawObject* raw = Object::Allocate(ReceivePort::kClassId, |
19947 ReceivePort::InstanceSize(), | 19948 ReceivePort::InstanceSize(), |
19948 space); | 19949 space); |
19949 NoGCScope no_gc; | 19950 NoGCScope no_gc; |
19950 result ^= raw; | 19951 result ^= raw; |
19951 result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw()); | 19952 result.StorePointer(&result.raw_ptr()->send_port_, send_port.raw()); |
19952 } | 19953 } |
(...skipping 10 matching lines...) Expand all Loading... |
19963 return "ReceivePort"; | 19964 return "ReceivePort"; |
19964 } | 19965 } |
19965 | 19966 |
19966 | 19967 |
19967 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { | 19968 void ReceivePort::PrintJSONImpl(JSONStream* stream, bool ref) const { |
19968 Instance::PrintJSONImpl(stream, ref); | 19969 Instance::PrintJSONImpl(stream, ref); |
19969 } | 19970 } |
19970 | 19971 |
19971 | 19972 |
19972 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { | 19973 RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { |
| 19974 return New(id, Isolate::Current()->origin_id(), space); |
| 19975 } |
| 19976 |
| 19977 |
| 19978 RawSendPort* SendPort::New(Dart_Port id, |
| 19979 Dart_Port origin_id, |
| 19980 Heap::Space space) { |
19973 SendPort& result = SendPort::Handle(); | 19981 SendPort& result = SendPort::Handle(); |
19974 { | 19982 { |
19975 RawObject* raw = Object::Allocate(SendPort::kClassId, | 19983 RawObject* raw = Object::Allocate(SendPort::kClassId, |
19976 SendPort::InstanceSize(), | 19984 SendPort::InstanceSize(), |
19977 space); | 19985 space); |
19978 NoGCScope no_gc; | 19986 NoGCScope no_gc; |
19979 result ^= raw; | 19987 result ^= raw; |
19980 result.StoreNonPointer(&result.raw_ptr()->id_, id); | 19988 result.StoreNonPointer(&result.raw_ptr()->id_, id); |
| 19989 result.StoreNonPointer(&result.raw_ptr()->origin_id_, origin_id); |
19981 } | 19990 } |
19982 return result.raw(); | 19991 return result.raw(); |
19983 } | 19992 } |
19984 | 19993 |
19985 | 19994 |
19986 const char* SendPort::ToCString() const { | 19995 const char* SendPort::ToCString() const { |
19987 return "SendPort"; | 19996 return "SendPort"; |
19988 } | 19997 } |
19989 | 19998 |
19990 | 19999 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
20632 return tag_label.ToCString(); | 20641 return tag_label.ToCString(); |
20633 } | 20642 } |
20634 | 20643 |
20635 | 20644 |
20636 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20645 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
20637 Instance::PrintJSONImpl(stream, ref); | 20646 Instance::PrintJSONImpl(stream, ref); |
20638 } | 20647 } |
20639 | 20648 |
20640 | 20649 |
20641 } // namespace dart | 20650 } // namespace dart |
OLD | NEW |