| 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/snapshot.h" | 5 #include "vm/snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 offset += kWordSize; | 974 offset += kWordSize; |
| 975 } | 975 } |
| 976 if (kind_ == Snapshot::kFull) { | 976 if (kind_ == Snapshot::kFull) { |
| 977 // We create an uninitialized object in the case of full snapshots, so | 977 // We create an uninitialized object in the case of full snapshots, so |
| 978 // we need to initialize any remaining padding area with the Null object. | 978 // we need to initialize any remaining padding area with the Null object. |
| 979 while (offset < instance_size) { | 979 while (offset < instance_size) { |
| 980 result->SetFieldAtOffset(offset, Object::null_object()); | 980 result->SetFieldAtOffset(offset, Object::null_object()); |
| 981 offset += kWordSize; | 981 offset += kWordSize; |
| 982 } | 982 } |
| 983 result->SetCreatedFromSnapshot(); | 983 result->SetCreatedFromSnapshot(); |
| 984 } else if (result->IsCanonical()) { | 984 } else if (RawObject::IsCanonical(tags)) { |
| 985 *result = result->CheckAndCanonicalize(NULL); | 985 *result = result->CheckAndCanonicalize(NULL); |
| 986 ASSERT(!result->IsNull()); | 986 ASSERT(!result->IsNull()); |
| 987 } | 987 } |
| 988 return result->raw(); | 988 return result->raw(); |
| 989 } | 989 } |
| 990 ASSERT((class_header & kSmiTagMask) != kSmiTag); | 990 ASSERT((class_header & kSmiTagMask) != kSmiTag); |
| 991 intptr_t class_id = LookupInternalClass(class_header); | 991 intptr_t class_id = LookupInternalClass(class_header); |
| 992 switch (class_id) { | 992 switch (class_id) { |
| 993 #define SNAPSHOT_READ(clazz) \ | 993 #define SNAPSHOT_READ(clazz) \ |
| 994 case clazz::kClassId: { \ | 994 case clazz::kClassId: { \ |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 NoGCScope no_gc; | 1761 NoGCScope no_gc; |
| 1762 WriteObject(obj.raw()); | 1762 WriteObject(obj.raw()); |
| 1763 UnmarkAll(); | 1763 UnmarkAll(); |
| 1764 } else { | 1764 } else { |
| 1765 ThrowException(exception_type(), exception_msg()); | 1765 ThrowException(exception_type(), exception_msg()); |
| 1766 } | 1766 } |
| 1767 } | 1767 } |
| 1768 | 1768 |
| 1769 | 1769 |
| 1770 } // namespace dart | 1770 } // namespace dart |
| OLD | NEW |