| 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 21 matching lines...) Expand all Loading... |
| 32 V(Script) \ | 32 V(Script) \ |
| 33 V(Library) \ | 33 V(Library) \ |
| 34 V(LibraryPrefix) \ | 34 V(LibraryPrefix) \ |
| 35 V(Code) \ | 35 V(Code) \ |
| 36 V(Instructions) \ | 36 V(Instructions) \ |
| 37 V(PcDescriptors) \ | 37 V(PcDescriptors) \ |
| 38 V(LocalVarDescriptors) \ | 38 V(LocalVarDescriptors) \ |
| 39 V(ExceptionHandlers) \ | 39 V(ExceptionHandlers) \ |
| 40 V(Context) \ | 40 V(Context) \ |
| 41 V(ContextScope) \ | 41 V(ContextScope) \ |
| 42 V(ICData) \ |
| 42 V(Error) \ | 43 V(Error) \ |
| 43 V(ApiError) \ | 44 V(ApiError) \ |
| 44 V(LanguageError) \ | 45 V(LanguageError) \ |
| 45 V(UnhandledException) \ | 46 V(UnhandledException) \ |
| 46 V(UnwindError) \ | 47 V(UnwindError) \ |
| 47 V(Instance) \ | 48 V(Instance) \ |
| 48 V(Number) \ | 49 V(Number) \ |
| 49 V(Integer) \ | 50 V(Integer) \ |
| 50 V(Smi) \ | 51 V(Smi) \ |
| 51 V(Mint) \ | 52 V(Mint) \ |
| 52 V(Bigint) \ | 53 V(Bigint) \ |
| 53 V(Double) \ | 54 V(Double) \ |
| 54 V(String) \ | 55 V(String) \ |
| 55 V(OneByteString) \ | 56 V(OneByteString) \ |
| 56 V(TwoByteString) \ | 57 V(TwoByteString) \ |
| 57 V(FourByteString) \ | 58 V(FourByteString) \ |
| 58 V(ExternalOneByteString) \ | 59 V(ExternalOneByteString) \ |
| 59 V(ExternalTwoByteString) \ | 60 V(ExternalTwoByteString) \ |
| 60 V(ExternalFourByteString) \ | 61 V(ExternalFourByteString) \ |
| 61 V(Bool) \ | 62 V(Bool) \ |
| 62 V(Array) \ | 63 V(Array) \ |
| 63 V(ImmutableArray) \ | 64 V(ImmutableArray) \ |
| 64 V(GrowableObjectArray) \ | 65 V(GrowableObjectArray) \ |
| 65 V(ByteArray) \ | 66 V(ByteArray) \ |
| 66 V(InternalByteArray) \ | 67 V(InternalByteArray) \ |
| 67 V(ExternalByteArray) \ | 68 V(ExternalByteArray) \ |
| 68 V(Closure) \ | 69 V(Closure) \ |
| 69 V(Stacktrace) \ | 70 V(Stacktrace) \ |
| 70 V(JSRegExp) \ | 71 V(JSRegExp) \ |
| 71 V(ICData) \ | |
| 72 | 72 |
| 73 #define CLASS_LIST(V) \ | 73 #define CLASS_LIST(V) \ |
| 74 V(Object) \ | 74 V(Object) \ |
| 75 CLASS_LIST_NO_OBJECT(V) | 75 CLASS_LIST_NO_OBJECT(V) |
| 76 | 76 |
| 77 | 77 |
| 78 // Forward declarations. | 78 // Forward declarations. |
| 79 class Isolate; | 79 class Isolate; |
| 80 #define DEFINE_FORWARD_DECLARATION(clazz) \ | 80 #define DEFINE_FORWARD_DECLARATION(clazz) \ |
| 81 class Raw##clazz; | 81 class Raw##clazz; |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 // Variable length data follows here. | 753 // Variable length data follows here. |
| 754 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->data_[0]); } | 754 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->data_[0]); } |
| 755 RawObject* data_[0]; | 755 RawObject* data_[0]; |
| 756 RawObject** to(intptr_t num_vars) { | 756 RawObject** to(intptr_t num_vars) { |
| 757 intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize); | 757 intptr_t data_length = num_vars * (sizeof(VariableDesc)/kWordSize); |
| 758 return reinterpret_cast<RawObject**>(&ptr()->data_[data_length - 1]); | 758 return reinterpret_cast<RawObject**>(&ptr()->data_[data_length - 1]); |
| 759 } | 759 } |
| 760 }; | 760 }; |
| 761 | 761 |
| 762 | 762 |
| 763 class RawICData : public RawObject { |
| 764 RAW_HEAP_OBJECT_IMPLEMENTATION(ICData); |
| 765 |
| 766 RawObject** from() { |
| 767 return reinterpret_cast<RawObject**>(&ptr()->function_); |
| 768 } |
| 769 RawFunction* function_; // Parent/calling function of this IC. |
| 770 RawString* target_name_; // Name of target function. |
| 771 RawArray* ic_data_; // Contains test classes and target function. |
| 772 RawObject** to() { |
| 773 return reinterpret_cast<RawObject**>(&ptr()->ic_data_); |
| 774 } |
| 775 intptr_t id_; // Parser node id corresponding to this IC. |
| 776 intptr_t num_args_tested_; // Number of arguments tested in IC. |
| 777 }; |
| 778 |
| 779 |
| 763 class RawError : public RawObject { | 780 class RawError : public RawObject { |
| 764 RAW_HEAP_OBJECT_IMPLEMENTATION(Error); | 781 RAW_HEAP_OBJECT_IMPLEMENTATION(Error); |
| 765 }; | 782 }; |
| 766 | 783 |
| 767 | 784 |
| 768 class RawApiError : public RawError { | 785 class RawApiError : public RawError { |
| 769 RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError); | 786 RAW_HEAP_OBJECT_IMPLEMENTATION(ApiError); |
| 770 | 787 |
| 771 RawObject** from() { | 788 RawObject** from() { |
| 772 return reinterpret_cast<RawObject**>(&ptr()->message_); | 789 return reinterpret_cast<RawObject**>(&ptr()->message_); |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 } | 1133 } |
| 1117 | 1134 |
| 1118 intptr_t type_; // Uninitialized, simple or complex. | 1135 intptr_t type_; // Uninitialized, simple or complex. |
| 1119 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 1136 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 1120 | 1137 |
| 1121 // Variable length data follows here. | 1138 // Variable length data follows here. |
| 1122 uint8_t data_[0]; | 1139 uint8_t data_[0]; |
| 1123 }; | 1140 }; |
| 1124 | 1141 |
| 1125 | 1142 |
| 1126 class RawICData : public RawInstance { | |
| 1127 RAW_HEAP_OBJECT_IMPLEMENTATION(ICData); | |
| 1128 | |
| 1129 RawObject** from() { | |
| 1130 return reinterpret_cast<RawObject**>(&ptr()->function_); | |
| 1131 } | |
| 1132 | |
| 1133 RawObject** to() { | |
| 1134 return reinterpret_cast<RawObject**>(&ptr()->ic_data_); | |
| 1135 } | |
| 1136 | |
| 1137 RawFunction* function_; // Parent/calling function of this IC. | |
| 1138 RawString* target_name_; // Name of target function. | |
| 1139 RawArray* ic_data_; // Contains test classes and target function. | |
| 1140 intptr_t id_; // Parser node id corresponding to this IC. | |
| 1141 intptr_t num_args_tested_; // Number of arguments tested in IC. | |
| 1142 }; | |
| 1143 | |
| 1144 | |
| 1145 } // namespace dart | 1143 } // namespace dart |
| 1146 | 1144 |
| 1147 #endif // VM_RAW_OBJECT_H_ | 1145 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |