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 #ifndef RUNTIME_VM_RAW_OBJECT_H_ | 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_ |
6 #define RUNTIME_VM_RAW_OBJECT_H_ | 6 #define RUNTIME_VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 kMarkBit = 0, | 264 kMarkBit = 0, |
265 kCanonicalBit = 1, | 265 kCanonicalBit = 1, |
266 kVMHeapObjectBit = 2, | 266 kVMHeapObjectBit = 2, |
267 kRememberedBit = 3, | 267 kRememberedBit = 3, |
268 kReservedTagPos = 4, // kReservedBit{100K,1M,10M} | 268 kReservedTagPos = 4, // kReservedBit{100K,1M,10M} |
269 kReservedTagSize = 4, | 269 kReservedTagSize = 4, |
270 kSizeTagPos = kReservedTagPos + kReservedTagSize, // = 8 | 270 kSizeTagPos = kReservedTagPos + kReservedTagSize, // = 8 |
271 kSizeTagSize = 8, | 271 kSizeTagSize = 8, |
272 kClassIdTagPos = kSizeTagPos + kSizeTagSize, // = 16 | 272 kClassIdTagPos = kSizeTagPos + kSizeTagSize, // = 16 |
273 kClassIdTagSize = 16, | 273 kClassIdTagSize = 16, |
| 274 #if defined(HASH_IN_OBJECT_HEADER) |
| 275 kHashTagPos = kClassIdTagPos + kClassIdTagSize, // = 32 |
| 276 kHashTagSize = 16, |
| 277 #endif |
274 }; | 278 }; |
275 | 279 |
276 COMPILE_ASSERT(kClassIdTagSize == (sizeof(classid_t) * kBitsPerByte)); | 280 COMPILE_ASSERT(kClassIdTagSize == (sizeof(classid_t) * kBitsPerByte)); |
277 | 281 |
278 // Encodes the object size in the tag in units of object alignment. | 282 // Encodes the object size in the tag in units of object alignment. |
279 class SizeTag { | 283 class SizeTag { |
280 public: | 284 public: |
281 static const intptr_t kMaxSizeTag = ((1 << RawObject::kSizeTagSize) - 1) | 285 static const intptr_t kMaxSizeTag = ((1 << RawObject::kSizeTagSize) - 1) |
282 << kObjectAlignmentLog2; | 286 << kObjectAlignmentLog2; |
283 | 287 |
(...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 kTypedDataInt8ArrayViewCid + 15); | 2455 kTypedDataInt8ArrayViewCid + 15); |
2452 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2456 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2453 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2457 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2454 return (kNullCid - kTypedDataInt8ArrayCid); | 2458 return (kNullCid - kTypedDataInt8ArrayCid); |
2455 } | 2459 } |
2456 | 2460 |
2457 | 2461 |
2458 } // namespace dart | 2462 } // namespace dart |
2459 | 2463 |
2460 #endif // RUNTIME_VM_RAW_OBJECT_H_ | 2464 #endif // RUNTIME_VM_RAW_OBJECT_H_ |
OLD | NEW |