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 VM_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define 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/globals.h" | 10 #include "vm/globals.h" |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 | 1599 |
1600 | 1600 |
1601 class RawSmi : public RawInteger { | 1601 class RawSmi : public RawInteger { |
1602 RAW_OBJECT_IMPLEMENTATION(Smi); | 1602 RAW_OBJECT_IMPLEMENTATION(Smi); |
1603 }; | 1603 }; |
1604 | 1604 |
1605 | 1605 |
1606 class RawMint : public RawInteger { | 1606 class RawMint : public RawInteger { |
1607 RAW_HEAP_OBJECT_IMPLEMENTATION(Mint); | 1607 RAW_HEAP_OBJECT_IMPLEMENTATION(Mint); |
1608 | 1608 |
1609 int64_t value_; | 1609 ALIGN8 int64_t value_; |
1610 | 1610 |
1611 friend class Api; | 1611 friend class Api; |
1612 friend class SnapshotReader; | 1612 friend class SnapshotReader; |
1613 }; | 1613 }; |
| 1614 COMPILE_ASSERT(sizeof(RawMint) == 16); |
1614 | 1615 |
1615 | 1616 |
1616 class RawBigint : public RawInteger { | 1617 class RawBigint : public RawInteger { |
1617 RAW_HEAP_OBJECT_IMPLEMENTATION(Bigint); | 1618 RAW_HEAP_OBJECT_IMPLEMENTATION(Bigint); |
1618 | 1619 |
1619 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->neg_); } | 1620 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->neg_); } |
1620 RawBool* neg_; | 1621 RawBool* neg_; |
1621 RawSmi* used_; | 1622 RawSmi* used_; |
1622 RawTypedData* digits_; | 1623 RawTypedData* digits_; |
1623 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->digits_); } | 1624 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->digits_); } |
1624 }; | 1625 }; |
1625 | 1626 |
1626 | 1627 |
1627 class RawDouble : public RawNumber { | 1628 class RawDouble : public RawNumber { |
1628 RAW_HEAP_OBJECT_IMPLEMENTATION(Double); | 1629 RAW_HEAP_OBJECT_IMPLEMENTATION(Double); |
1629 | 1630 |
1630 double value_; | 1631 ALIGN8 double value_; |
1631 | 1632 |
1632 friend class Api; | 1633 friend class Api; |
1633 friend class SnapshotReader; | 1634 friend class SnapshotReader; |
1634 }; | 1635 }; |
| 1636 COMPILE_ASSERT(sizeof(RawDouble) == 16); |
1635 | 1637 |
1636 | 1638 |
1637 class RawString : public RawInstance { | 1639 class RawString : public RawInstance { |
1638 RAW_HEAP_OBJECT_IMPLEMENTATION(String); | 1640 RAW_HEAP_OBJECT_IMPLEMENTATION(String); |
1639 | 1641 |
1640 protected: | 1642 protected: |
1641 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1643 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
1642 RawSmi* length_; | 1644 RawSmi* length_; |
1643 RawSmi* hash_; | 1645 RawSmi* hash_; |
1644 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); } | 1646 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->hash_); } |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2231 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2233 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2232 kTypedDataInt8ArrayViewCid + 15); | 2234 kTypedDataInt8ArrayViewCid + 15); |
2233 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2235 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2234 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2236 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2235 return (kNullCid - kTypedDataInt8ArrayCid); | 2237 return (kNullCid - kTypedDataInt8ArrayCid); |
2236 } | 2238 } |
2237 | 2239 |
2238 } // namespace dart | 2240 } // namespace dart |
2239 | 2241 |
2240 #endif // VM_RAW_OBJECT_H_ | 2242 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |