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:
@@ -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) {
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user