Chromium Code Reviews| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 | 115 |
| 116 | 116 |
| 117 // TODO(5411462): Temporary setup of snapshot for testing purposes, | 117 // TODO(5411462): Temporary setup of snapshot for testing purposes, |
| 118 // the actual creation of a snapshot maybe done differently. | 118 // the actual creation of a snapshot maybe done differently. |
| 119 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { | 119 const Snapshot* Snapshot::SetupFromBuffer(const void* raw_memory) { |
| 120 ASSERT(raw_memory != NULL); | 120 ASSERT(raw_memory != NULL); |
| 121 ASSERT(kHeaderSize == sizeof(Snapshot)); | 121 ASSERT(kHeaderSize == sizeof(Snapshot)); |
| 122 ASSERT(kLengthIndex == length_offset()); | 122 ASSERT(kLengthIndex == length_offset()); |
| 123 ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == kind_offset()); | 123 ASSERT((kSnapshotFlagIndex * sizeof(int32_t)) == kind_offset()); |
| 124 ASSERT((kHeapObjectTag & kInlined)); | 124 ASSERT((kHeapObjectTag & kInlined)); |
| 125 // No object can have kFreeBit and kMarkBit set simultaneously. If kFreeBit | 125 // No object can have kFreeBit and kMarkBit set simultaneously. If kFreeBit |
|
Vyacheslav Egorov (Google)
2013/04/30 14:36:01
comment mentions kFreeBit
Ivan Posva
2013/04/30 15:03:53
Done.
| |
| 126 // is set then the rest of tags is a pointer to the next FreeListElement which | 126 // is set then the rest of tags is a pointer to the next FreeListElement which |
| 127 // is kObjectAlignment aligned and has at least 2 lower bits set to zero. | 127 // is kObjectAlignment aligned and has at least 2 lower bits set to zero. |
| 128 ASSERT(kObjectId == | 128 ASSERT(kObjectId == |
| 129 ((1 << RawObject::kFreeBit) | (1 << RawObject::kMarkBit))); | 129 ((1 << RawObject::kWatchedBit) | (1 << RawObject::kMarkBit))); |
| 130 ASSERT((kObjectAlignmentMask & kObjectId) == kObjectId); | 130 ASSERT((kObjectAlignmentMask & kObjectId) == kObjectId); |
| 131 const Snapshot* snapshot = reinterpret_cast<const Snapshot*>(raw_memory); | 131 const Snapshot* snapshot = reinterpret_cast<const Snapshot*>(raw_memory); |
| 132 return snapshot; | 132 return snapshot; |
| 133 } | 133 } |
| 134 | 134 |
| 135 | 135 |
| 136 RawSmi* BaseReader::ReadAsSmi() { | 136 RawSmi* BaseReader::ReadAsSmi() { |
| 137 intptr_t value = ReadIntptrValue(); | 137 intptr_t value = ReadIntptrValue(); |
| 138 ASSERT((value & kSmiTagMask) == kSmiTag); | 138 ASSERT((value & kSmiTagMask) == kSmiTag); |
| 139 return reinterpret_cast<RawSmi*>(value); | 139 return reinterpret_cast<RawSmi*>(value); |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1463 UnmarkAll(); | 1463 UnmarkAll(); |
| 1464 isolate->set_long_jump_base(base); | 1464 isolate->set_long_jump_base(base); |
| 1465 } else { | 1465 } else { |
| 1466 isolate->set_long_jump_base(base); | 1466 isolate->set_long_jump_base(base); |
| 1467 ThrowException(exception_type(), exception_msg()); | 1467 ThrowException(exception_type(), exception_msg()); |
| 1468 } | 1468 } |
| 1469 } | 1469 } |
| 1470 | 1470 |
| 1471 | 1471 |
| 1472 } // namespace dart | 1472 } // namespace dart |
| OLD | NEW |