Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/snapshot.h" | 10 #include "vm/snapshot.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 V(Number) \ | 42 V(Number) \ |
| 43 V(Integer) \ | 43 V(Integer) \ |
| 44 V(Smi) \ | 44 V(Smi) \ |
| 45 V(Mint) \ | 45 V(Mint) \ |
| 46 V(Bigint) \ | 46 V(Bigint) \ |
| 47 V(Double) \ | 47 V(Double) \ |
| 48 V(String) \ | 48 V(String) \ |
| 49 V(OneByteString) \ | 49 V(OneByteString) \ |
| 50 V(TwoByteString) \ | 50 V(TwoByteString) \ |
| 51 V(FourByteString) \ | 51 V(FourByteString) \ |
| 52 V(ExternalOneByteString) \ | |
| 53 V(ExternalTwoByteString) \ | |
| 54 V(ExternalFourByteString) \ | |
| 52 V(Bool) \ | 55 V(Bool) \ |
| 53 V(Array) \ | 56 V(Array) \ |
| 54 V(ImmutableArray) \ | 57 V(ImmutableArray) \ |
| 55 V(Closure) \ | 58 V(Closure) \ |
| 56 V(Stacktrace) \ | 59 V(Stacktrace) \ |
| 57 V(JSRegExp) \ | 60 V(JSRegExp) \ |
| 58 | 61 |
| 59 #define CLASS_LIST(V) \ | 62 #define CLASS_LIST(V) \ |
| 60 V(Object) \ | 63 V(Object) \ |
| 61 CLASS_LIST_NO_OBJECT(V) | 64 CLASS_LIST_NO_OBJECT(V) |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 678 | 681 |
| 679 | 682 |
| 680 class RawFourByteString : public RawString { | 683 class RawFourByteString : public RawString { |
| 681 RAW_HEAP_OBJECT_IMPLEMENTATION(FourByteString); | 684 RAW_HEAP_OBJECT_IMPLEMENTATION(FourByteString); |
| 682 | 685 |
| 683 // Variable length data follows here. | 686 // Variable length data follows here. |
| 684 uint32_t data_[0]; | 687 uint32_t data_[0]; |
| 685 }; | 688 }; |
| 686 | 689 |
| 687 | 690 |
| 691 template<typename T> | |
| 692 class RawExternalStringData { | |
|
Ivan Posva
2011/11/18 19:36:44
As I mentioned before this should really not be na
cshapiro
2011/11/19 01:08:29
Done. This has been renamed to ExternalStringData
| |
| 693 public: | |
| 694 typedef void Callback(void* peer); | |
| 695 RawExternalStringData(const T* data, void* peer, Callback* callback) : | |
| 696 data_(data), peer_(peer), callback_(callback) { | |
| 697 } | |
| 698 const T* data_; | |
| 699 void* peer_; | |
| 700 Callback* callback_; | |
| 701 }; | |
| 702 | |
| 703 | |
| 704 class RawExternalOneByteString : public RawString { | |
| 705 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalOneByteString); | |
| 706 | |
| 707 RawExternalStringData<uint8_t>* external_data_; | |
| 708 }; | |
| 709 | |
| 710 | |
| 711 class RawExternalTwoByteString : public RawString { | |
| 712 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalTwoByteString); | |
| 713 | |
| 714 RawExternalStringData<uint16_t>* external_data_; | |
| 715 }; | |
| 716 | |
| 717 | |
| 718 class RawExternalFourByteString : public RawString { | |
| 719 RAW_HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString); | |
| 720 | |
| 721 RawExternalStringData<uint32_t>* external_data_; | |
| 722 }; | |
| 723 | |
| 724 | |
| 688 class RawBool : public RawInstance { | 725 class RawBool : public RawInstance { |
| 689 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool); | 726 RAW_HEAP_OBJECT_IMPLEMENTATION(Bool); |
| 690 | 727 |
| 691 bool value_; | 728 bool value_; |
| 692 }; | 729 }; |
| 693 | 730 |
| 694 | 731 |
| 695 class RawArray : public RawInstance { | 732 class RawArray : public RawInstance { |
| 696 RAW_HEAP_OBJECT_IMPLEMENTATION(Array); | 733 RAW_HEAP_OBJECT_IMPLEMENTATION(Array); |
| 697 | 734 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 intptr_t type_; // Uninitialized, simple or complex. | 806 intptr_t type_; // Uninitialized, simple or complex. |
| 770 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 807 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 771 | 808 |
| 772 // Variable length data follows here. | 809 // Variable length data follows here. |
| 773 uint8_t data_[0]; | 810 uint8_t data_[0]; |
| 774 }; | 811 }; |
| 775 | 812 |
| 776 } // namespace dart | 813 } // namespace dart |
| 777 | 814 |
| 778 #endif // VM_RAW_OBJECT_H_ | 815 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |