Chromium Code Reviews| Index: runtime/lib/isolate.cc |
| =================================================================== |
| --- runtime/lib/isolate.cc (revision 510) |
| +++ runtime/lib/isolate.cc (working copy) |
| @@ -37,20 +37,6 @@ |
| }; |
| -static RawInstance* DeserializeMessage(void* data) { |
| - // Create a snapshot object using the buffer. |
| - const Snapshot* snapshot = Snapshot::SetupFromBuffer(data); |
| - ASSERT(snapshot->IsPartialSnapshot()); |
| - |
| - // Read object back from the snapshot. |
| - Isolate* isolate= Isolate::Current(); |
| - SnapshotReader reader(snapshot, isolate->heap(), isolate->object_store()); |
| - Instance& instance = Instance::Handle(); |
| - instance ^= reader.ReadObject(); |
| - return instance.raw(); |
| -} |
| - |
| - |
| static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) { |
| void* new_ptr = realloc(reinterpret_cast<void*>(ptr), new_size); |
| return reinterpret_cast<uint8_t*>(new_ptr); |
| @@ -144,36 +130,6 @@ |
| } |
| -void PortMessage::Handle() { |
| - const Instance& msg = Instance::Handle(DeserializeMessage(data())); |
| - const String& class_name = |
| - String::Handle(String::NewSymbol("ReceivePortImpl")); |
| - const String& function_name = |
| - String::Handle(String::NewSymbol("handleMessage_")); |
| - const int kNumArguments = 3; |
| - const Array& kNoArgumentNames = Array::Handle(); |
| - const Function& function = Function::Handle( |
| - Resolver::ResolveStatic(Library::Handle(Library::CoreLibrary()), |
| - class_name, |
| - function_name, |
| - kNumArguments, |
| - kNoArgumentNames, |
| - Resolver::kIsQualified)); |
| - GrowableArray<const Object*> arguments(kNumArguments); |
| - arguments.Add(&Integer::Handle(Integer::New(dest_id()))); |
| - arguments.Add(&Integer::Handle(Integer::New(reply_id()))); |
| - arguments.Add(&msg); |
| - const Object& result = Object::Handle( |
| - DartEntry::InvokeStatic(function, arguments, kNoArgumentNames)); |
| - if (result.IsUnhandledException()) { |
| - UnhandledException& uhe = UnhandledException::Handle(); |
| - uhe ^= result.raw(); |
| - ProcessUnhandledException(uhe); |
| - } |
| - ASSERT(result.IsNull()); |
| -} |
| - |
| - |
| static void RunIsolate(uword parameter) { |
| IsolateStartData* data = reinterpret_cast<IsolateStartData*>(parameter); |
| Isolate* isolate = data->isolate_; |
| @@ -248,14 +204,8 @@ |
| free(class_name); |
| // Keep listening until there are no active receive ports. |
|
Anton Muhin
2011/10/18 17:19:58
nit: this comment can probably go away now.
turnidge
2011/10/18 17:33:40
Done.
|
| - while (isolate->active_ports() > 0) { |
| - Zone zone; |
| - HandleScope handle_scope; |
| + isolate->StandardRunLoop(); |
| - PortMessage* message = PortMap::ReceiveMessage(0); |
| - message->Handle(); |
| - delete message; |
| - } |
| } else { |
| Zone zone; |
| HandleScope handle_scope; |
| @@ -389,8 +339,8 @@ |
| // TODO(iposva): Allow for arbitrary messages to be sent. |
| void* data = SerializeObject(Instance::CheckedHandle(arguments->At(2))); |
| - PortMessage* message = new PortMessage(send_id, reply_id, data); |
| - PortMap::PostMessage(message); |
| + // TODO(turnidge): Throw an exception when the return value is false? |
| + PortMap::PostMessage(send_id, reply_id, data); |
| } |
| } // namespace dart |