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

Unified Diff: runtime/vm/code_generator.cc

Issue 9924015: Use the ThreadPool for all isolates and native ports. Previously, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/lib/isolate.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 6698)
+++ runtime/vm/code_generator.cc (working copy)
@@ -12,6 +12,7 @@
#include "vm/exceptions.h"
#include "vm/object_store.h"
#include "vm/message.h"
+#include "vm/message_handler.h"
#include "vm/resolver.h"
#include "vm/runtime_entry.h"
#include "vm/stack_frame.h"
@@ -1125,20 +1126,6 @@
}
-static RawInstance* DeserializeMessage(void* data) {
- // Create a snapshot object using the buffer.
- const Snapshot* snapshot = Snapshot::SetupFromBuffer(data);
- ASSERT(snapshot->IsMessageSnapshot());
-
- // Read object back from the snapshot.
- SnapshotReader reader(snapshot, Isolate::Current());
- Instance& instance = Instance::Handle();
- instance ^= reader.ReadObject();
- return instance.raw();
-}
-
-
-
DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
ASSERT(arguments.Count() ==
kStackOverflowRuntimeEntry.argument_count());
@@ -1157,28 +1144,7 @@
uword interrupt_bits = isolate->GetAndClearInterrupts();
if (interrupt_bits & Isolate::kMessageInterrupt) {
- while (true) {
- // TODO(turnidge): This code is duplicated elsewhere. Consolidate.
- Message* message =
- isolate->message_handler()->queue()->DequeueNoWaitWithPriority(
- Message::kOOBPriority);
- if (message == NULL) {
- // No more OOB messages to handle.
- break;
- }
- const Instance& msg =
- Instance::Handle(DeserializeMessage(message->data()));
- // 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.
- Exceptions::PropagateError(result);
- }
- ASSERT(result.IsNull());
- }
+ isolate->message_handler()->HandleOOBMessages();
}
if (interrupt_bits & Isolate::kApiInterrupt) {
Dart_IsolateInterruptCallback callback = isolate->InterruptCallback();
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/dart.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698