Index: runtime/lib/isolate.cc |
=================================================================== |
--- runtime/lib/isolate.cc (revision 10993) |
+++ runtime/lib/isolate.cc (working copy) |
@@ -42,15 +42,6 @@ |
} |
-static uint8_t* SerializeObject(const Instance& obj) { |
- uint8_t* result = NULL; |
- SnapshotWriter writer(Snapshot::kMessage, &result, &allocator); |
- writer.WriteObject(obj.raw()); |
- writer.FinalizeBuffer(); |
- return result; |
-} |
- |
- |
static void StoreError(Isolate* isolate, const Object& obj) { |
ASSERT(obj.IsError()); |
Error& error = Error::Handle(); |
@@ -144,11 +135,16 @@ |
GET_NATIVE_ARGUMENT(Smi, reply_id, arguments->At(1)); |
// TODO(iposva): Allow for arbitrary messages to be sent. |
GET_NATIVE_ARGUMENT(Instance, obj, arguments->At(2)); |
- uint8_t* data = SerializeObject(obj); |
+ uint8_t* data = NULL; |
+ SnapshotWriter writer(Snapshot::kMessage, &data, &allocator); |
+ writer.WriteObject(obj.raw()); |
+ intptr_t data_len = writer.FinalizeBuffer(); |
siva
2012/08/22 23:30:39
As discussed offline we could probably get rid of
turnidge
2012/08/23 18:37:57
Done.
|
+ |
// TODO(turnidge): Throw an exception when the return value is false? |
PortMap::PostMessage(new Message( |
- send_id.Value(), reply_id.Value(), data, Message::kNormalPriority)); |
+ send_id.Value(), reply_id.Value(), data, data_len, |
+ Message::kNormalPriority)); |
} |