Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: runtime/vm/raw_object_snapshot.cc

Issue 8372041: Canonicalize types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/bigint_operations.h" 5 #include "vm/bigint_operations.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/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 22 matching lines...) Expand all
33 ObjectKind kind = reader->Read<ObjectKind>(); 33 ObjectKind kind = reader->Read<ObjectKind>();
34 34
35 // Allocate class object of specified kind. 35 // Allocate class object of specified kind.
36 cls = Class::GetClass(kind); 36 cls = Class::GetClass(kind);
37 reader->AddBackwardReference(object_id, &cls); 37 reader->AddBackwardReference(object_id, &cls);
38 38
39 // Set all non object fields. 39 // Set all non object fields.
40 cls.set_instance_size(reader->Read<intptr_t>()); 40 cls.set_instance_size(reader->Read<intptr_t>());
41 cls.set_type_arguments_instance_field_offset(reader->Read<intptr_t>()); 41 cls.set_type_arguments_instance_field_offset(reader->Read<intptr_t>());
42 cls.set_num_constants(reader->Read<intptr_t>()); 42 cls.set_num_constants(reader->Read<intptr_t>());
43 cls.set_num_canonical_types(reader->Read<intptr_t>());
43 cls.set_next_field_offset(reader->Read<intptr_t>()); 44 cls.set_next_field_offset(reader->Read<intptr_t>());
44 cls.set_num_native_fields(reader->Read<intptr_t>()); 45 cls.set_num_native_fields(reader->Read<intptr_t>());
45 cls.set_class_state(reader->Read<int8_t>()); 46 cls.set_class_state(reader->Read<int8_t>());
46 if (reader->Read<bool>()) { 47 if (reader->Read<bool>()) {
47 cls.set_is_const(); 48 cls.set_is_const();
48 } 49 }
49 if (reader->Read<bool>()) { 50 if (reader->Read<bool>()) {
50 cls.set_is_interface(); 51 cls.set_is_interface();
51 } 52 }
52 53
(...skipping 23 matching lines...) Expand all
76 if (serialize_classes) { 77 if (serialize_classes) {
77 // Write out the class information. 78 // Write out the class information.
78 writer->WriteObjectHeader(kObjectId, Object::kClassClass); 79 writer->WriteObjectHeader(kObjectId, Object::kClassClass);
79 80
80 // Write out all the non object pointer fields. 81 // Write out all the non object pointer fields.
81 // NOTE: cpp_vtable_ is not written. 82 // NOTE: cpp_vtable_ is not written.
82 writer->Write<ObjectKind>(ptr()->instance_kind_); 83 writer->Write<ObjectKind>(ptr()->instance_kind_);
83 writer->Write<intptr_t>(ptr()->instance_size_); 84 writer->Write<intptr_t>(ptr()->instance_size_);
84 writer->Write<intptr_t>(ptr()->type_arguments_instance_field_offset_); 85 writer->Write<intptr_t>(ptr()->type_arguments_instance_field_offset_);
85 writer->Write<intptr_t>(ptr()->num_constants_); 86 writer->Write<intptr_t>(ptr()->num_constants_);
87 writer->Write<intptr_t>(ptr()->num_canonical_types_);
86 writer->Write<intptr_t>(ptr()->next_field_offset_); 88 writer->Write<intptr_t>(ptr()->next_field_offset_);
87 writer->Write<intptr_t>(ptr()->num_native_fields_); 89 writer->Write<intptr_t>(ptr()->num_native_fields_);
88 writer->Write<int8_t>(ptr()->class_state_); 90 writer->Write<int8_t>(ptr()->class_state_);
89 writer->Write<bool>(ptr()->is_const_); 91 writer->Write<bool>(ptr()->is_const_);
90 writer->Write<bool>(ptr()->is_interface_); 92 writer->Write<bool>(ptr()->is_interface_);
91 93
92 // Write out all the object pointer fields. 94 // Write out all the object pointer fields.
93 visitor.VisitPointers(from(), to()); 95 visitor.VisitPointers(from(), to());
94 } else { 96 } else {
95 writer->WriteClassId(this); 97 writer->WriteClassId(this);
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 // Write out all the other fields. 1324 // Write out all the other fields.
1323 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); 1325 writer->Write<RawObject*>(ptr()->num_bracket_expressions_);
1324 writer->WriteObject(ptr()->pattern_); 1326 writer->WriteObject(ptr()->pattern_);
1325 writer->Write<intptr_t>(ptr()->type_); 1327 writer->Write<intptr_t>(ptr()->type_);
1326 writer->Write<intptr_t>(ptr()->flags_); 1328 writer->Write<intptr_t>(ptr()->flags_);
1327 1329
1328 // Do not write out the data part which is native. 1330 // Do not write out the data part which is native.
1329 } 1331 }
1330 1332
1331 } // namespace dart 1333 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698