| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 bool as_reference) { | 224 bool as_reference) { |
| 225 ASSERT(reader != NULL); | 225 ASSERT(reader != NULL); |
| 226 | 226 |
| 227 // Determine if the type class of this type is in the full snapshot. | 227 // Determine if the type class of this type is in the full snapshot. |
| 228 bool typeclass_is_in_fullsnapshot = reader->Read<bool>(); | 228 bool typeclass_is_in_fullsnapshot = reader->Read<bool>(); |
| 229 | 229 |
| 230 // Allocate type object. | 230 // Allocate type object. |
| 231 Type& type = Type::ZoneHandle(reader->zone(), NEW_OBJECT(Type)); | 231 Type& type = Type::ZoneHandle(reader->zone(), NEW_OBJECT(Type)); |
| 232 bool is_canonical = RawObject::IsCanonical(tags); | 232 bool is_canonical = RawObject::IsCanonical(tags); |
| 233 bool defer_canonicalization = is_canonical && | 233 bool defer_canonicalization = is_canonical && |
| 234 (!Snapshot::IsFull(kind) && typeclass_is_in_fullsnapshot); | 234 ((kind == Snapshot::kMessage) || |
| 235 (!Snapshot::IsFull(kind) && typeclass_is_in_fullsnapshot)); |
| 235 reader->AddBackRef(object_id, &type, kIsDeserialized, defer_canonicalization); | 236 reader->AddBackRef(object_id, &type, kIsDeserialized, defer_canonicalization); |
| 236 | 237 |
| 237 // Set all non object fields. | 238 // Set all non object fields. |
| 238 type.set_token_pos(TokenPosition::SnapshotDecode(reader->Read<int32_t>())); | 239 type.set_token_pos(TokenPosition::SnapshotDecode(reader->Read<int32_t>())); |
| 239 type.set_type_state(reader->Read<int8_t>()); | 240 type.set_type_state(reader->Read<int8_t>()); |
| 240 | 241 |
| 241 // Set all the object fields. | 242 // Set all the object fields. |
| 242 READ_OBJECT_FIELDS(type, type.raw()->from(), type.raw()->to(), kAsReference); | 243 READ_OBJECT_FIELDS(type, type.raw()->from(), type.raw()->to(), kAsReference); |
| 243 | 244 |
| 244 // Read in the type class. | 245 // Read in the type class. |
| (...skipping 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3319 // We do not allow objects with native fields in an isolate message. | 3320 // We do not allow objects with native fields in an isolate message. |
| 3320 writer->SetWriteException(Exceptions::kArgument, | 3321 writer->SetWriteException(Exceptions::kArgument, |
| 3321 "Illegal argument in isolate message" | 3322 "Illegal argument in isolate message" |
| 3322 " : (object is a UserTag)"); | 3323 " : (object is a UserTag)"); |
| 3323 } else { | 3324 } else { |
| 3324 UNREACHABLE(); | 3325 UNREACHABLE(); |
| 3325 } | 3326 } |
| 3326 } | 3327 } |
| 3327 | 3328 |
| 3328 } // namespace dart | 3329 } // namespace dart |
| OLD | NEW |