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

Unified Diff: runtime/vm/dart_entry.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 035440d859782b10037b327ffb158c0720d339ee..6b3856dee2936b3a68db70d2c236afaf7574561f 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -318,7 +318,33 @@ RawObject* DartLibraryCalls::Equals(const Instance& left,
}
-RawObject* DartLibraryCalls::HandleMessage(Dart_Port dest_port_id,
+RawObject* DartLibraryCalls::LookupReceivePort(Dart_Port port_id) {
Ivan Posva 2012/12/20 17:19:43 Please coordinate with +fschneider as he has relev
+ Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ ASSERT(!isolate_lib.IsNull());
+ const String& public_class_name =
+ String::Handle(Symbols::New("_ReceivePortImpl"));
+ const String& class_name =
+ String::Handle(isolate_lib.PrivateName(public_class_name));
+ const String& function_name =
+ String::Handle(Symbols::New("_lookupReceivePort"));
+ const int kNumArguments = 1;
+ const Array& kNoArgumentNames = Array::Handle();
+ const Function& function = Function::Handle(
+ Resolver::ResolveStatic(isolate_lib,
+ class_name,
+ function_name,
+ kNumArguments,
+ kNoArgumentNames,
+ Resolver::kIsQualified));
+ const Array& args = Array::Handle(Array::New(kNumArguments));
+ args.SetAt(0, Integer::Handle(Integer::New(port_id)));
+ const Object& result =
+ Object::Handle(DartEntry::InvokeStatic(function, args));
+ return result.raw();
+}
+
+
+RawObject* DartLibraryCalls::HandleMessage(const Object& receive_port,
Dart_Port reply_port_id,
const Instance& message) {
Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
@@ -339,11 +365,11 @@ RawObject* DartLibraryCalls::HandleMessage(Dart_Port dest_port_id,
kNoArgumentNames,
Resolver::kIsQualified));
const Array& args = Array::Handle(Array::New(kNumArguments));
- args.SetAt(0, Integer::Handle(Integer::New(dest_port_id)));
+ args.SetAt(0, receive_port);
args.SetAt(1, Integer::Handle(Integer::New(reply_port_id)));
args.SetAt(2, message);
- const Object& result = Object::Handle(DartEntry::InvokeStatic(function,
- args));
+ const Object& result = Object::Handle(
+ DartEntry::InvokeStatic(function, args));
ASSERT(result.IsNull() || result.IsError());
return result.raw();
}
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698