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 RUNTIME_VM_RAW_OBJECT_H_ | 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_ |
6 #define RUNTIME_VM_RAW_OBJECT_H_ | 6 #define RUNTIME_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/exceptions.h" | 10 #include "vm/exceptions.h" |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 871 |
872 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 872 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
873 RawString* name_; | 873 RawString* name_; |
874 RawObject* owner_; // Class or patch class or mixin class | 874 RawObject* owner_; // Class or patch class or mixin class |
875 // where this function is defined. | 875 // where this function is defined. |
876 RawAbstractType* result_type_; | 876 RawAbstractType* result_type_; |
877 RawArray* parameter_types_; | 877 RawArray* parameter_types_; |
878 RawArray* parameter_names_; | 878 RawArray* parameter_names_; |
879 RawTypeArguments* type_parameters_; // Array of TypeParameter. | 879 RawTypeArguments* type_parameters_; // Array of TypeParameter. |
880 RawObject* data_; // Additional data specific to the function kind. | 880 RawObject* data_; // Additional data specific to the function kind. |
| 881 RawTypedData* kernel_data_; |
881 RawObject** to_snapshot() { | 882 RawObject** to_snapshot() { |
882 return reinterpret_cast<RawObject**>(&ptr()->data_); | 883 return reinterpret_cast<RawObject**>(&ptr()->data_); |
883 } | 884 } |
884 RawArray* ic_data_array_; // ICData of unoptimized code. | 885 RawArray* ic_data_array_; // ICData of unoptimized code. |
885 RawObject** to_no_code() { | 886 RawObject** to_no_code() { |
886 return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_); | 887 return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_); |
887 } | 888 } |
888 RawCode* code_; // Currently active code. Accessed from generated code. | 889 RawCode* code_; // Currently active code. Accessed from generated code. |
889 NOT_IN_PRECOMPILED(RawCode* unoptimized_code_); // Unoptimized code, keep it | 890 NOT_IN_PRECOMPILED(RawCode* unoptimized_code_); // Unoptimized code, keep it |
890 // after optimization. | 891 // after optimization. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 }; | 958 }; |
958 | 959 |
959 class RawField : public RawObject { | 960 class RawField : public RawObject { |
960 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); | 961 RAW_HEAP_OBJECT_IMPLEMENTATION(Field); |
961 | 962 |
962 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 963 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
963 RawString* name_; | 964 RawString* name_; |
964 RawObject* owner_; // Class or patch class or mixin class | 965 RawObject* owner_; // Class or patch class or mixin class |
965 // where this field is defined or original field. | 966 // where this field is defined or original field. |
966 RawAbstractType* type_; | 967 RawAbstractType* type_; |
| 968 RawTypedData* kernel_data_; |
967 union { | 969 union { |
968 RawInstance* static_value_; // Value for static fields. | 970 RawInstance* static_value_; // Value for static fields. |
969 RawSmi* offset_; // Offset in words for instance fields. | 971 RawSmi* offset_; // Offset in words for instance fields. |
970 } value_; | 972 } value_; |
971 union { | 973 union { |
972 // When precompiling we need to save the static initializer function here | 974 // When precompiling we need to save the static initializer function here |
973 // so that code for it can be generated. | 975 // so that code for it can be generated. |
974 RawFunction* precompiled_; // Static initializer function - precompiling. | 976 RawFunction* precompiled_; // Static initializer function - precompiling. |
975 // When generating script snapshots after running the application it is | 977 // When generating script snapshots after running the application it is |
976 // necessary to save the initial value of static fields so that we can | 978 // necessary to save the initial value of static fields so that we can |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 break; | 1084 break; |
1083 } | 1085 } |
1084 UNREACHABLE(); | 1086 UNREACHABLE(); |
1085 return NULL; | 1087 return NULL; |
1086 } | 1088 } |
1087 | 1089 |
1088 int32_t line_offset_; | 1090 int32_t line_offset_; |
1089 int32_t col_offset_; | 1091 int32_t col_offset_; |
1090 int8_t kind_; // Of type Kind. | 1092 int8_t kind_; // Of type Kind. |
1091 int64_t load_timestamp_; | 1093 int64_t load_timestamp_; |
1092 const uint8_t* kernel_data_; | |
1093 intptr_t kernel_data_size_; | |
1094 intptr_t kernel_script_index_; | 1094 intptr_t kernel_script_index_; |
1095 }; | 1095 }; |
1096 | 1096 |
1097 class RawLibrary : public RawObject { | 1097 class RawLibrary : public RawObject { |
1098 enum LibraryState { | 1098 enum LibraryState { |
1099 kAllocated, // Initial state. | 1099 kAllocated, // Initial state. |
1100 kLoadRequested, // Compiler or script requested load of library. | 1100 kLoadRequested, // Compiler or script requested load of library. |
1101 kLoadInProgress, // Library is in the process of being loaded. | 1101 kLoadInProgress, // Library is in the process of being loaded. |
1102 kLoaded, // Library is loaded. | 1102 kLoaded, // Library is loaded. |
1103 kLoadError, // Error occurred during load of the Library. | 1103 kLoadError, // Error occurred during load of the Library. |
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2439 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2439 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2440 kTypedDataInt8ArrayViewCid + 15); | 2440 kTypedDataInt8ArrayViewCid + 15); |
2441 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2441 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2442 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2442 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2443 return (kNullCid - kTypedDataInt8ArrayCid); | 2443 return (kNullCid - kTypedDataInt8ArrayCid); |
2444 } | 2444 } |
2445 | 2445 |
2446 } // namespace dart | 2446 } // namespace dart |
2447 | 2447 |
2448 #endif // RUNTIME_VM_RAW_OBJECT_H_ | 2448 #endif // RUNTIME_VM_RAW_OBJECT_H_ |
OLD | NEW |