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

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: Lookup ReceivePort in Dart code 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 const Library& library, 122 const Library& library,
123 const String& exception_name, 123 const String& exception_name,
124 const GrowableArray<const Object*>& arguments); 124 const GrowableArray<const Object*>& arguments);
125 125
126 // On success, returns a RawInstance. On failure, a RawError. 126 // On success, returns a RawInstance. On failure, a RawError.
127 static RawObject* ToString(const Instance& receiver); 127 static RawObject* ToString(const Instance& receiver);
128 128
129 // On success, returns a RawInstance. On failure, a RawError. 129 // On success, returns a RawInstance. On failure, a RawError.
130 static RawObject* Equals(const Instance& left, const Instance& right); 130 static RawObject* Equals(const Instance& left, const Instance& right);
131 131
132 // Returns the receive port if it is in the port map and null otherwise.
133 // On failure, a RawError.
134 static RawObject* LookupReceivePort(Dart_Port port_id);
135
132 // Returns null on success, a RawError on failure. 136 // Returns null on success, a RawError on failure.
133 static RawObject* HandleMessage(Dart_Port dest_port_id, 137 static RawObject* HandleMessage(const Object& receive_port,
134 Dart_Port reply_port_id, 138 Dart_Port reply_port_id,
135 const Instance& dart_message); 139 const Instance& dart_message);
136 140
137 // On success returns new SendPort, on failure returns a RawError. 141 // On success returns new SendPort, on failure returns a RawError.
138 static RawObject* NewSendPort(intptr_t port_id); 142 static RawObject* NewSendPort(intptr_t port_id);
139 143
140 // map[key] = value; 144 // map[key] = value;
141 // 145 //
142 // Returns null on success, a RawError on failure. 146 // Returns null on success, a RawError on failure.
143 static RawObject* MapSetAt(const Instance& map, 147 static RawObject* MapSetAt(const Instance& map,
144 const Instance& key, 148 const Instance& key,
145 const Instance& value); 149 const Instance& value);
146 150
147 // Gets the _id field of a SendPort/ReceivePort. 151 // Gets the _id field of a SendPort/ReceivePort.
148 // 152 //
149 // Returns the value of _id on success, a RawError on failure. 153 // Returns the value of _id on success, a RawError on failure.
150 static RawObject* PortGetId(const Instance& port); 154 static RawObject* PortGetId(const Instance& port);
151 }; 155 };
152 156
153 } // namespace dart 157 } // namespace dart
154 158
155 #endif // VM_DART_ENTRY_H_ 159 #endif // VM_DART_ENTRY_H_
OLDNEW
« no previous file with comments | « runtime/lib/isolate_patch.dart ('k') | runtime/vm/dart_entry.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698