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/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 | 707 |
708 | 708 |
709 class RawTokenStream : public RawObject { | 709 class RawTokenStream : public RawObject { |
710 RAW_HEAP_OBJECT_IMPLEMENTATION(TokenStream); | 710 RAW_HEAP_OBJECT_IMPLEMENTATION(TokenStream); |
711 | 711 |
712 RawObject** from() { | 712 RawObject** from() { |
713 return reinterpret_cast<RawObject**>(&ptr()->private_key_); | 713 return reinterpret_cast<RawObject**>(&ptr()->private_key_); |
714 } | 714 } |
715 RawString* private_key_; // Key used for private identifiers. | 715 RawString* private_key_; // Key used for private identifiers. |
716 RawArray* token_objects_; | 716 RawArray* token_objects_; |
717 RawExternalUint8Array* stream_; | 717 RawExternalTypedData* stream_; |
718 RawObject** to() { | 718 RawObject** to() { |
719 return reinterpret_cast<RawObject**>(&ptr()->stream_); | 719 return reinterpret_cast<RawObject**>(&ptr()->stream_); |
720 } | 720 } |
721 | 721 |
722 friend class SnapshotReader; | 722 friend class SnapshotReader; |
723 }; | 723 }; |
724 | 724 |
725 | 725 |
726 class RawScript : public RawObject { | 726 class RawScript : public RawObject { |
727 public: | 727 public: |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 class RawExternalTypedData : public RawInstance { | 1448 class RawExternalTypedData : public RawInstance { |
1449 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTypedData); | 1449 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTypedData); |
1450 | 1450 |
1451 protected: | 1451 protected: |
1452 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1452 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
1453 RawSmi* length_; | 1453 RawSmi* length_; |
1454 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1454 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
1455 | 1455 |
1456 uint8_t* data_; | 1456 uint8_t* data_; |
1457 void* peer_; | 1457 void* peer_; |
| 1458 |
| 1459 friend class TokenStream; |
| 1460 friend class RawTokenStream; |
1458 }; | 1461 }; |
1459 | 1462 |
1460 | 1463 |
1461 class RawByteArray : public RawInstance { | 1464 class RawByteArray : public RawInstance { |
1462 RAW_HEAP_OBJECT_IMPLEMENTATION(ByteArray); | 1465 RAW_HEAP_OBJECT_IMPLEMENTATION(ByteArray); |
1463 | 1466 |
1464 protected: | 1467 protected: |
1465 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1468 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
1466 RawSmi* length_; | 1469 RawSmi* length_; |
1467 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | 1470 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->length_); } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 void* peer_; | 1577 void* peer_; |
1575 }; | 1578 }; |
1576 | 1579 |
1577 | 1580 |
1578 class RawExternalUint8Array : public RawByteArray { | 1581 class RawExternalUint8Array : public RawByteArray { |
1579 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint8Array); | 1582 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint8Array); |
1580 | 1583 |
1581 uint8_t* data_; | 1584 uint8_t* data_; |
1582 void* peer_; | 1585 void* peer_; |
1583 | 1586 |
1584 friend class TokenStream; | |
1585 friend class RawTokenStream; | |
1586 friend class RawExternalUint8ClampedArray; | 1587 friend class RawExternalUint8ClampedArray; |
1587 }; | 1588 }; |
1588 | 1589 |
1589 | 1590 |
1590 class RawExternalUint8ClampedArray : public RawExternalUint8Array { | 1591 class RawExternalUint8ClampedArray : public RawExternalUint8Array { |
1591 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint8ClampedArray); | 1592 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalUint8ClampedArray); |
1592 }; | 1593 }; |
1593 | 1594 |
1594 | 1595 |
1595 class RawExternalInt16Array : public RawByteArray { | 1596 class RawExternalInt16Array : public RawByteArray { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 // Make sure this is updated when new TypedData types are added. | 1939 // Make sure this is updated when new TypedData types are added. |
1939 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11); | 1940 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 11); |
1940 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12); | 1941 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 12); |
1941 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); | 1942 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 11); |
1942 return (kNullCid - kTypedDataInt8ArrayCid); | 1943 return (kNullCid - kTypedDataInt8ArrayCid); |
1943 } | 1944 } |
1944 | 1945 |
1945 } // namespace dart | 1946 } // namespace dart |
1946 | 1947 |
1947 #endif // VM_RAW_OBJECT_H_ | 1948 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |