OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/native_entry.h" | 5 #include "vm/native_entry.h" |
6 #include "vm/object.h" | 6 #include "vm/object.h" |
7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
9 #include "vm/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 // Allocate type parameter object. | 334 // Allocate type parameter object. |
335 TypeParameter& type_parameter = | 335 TypeParameter& type_parameter = |
336 TypeParameter::ZoneHandle(reader->zone(), TypeParameter::New()); | 336 TypeParameter::ZoneHandle(reader->zone(), TypeParameter::New()); |
337 reader->AddBackRef(object_id, &type_parameter, kIsDeserialized); | 337 reader->AddBackRef(object_id, &type_parameter, kIsDeserialized); |
338 | 338 |
339 // Set all non object fields. | 339 // Set all non object fields. |
340 type_parameter.set_token_pos( | 340 type_parameter.set_token_pos( |
341 TokenPosition::SnapshotDecode(reader->Read<int32_t>())); | 341 TokenPosition::SnapshotDecode(reader->Read<int32_t>())); |
342 type_parameter.set_index(reader->Read<int16_t>()); | 342 type_parameter.set_index(reader->Read<int16_t>()); |
343 type_parameter.set_parent_level(reader->Read<uint8_t>()); | |
344 type_parameter.set_type_state(reader->Read<int8_t>()); | 343 type_parameter.set_type_state(reader->Read<int8_t>()); |
345 | 344 |
346 // Set all the object fields. | 345 // Set all the object fields. |
347 READ_OBJECT_FIELDS(type_parameter, type_parameter.raw()->from(), | 346 READ_OBJECT_FIELDS(type_parameter, type_parameter.raw()->from(), |
348 type_parameter.raw()->to(), kAsReference); | 347 type_parameter.raw()->to(), kAsReference); |
349 | 348 |
350 // Read in the parameterized class. | 349 // Read in the parameterized class. |
351 (*reader->ClassHandle()) = | 350 (*reader->ClassHandle()) = |
352 Class::RawCast(reader->ReadObjectImpl(kAsReference)); | 351 Class::RawCast(reader->ReadObjectImpl(kAsReference)); |
353 type_parameter.set_parameterized_class(*reader->ClassHandle()); | 352 type_parameter.set_parameterized_class(*reader->ClassHandle()); |
(...skipping 14 matching lines...) Expand all Loading... |
368 // Write out the serialization header value for this object. | 367 // Write out the serialization header value for this object. |
369 writer->WriteInlinedObjectHeader(object_id); | 368 writer->WriteInlinedObjectHeader(object_id); |
370 | 369 |
371 // Write out the class and tags information. | 370 // Write out the class and tags information. |
372 writer->WriteIndexedObject(kTypeParameterCid); | 371 writer->WriteIndexedObject(kTypeParameterCid); |
373 writer->WriteTags(writer->GetObjectTags(this)); | 372 writer->WriteTags(writer->GetObjectTags(this)); |
374 | 373 |
375 // Write out all the non object pointer fields. | 374 // Write out all the non object pointer fields. |
376 writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode()); | 375 writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode()); |
377 writer->Write<int16_t>(ptr()->index_); | 376 writer->Write<int16_t>(ptr()->index_); |
378 writer->Write<uint8_t>(ptr()->parent_level_); | |
379 writer->Write<int8_t>(ptr()->type_state_); | 377 writer->Write<int8_t>(ptr()->type_state_); |
380 | 378 |
381 // Write out all the object pointer fields. | 379 // Write out all the object pointer fields. |
382 SnapshotWriterVisitor visitor(writer, kAsReference); | 380 SnapshotWriterVisitor visitor(writer, kAsReference); |
383 visitor.VisitPointers(from(), to()); | 381 visitor.VisitPointers(from(), to()); |
384 | 382 |
385 // Write out the parameterized class. | 383 // Write out the parameterized class. |
386 RawClass* param_class = | 384 RawClass* param_class = |
387 writer->isolate()->class_table()->At(ptr()->parameterized_class_id_); | 385 writer->isolate()->class_table()->At(ptr()->parameterized_class_id_); |
388 writer->WriteObjectImpl(param_class, kAsReference); | 386 writer->WriteObjectImpl(param_class, kAsReference); |
(...skipping 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3068 // We do not allow objects with native fields in an isolate message. | 3066 // We do not allow objects with native fields in an isolate message. |
3069 writer->SetWriteException(Exceptions::kArgument, | 3067 writer->SetWriteException(Exceptions::kArgument, |
3070 "Illegal argument in isolate message" | 3068 "Illegal argument in isolate message" |
3071 " : (object is a UserTag)"); | 3069 " : (object is a UserTag)"); |
3072 } else { | 3070 } else { |
3073 UNREACHABLE(); | 3071 UNREACHABLE(); |
3074 } | 3072 } |
3075 } | 3073 } |
3076 | 3074 |
3077 } // namespace dart | 3075 } // namespace dart |
OLD | NEW |