Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: runtime/vm/dart_entry.h

Issue 11440035: Optimize the message queue for many active ports with few messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Moved clearing to MessageQueue destructor Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 static RawObject* ExceptionCreate(const Library& library, 139 static RawObject* ExceptionCreate(const Library& library,
140 const String& exception_name, 140 const String& exception_name,
141 const Array& arguments); 141 const Array& arguments);
142 142
143 // On success, returns a RawInstance. On failure, a RawError. 143 // On success, returns a RawInstance. On failure, a RawError.
144 static RawObject* ToString(const Instance& receiver); 144 static RawObject* ToString(const Instance& receiver);
145 145
146 // On success, returns a RawInstance. On failure, a RawError. 146 // On success, returns a RawInstance. On failure, a RawError.
147 static RawObject* Equals(const Instance& left, const Instance& right); 147 static RawObject* Equals(const Instance& left, const Instance& right);
148 148
149 // Returns the receive port if it is in the port map and null otherwise.
150 // On failure, a RawError.
151 static RawObject* LookupReceivePort(Dart_Port port_id);
152
149 // Returns null on success, a RawError on failure. 153 // Returns null on success, a RawError on failure.
150 static RawObject* HandleMessage(Dart_Port dest_port_id, 154 static RawObject* HandleMessage(const Object& receive_port,
151 Dart_Port reply_port_id, 155 Dart_Port reply_port_id,
152 const Instance& dart_message); 156 const Instance& dart_message);
153 157
154 // On success returns new SendPort, on failure returns a RawError. 158 // On success returns new SendPort, on failure returns a RawError.
155 static RawObject* NewSendPort(intptr_t port_id); 159 static RawObject* NewSendPort(intptr_t port_id);
156 160
157 // map[key] = value; 161 // map[key] = value;
158 // 162 //
159 // Returns null on success, a RawError on failure. 163 // Returns null on success, a RawError on failure.
160 static RawObject* MapSetAt(const Instance& map, 164 static RawObject* MapSetAt(const Instance& map,
161 const Instance& key, 165 const Instance& key,
162 const Instance& value); 166 const Instance& value);
163 167
164 // Gets the _id field of a SendPort/ReceivePort. 168 // Gets the _id field of a SendPort/ReceivePort.
165 // 169 //
166 // Returns the value of _id on success, a RawError on failure. 170 // Returns the value of _id on success, a RawError on failure.
167 static RawObject* PortGetId(const Instance& port); 171 static RawObject* PortGetId(const Instance& port);
168 }; 172 };
169 173
170 } // namespace dart 174 } // namespace dart
171 175
172 #endif // VM_DART_ENTRY_H_ 176 #endif // VM_DART_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698