| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 classid_t class_id = reader->ReadClassIDValue(); | 54 classid_t class_id = reader->ReadClassIDValue(); |
| 55 | 55 |
| 56 // Allocate class object of specified kind. | 56 // Allocate class object of specified kind. |
| 57 if (Snapshot::IsFull(kind)) { | 57 if (Snapshot::IsFull(kind)) { |
| 58 cls = reader->NewClass(class_id); | 58 cls = reader->NewClass(class_id); |
| 59 } else { | 59 } else { |
| 60 if (class_id < kNumPredefinedCids) { | 60 if (class_id < kNumPredefinedCids) { |
| 61 ASSERT((class_id >= kInstanceCid) && (class_id <= kMirrorReferenceCid)); | 61 ASSERT((class_id >= kInstanceCid) && (class_id <= kMirrorReferenceCid)); |
| 62 cls = reader->isolate()->class_table()->At(class_id); | 62 cls = reader->isolate()->class_table()->At(class_id); |
| 63 } else { | 63 } else { |
| 64 cls = Class::New<Instance>(kIllegalCid); | 64 cls = Class::NewInstanceClass(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 reader->AddBackRef(object_id, &cls, kIsDeserialized); | 67 reader->AddBackRef(object_id, &cls, kIsDeserialized); |
| 68 | 68 |
| 69 // Set all non object fields. | 69 // Set all non object fields. |
| 70 if (!RawObject::IsInternalVMdefinedClassId(class_id)) { | 70 if (!RawObject::IsInternalVMdefinedClassId(class_id)) { |
| 71 // Instance size of a VM defined class is already set up. | 71 // Instance size of a VM defined class is already set up. |
| 72 cls.set_instance_size_in_words(reader->Read<int32_t>()); | 72 cls.set_instance_size_in_words(reader->Read<int32_t>()); |
| 73 cls.set_next_field_offset_in_words(reader->Read<int32_t>()); | 73 cls.set_next_field_offset_in_words(reader->Read<int32_t>()); |
| 74 } | 74 } |
| (...skipping 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3784 // We do not allow objects with native fields in an isolate message. | 3784 // We do not allow objects with native fields in an isolate message. |
| 3785 writer->SetWriteException(Exceptions::kArgument, | 3785 writer->SetWriteException(Exceptions::kArgument, |
| 3786 "Illegal argument in isolate message" | 3786 "Illegal argument in isolate message" |
| 3787 " : (object is a UserTag)"); | 3787 " : (object is a UserTag)"); |
| 3788 } else { | 3788 } else { |
| 3789 UNREACHABLE(); | 3789 UNREACHABLE(); |
| 3790 } | 3790 } |
| 3791 } | 3791 } |
| 3792 | 3792 |
| 3793 } // namespace dart | 3793 } // namespace dart |
| OLD | NEW |