OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_DART_ENTRY_H_ | 5 #ifndef VM_DART_ENTRY_H_ |
6 #define VM_DART_ENTRY_H_ | 6 #define VM_DART_ENTRY_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 static RawObject* ExceptionCreate(const Library& library, | 146 static RawObject* ExceptionCreate(const Library& library, |
147 const String& exception_name, | 147 const String& exception_name, |
148 const Array& arguments); | 148 const Array& arguments); |
149 | 149 |
150 // On success, returns a RawInstance. On failure, a RawError. | 150 // On success, returns a RawInstance. On failure, a RawError. |
151 static RawObject* ToString(const Instance& receiver); | 151 static RawObject* ToString(const Instance& receiver); |
152 | 152 |
153 // On success, returns a RawInstance. On failure, a RawError. | 153 // On success, returns a RawInstance. On failure, a RawError. |
154 static RawObject* Equals(const Instance& left, const Instance& right); | 154 static RawObject* Equals(const Instance& left, const Instance& right); |
155 | 155 |
| 156 // Returns the receive port if it is in the port map and null otherwise. |
| 157 // On failure, a RawError. |
| 158 static RawObject* LookupReceivePort(Dart_Port port_id); |
| 159 |
156 // Returns null on success, a RawError on failure. | 160 // Returns null on success, a RawError on failure. |
157 static RawObject* HandleMessage(Dart_Port dest_port_id, | 161 static RawObject* HandleMessage(const Object& receive_port, |
158 Dart_Port reply_port_id, | 162 Dart_Port reply_port_id, |
159 const Instance& dart_message); | 163 const Instance& dart_message); |
160 | 164 |
161 // On success returns new SendPort, on failure returns a RawError. | 165 // On success returns new SendPort, on failure returns a RawError. |
162 static RawObject* NewSendPort(intptr_t port_id); | 166 static RawObject* NewSendPort(intptr_t port_id); |
163 | 167 |
164 // map[key] = value; | 168 // map[key] = value; |
165 // | 169 // |
166 // Returns null on success, a RawError on failure. | 170 // Returns null on success, a RawError on failure. |
167 static RawObject* MapSetAt(const Instance& map, | 171 static RawObject* MapSetAt(const Instance& map, |
168 const Instance& key, | 172 const Instance& key, |
169 const Instance& value); | 173 const Instance& value); |
170 | 174 |
171 // Gets the _id field of a SendPort/ReceivePort. | 175 // Gets the _id field of a SendPort/ReceivePort. |
172 // | 176 // |
173 // Returns the value of _id on success, a RawError on failure. | 177 // Returns the value of _id on success, a RawError on failure. |
174 static RawObject* PortGetId(const Instance& port); | 178 static RawObject* PortGetId(const Instance& port); |
175 }; | 179 }; |
176 | 180 |
177 } // namespace dart | 181 } // namespace dart |
178 | 182 |
179 #endif // VM_DART_ENTRY_H_ | 183 #endif // VM_DART_ENTRY_H_ |
OLD | NEW |