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/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return kInvalidIndex; | 110 return kInvalidIndex; |
111 } | 111 } |
112 | 112 |
113 | 113 |
114 // TODO(5411462): Temporary setup of snapshot for testing purposes, | 114 // TODO(5411462): Temporary setup of snapshot for testing purposes, |
115 // the actual creation of a snapshot maybe done differently. | 115 // the actual creation of a snapshot maybe done differently. |
116 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { | 116 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { |
117 ASSERT(raw_memory != NULL); | 117 ASSERT(raw_memory != NULL); |
118 ASSERT(kHeaderSize == sizeof(Snapshot)); | 118 ASSERT(kHeaderSize == sizeof(Snapshot)); |
119 ASSERT(kLengthIndex == length_offset()); | 119 ASSERT(kLengthIndex == length_offset()); |
120 ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == kind_offset()); | 120 ASSERT((kSnapshotFlagIndex * sizeof(int64_t)) == kind_offset()); |
121 ASSERT((kHeapObjectTag & kInlined)); | 121 ASSERT((kHeapObjectTag & kInlined)); |
122 // The kWatchedBit and kMarkBit are only set during GC operations. This | 122 // The kWatchedBit and kMarkBit are only set during GC operations. This |
123 // allows the two low bits in the header to be used for snapshotting. | 123 // allows the two low bits in the header to be used for snapshotting. |
124 ASSERT(kObjectId == | 124 ASSERT(kObjectId == |
125 ((1 << RawObject::kWatchedBit) | (1 << RawObject::kMarkBit))); | 125 ((1 << RawObject::kWatchedBit) | (1 << RawObject::kMarkBit))); |
126 ASSERT((kObjectAlignmentMask & kObjectId) == kObjectId); | 126 ASSERT((kObjectAlignmentMask & kObjectId) == kObjectId); |
127 const Snapshot* snapshot = reinterpret_cast<const Snapshot*>(raw_memory); | 127 const Snapshot* snapshot = reinterpret_cast<const Snapshot*>(raw_memory); |
128 return snapshot; | 128 return snapshot; |
129 } | 129 } |
130 | 130 |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1540 NoGCScope no_gc; | 1540 NoGCScope no_gc; |
1541 WriteObject(obj.raw()); | 1541 WriteObject(obj.raw()); |
1542 UnmarkAll(); | 1542 UnmarkAll(); |
1543 } else { | 1543 } else { |
1544 ThrowException(exception_type(), exception_msg()); | 1544 ThrowException(exception_type(), exception_msg()); |
1545 } | 1545 } |
1546 } | 1546 } |
1547 | 1547 |
1548 | 1548 |
1549 } // namespace dart | 1549 } // namespace dart |
OLD | NEW |