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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 // Allocate library prefix object. | 1182 // Allocate library prefix object. |
1183 LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(reader->zone(), | 1183 LibraryPrefix& prefix = LibraryPrefix::ZoneHandle(reader->zone(), |
1184 LibraryPrefix::New()); | 1184 LibraryPrefix::New()); |
1185 reader->AddBackRef(object_id, &prefix, kIsDeserialized); | 1185 reader->AddBackRef(object_id, &prefix, kIsDeserialized); |
1186 | 1186 |
1187 // Set all non object fields. | 1187 // Set all non object fields. |
1188 prefix.StoreNonPointer(&prefix.raw_ptr()->num_imports_, | 1188 prefix.StoreNonPointer(&prefix.raw_ptr()->num_imports_, |
1189 reader->Read<int16_t>()); | 1189 reader->Read<int16_t>()); |
1190 prefix.StoreNonPointer(&prefix.raw_ptr()->is_deferred_load_, | 1190 prefix.StoreNonPointer(&prefix.raw_ptr()->is_deferred_load_, |
1191 reader->Read<bool>()); | 1191 reader->Read<bool>()); |
1192 prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_, reader->Read<bool>()); | 1192 prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_, false); |
1193 | 1193 |
1194 // Set all the object fields. | 1194 // Set all the object fields. |
1195 READ_OBJECT_FIELDS(prefix, | 1195 READ_OBJECT_FIELDS(prefix, |
1196 prefix.raw()->from(), | 1196 prefix.raw()->from(), |
1197 prefix.raw()->to_snapshot(kind), | 1197 prefix.raw()->to_snapshot(kind), |
1198 kAsReference); | 1198 kAsReference); |
1199 prefix.StorePointer(&prefix.raw_ptr()->dependent_code_, | 1199 prefix.StorePointer(&prefix.raw_ptr()->dependent_code_, |
1200 Array::null()); | 1200 Array::null()); |
1201 | 1201 |
1202 return prefix.raw(); | 1202 return prefix.raw(); |
(...skipping 10 matching lines...) Expand all Loading... |
1213 // Write out the serialization header value for this object. | 1213 // Write out the serialization header value for this object. |
1214 writer->WriteInlinedObjectHeader(object_id); | 1214 writer->WriteInlinedObjectHeader(object_id); |
1215 | 1215 |
1216 // Write out the class and tags information. | 1216 // Write out the class and tags information. |
1217 writer->WriteIndexedObject(kLibraryPrefixCid); | 1217 writer->WriteIndexedObject(kLibraryPrefixCid); |
1218 writer->WriteTags(writer->GetObjectTags(this)); | 1218 writer->WriteTags(writer->GetObjectTags(this)); |
1219 | 1219 |
1220 // Write out all non object fields. | 1220 // Write out all non object fields. |
1221 writer->Write<int16_t>(ptr()->num_imports_); | 1221 writer->Write<int16_t>(ptr()->num_imports_); |
1222 writer->Write<bool>(ptr()->is_deferred_load_); | 1222 writer->Write<bool>(ptr()->is_deferred_load_); |
1223 writer->Write<bool>(ptr()->is_loaded_); | |
1224 | 1223 |
1225 // Write out all the object pointer fields. | 1224 // Write out all the object pointer fields. |
1226 SnapshotWriterVisitor visitor(writer, kAsReference); | 1225 SnapshotWriterVisitor visitor(writer, kAsReference); |
1227 visitor.VisitPointers(from(), to_snapshot(kind)); | 1226 visitor.VisitPointers(from(), to_snapshot(kind)); |
1228 } | 1227 } |
1229 | 1228 |
1230 | 1229 |
1231 RawNamespace* Namespace::ReadFrom(SnapshotReader* reader, | 1230 RawNamespace* Namespace::ReadFrom(SnapshotReader* reader, |
1232 intptr_t object_id, | 1231 intptr_t object_id, |
1233 intptr_t tags, | 1232 intptr_t tags, |
(...skipping 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3071 // We do not allow objects with native fields in an isolate message. | 3070 // We do not allow objects with native fields in an isolate message. |
3072 writer->SetWriteException(Exceptions::kArgument, | 3071 writer->SetWriteException(Exceptions::kArgument, |
3073 "Illegal argument in isolate message" | 3072 "Illegal argument in isolate message" |
3074 " : (object is a UserTag)"); | 3073 " : (object is a UserTag)"); |
3075 } else { | 3074 } else { |
3076 UNREACHABLE(); | 3075 UNREACHABLE(); |
3077 } | 3076 } |
3078 } | 3077 } |
3079 | 3078 |
3080 } // namespace dart | 3079 } // namespace dart |
OLD | NEW |