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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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(Bool) \ | 52 V(Bool) \ |
| 53 V(Array) \ | 53 V(Array) \ |
| 54 V(ImmutableArray) \ | 54 V(ImmutableArray) \ |
| 55 V(ByteBuffer) \ | |
| 55 V(Closure) \ | 56 V(Closure) \ |
| 56 V(Stacktrace) \ | 57 V(Stacktrace) \ |
| 57 V(JSRegExp) \ | 58 V(JSRegExp) \ |
| 58 | 59 |
| 59 #define CLASS_LIST(V) \ | 60 #define CLASS_LIST(V) \ |
| 60 V(Object) \ | 61 V(Object) \ |
| 61 CLASS_LIST_NO_OBJECT(V) | 62 CLASS_LIST_NO_OBJECT(V) |
| 62 | 63 |
| 63 | 64 |
| 64 // Forward declarations. | 65 // Forward declarations. |
| (...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 | 712 |
| 712 friend class RawImmutableArray; | 713 friend class RawImmutableArray; |
| 713 }; | 714 }; |
| 714 | 715 |
| 715 | 716 |
| 716 class RawImmutableArray : public RawArray { | 717 class RawImmutableArray : public RawArray { |
| 717 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); | 718 RAW_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray); |
| 718 }; | 719 }; |
| 719 | 720 |
| 720 | 721 |
| 722 class RawByteBuffer : public RawInstance { | |
| 723 RAW_HEAP_OBJECT_IMPLEMENTATION(ByteBuffer); | |
| 724 | |
| 725 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->length_); } | |
| 726 RawSmi* length_; | |
| 727 RawObject** to() { | |
|
Ivan Posva
2011/11/10 22:31:02
One line? Same as from() above?
cshapiro
2011/11/11 00:37:53
Sure. Done.
| |
| 728 return reinterpret_cast<RawObject**>(&ptr()->length_); | |
| 729 } | |
| 730 uint8_t* data_; | |
| 731 }; | |
| 732 | |
| 733 | |
| 721 class RawClosure : public RawInstance { | 734 class RawClosure : public RawInstance { |
| 722 RAW_HEAP_OBJECT_IMPLEMENTATION(Closure); | 735 RAW_HEAP_OBJECT_IMPLEMENTATION(Closure); |
| 723 | 736 |
| 724 RawObject** from() { | 737 RawObject** from() { |
| 725 return reinterpret_cast<RawObject**>(&ptr()->type_arguments_); | 738 return reinterpret_cast<RawObject**>(&ptr()->type_arguments_); |
| 726 } | 739 } |
| 727 RawTypeArguments* type_arguments_; | 740 RawTypeArguments* type_arguments_; |
| 728 RawFunction* function_; | 741 RawFunction* function_; |
| 729 RawContext* context_; | 742 RawContext* context_; |
| 730 // TODO(iposva): Remove this temporary hack. | 743 // TODO(iposva): Remove this temporary hack. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 769 intptr_t type_; // Uninitialized, simple or complex. | 782 intptr_t type_; // Uninitialized, simple or complex. |
| 770 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 783 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 771 | 784 |
| 772 // Variable length data follows here. | 785 // Variable length data follows here. |
| 773 uint8_t data_[0]; | 786 uint8_t data_[0]; |
| 774 }; | 787 }; |
| 775 | 788 |
| 776 } // namespace dart | 789 } // namespace dart |
| 777 | 790 |
| 778 #endif // VM_RAW_OBJECT_H_ | 791 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |