Fix snapshotting of TypeArguments.

R=asiva@google.com

Review URL: https://codereview.chromium.org//132623007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32457 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
regis@google.com
2014-02-07 23:02:54 +00:00
parent 7b6cf617b4
commit 61ba258618
3 changed files with 7 additions and 0 deletions
+1
View File
@@ -487,6 +487,7 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
AddBackRef(object_id, value, kIsDeserialized);
Dart_CObject* length = ReadObjectImpl();
ASSERT(length->type == Dart_CObject_kInt32);
ReadObjectImpl(); // Read and skip instantiations_ field.
for (int i = 0; i < length->value.as_int32; i++) {
Dart_CObject* type = ReadObjectImpl();
if (type != &dynamic_type_marker) {
+5
View File
@@ -449,6 +449,8 @@ RawTypeArguments* TypeArguments::ReadFrom(SnapshotReader* reader,
reader->AddBackRef(object_id, &type_arguments, kIsDeserialized);
// Now set all the object fields.
*reader->ArrayHandle() ^= reader->ReadObjectImpl();
type_arguments.set_instantiations(*reader->ArrayHandle());
for (intptr_t i = 0; i < len; i++) {
*reader->TypeHandle() ^= reader->ReadObjectImpl();
type_arguments.SetTypeAt(i, *reader->TypeHandle());
@@ -493,6 +495,9 @@ void RawTypeArguments::WriteTo(SnapshotWriter* writer,
// Write out the length field.
writer->Write<RawObject*>(ptr()->length_);
// Write out the instantiations field.
writer->WriteObjectImpl(ptr()->instantiations_);
// Write out the individual types.
intptr_t len = Smi::Value(ptr()->length_);
for (intptr_t i = 0; i < len; i++) {
+1
View File
@@ -221,6 +221,7 @@ class SnapshotReader : public BaseReader {
ObjectStore* object_store() const { return isolate_->object_store(); }
ClassTable* class_table() const { return isolate_->class_table(); }
Object* ObjectHandle() { return &obj_; }
Array* ArrayHandle() { return &array_; }
String* StringHandle() { return &str_; }
AbstractType* TypeHandle() { return &type_; }
TypeArguments* TypeArgumentsHandle() { return &type_arguments_; }