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

Unified Diff: runtime/vm/isolate.cc

Issue 9420038: Heartbeat implementation of dart:mirrors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months 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.cc ('k') | runtime/vm/message.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
===================================================================
--- runtime/vm/isolate.cc (revision 5107)
+++ runtime/vm/isolate.cc (working copy)
@@ -66,8 +66,7 @@
void IsolateMessageHandler::MessageNotify(Message::Priority priority) {
if (priority >= Message::kOOBPriority) {
// Handle out of band messages even if the isolate is busy.
- // isolate_->ScheduleInterrupts(Isolate::kMessageInterrupt);
- UNIMPLEMENTED();
+ isolate_->ScheduleInterrupts(Isolate::kMessageInterrupt);
}
Dart_MessageNotifyCallback callback = isolate_->message_notify_callback();
if (callback) {
@@ -394,26 +393,36 @@
Zone zone(this);
HandleScope handle_scope(this);
+ // TODO(turnidge): This code is duplicated elsewhere. Consolidate.
Message* message = message_handler()->queue()->Dequeue(0);
if (message != NULL) {
- if (message->priority() >= Message::kOOBPriority) {
- // TODO(turnidge): Out of band messages will not go through the
- // regular message handler. Instead they will be dispatched to
- // special vm code. Implement.
- UNIMPLEMENTED();
- }
const Instance& msg =
Instance::Handle(DeserializeMessage(message->data()));
- const Object& result = Object::Handle(
- DartLibraryCalls::HandleMessage(
- message->dest_port(), message->reply_port(), msg));
- delete message;
- if (result.IsError()) {
- Error& error = Error::Handle();
- error ^= result.raw();
- return error.raw();
+ if (message->priority() >= Message::kOOBPriority) {
+ // For now the only OOB messages are Mirrors messages.
+ const Object& result = Object::Handle(
+ DartLibraryCalls::HandleMirrorsMessage(
+ message->dest_port(), message->reply_port(), msg));
+ delete message;
+ if (result.IsError()) {
+ // TODO(turnidge): Propagating the error is probably wrong here.
+ Error& error = Error::Handle();
+ error ^= result.raw();
+ return error.raw();
+ }
+ ASSERT(result.IsNull());
+ } else {
+ const Object& result = Object::Handle(
+ DartLibraryCalls::HandleMessage(
+ message->dest_port(), message->reply_port(), msg));
+ delete message;
+ if (result.IsError()) {
+ Error& error = Error::Handle();
+ error ^= result.raw();
+ return error.raw();
+ }
+ ASSERT(result.IsNull());
}
- ASSERT(result.IsNull());
}
}
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/message.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698