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/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 return reinterpret_cast<RawObject**>(&ptr()->dependent_code_); | 714 return reinterpret_cast<RawObject**>(&ptr()->dependent_code_); |
715 } | 715 } |
716 RawObject** to_snapshot(Snapshot::Kind kind) { | 716 RawObject** to_snapshot(Snapshot::Kind kind) { |
717 switch (kind) { | 717 switch (kind) { |
718 case Snapshot::kCore: | 718 case Snapshot::kCore: |
719 case Snapshot::kScript: | 719 case Snapshot::kScript: |
720 case Snapshot::kAppWithJIT: | 720 case Snapshot::kAppWithJIT: |
721 case Snapshot::kAppNoJIT: | 721 case Snapshot::kAppNoJIT: |
722 return reinterpret_cast<RawObject**>(&ptr()->direct_subclasses_); | 722 return reinterpret_cast<RawObject**>(&ptr()->direct_subclasses_); |
723 case Snapshot::kMessage: | 723 case Snapshot::kMessage: |
| 724 case Snapshot::kNone: |
724 break; | 725 break; |
725 } | 726 } |
726 UNREACHABLE(); | 727 UNREACHABLE(); |
727 return NULL; | 728 return NULL; |
728 } | 729 } |
729 | 730 |
730 cpp_vtable handle_vtable_; | 731 cpp_vtable handle_vtable_; |
731 TokenPosition token_pos_; | 732 TokenPosition token_pos_; |
732 int32_t instance_size_in_words_; // Size if fixed len or 0 if variable len. | 733 int32_t instance_size_in_words_; // Size if fixed len or 0 if variable len. |
733 int32_t type_arguments_field_offset_in_words_; // Offset of type args fld. | 734 int32_t type_arguments_field_offset_in_words_; // Offset of type args fld. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 } | 943 } |
943 RawObject** to_snapshot(Snapshot::Kind kind) { | 944 RawObject** to_snapshot(Snapshot::Kind kind) { |
944 switch (kind) { | 945 switch (kind) { |
945 case Snapshot::kCore: | 946 case Snapshot::kCore: |
946 case Snapshot::kScript: | 947 case Snapshot::kScript: |
947 case Snapshot::kAppWithJIT: | 948 case Snapshot::kAppWithJIT: |
948 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); | 949 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); |
949 case Snapshot::kAppNoJIT: | 950 case Snapshot::kAppNoJIT: |
950 return reinterpret_cast<RawObject**>(&ptr()->initializer_); | 951 return reinterpret_cast<RawObject**>(&ptr()->initializer_); |
951 case Snapshot::kMessage: | 952 case Snapshot::kMessage: |
| 953 case Snapshot::kNone: |
952 break; | 954 break; |
953 } | 955 } |
954 UNREACHABLE(); | 956 UNREACHABLE(); |
955 return NULL; | 957 return NULL; |
956 } | 958 } |
957 | 959 |
958 TokenPosition token_pos_; | 960 TokenPosition token_pos_; |
959 classid_t guarded_cid_; | 961 classid_t guarded_cid_; |
960 classid_t is_nullable_; // kNullCid if field can contain null value and | 962 classid_t is_nullable_; // kNullCid if field can contain null value and |
961 // any other value otherwise. | 963 // any other value otherwise. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } | 1024 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } |
1023 RawObject** to_snapshot(Snapshot::Kind kind) { | 1025 RawObject** to_snapshot(Snapshot::Kind kind) { |
1024 switch (kind) { | 1026 switch (kind) { |
1025 case Snapshot::kAppNoJIT: | 1027 case Snapshot::kAppNoJIT: |
1026 return reinterpret_cast<RawObject**>(&ptr()->url_); | 1028 return reinterpret_cast<RawObject**>(&ptr()->url_); |
1027 case Snapshot::kCore: | 1029 case Snapshot::kCore: |
1028 case Snapshot::kAppWithJIT: | 1030 case Snapshot::kAppWithJIT: |
1029 case Snapshot::kScript: | 1031 case Snapshot::kScript: |
1030 return reinterpret_cast<RawObject**>(&ptr()->tokens_); | 1032 return reinterpret_cast<RawObject**>(&ptr()->tokens_); |
1031 case Snapshot::kMessage: | 1033 case Snapshot::kMessage: |
| 1034 case Snapshot::kNone: |
1032 break; | 1035 break; |
1033 } | 1036 } |
1034 UNREACHABLE(); | 1037 UNREACHABLE(); |
1035 return NULL; | 1038 return NULL; |
1036 } | 1039 } |
1037 | 1040 |
1038 int32_t line_offset_; | 1041 int32_t line_offset_; |
1039 int32_t col_offset_; | 1042 int32_t col_offset_; |
1040 int8_t kind_; // Of type Kind. | 1043 int8_t kind_; // Of type Kind. |
1041 }; | 1044 }; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 kInlinedCallerIdMapIndex = 2, | 1116 kInlinedCallerIdMapIndex = 2, |
1114 kInlinedIdToTokenPosIndex = 3, | 1117 kInlinedIdToTokenPosIndex = 3, |
1115 kInlinedMetadataSize = 4, | 1118 kInlinedMetadataSize = 4, |
1116 }; | 1119 }; |
1117 | 1120 |
1118 RAW_HEAP_OBJECT_IMPLEMENTATION(Code); | 1121 RAW_HEAP_OBJECT_IMPLEMENTATION(Code); |
1119 | 1122 |
1120 uword entry_point_; | 1123 uword entry_point_; |
1121 | 1124 |
1122 RawObject** from() { | 1125 RawObject** from() { |
1123 return reinterpret_cast<RawObject**>(&ptr()->instructions_); | 1126 return reinterpret_cast<RawObject**>(&ptr()->active_instructions_); |
1124 } | 1127 } |
1125 union { | 1128 RawInstructions* active_instructions_; |
1126 RawInstructions* instructions_; | 1129 RawInstructions* instructions_; |
1127 RawSmi* precompiled_instructions_size_; | |
1128 }; | |
1129 RawObjectPool* object_pool_; | 1130 RawObjectPool* object_pool_; |
1130 // If owner_ is Function::null() the owner is a regular stub. | 1131 // If owner_ is Function::null() the owner is a regular stub. |
1131 // If owner_ is a Class the owner is the allocation stub for that class. | 1132 // If owner_ is a Class the owner is the allocation stub for that class. |
1132 // Else, owner_ is a regular Dart Function. | 1133 // Else, owner_ is a regular Dart Function. |
1133 RawObject* owner_; // Function, Null, or a Class. | 1134 RawObject* owner_; // Function, Null, or a Class. |
1134 RawExceptionHandlers* exception_handlers_; | 1135 RawExceptionHandlers* exception_handlers_; |
1135 RawPcDescriptors* pc_descriptors_; | 1136 RawPcDescriptors* pc_descriptors_; |
1136 RawCodeSourceMap* code_source_map_; | 1137 RawCodeSourceMap* code_source_map_; |
1137 RawArray* stackmaps_; | 1138 RawArray* stackmaps_; |
1138 RawObject** to_snapshot() { | 1139 RawObject** to_snapshot() { |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 } | 1511 } |
1511 RawObject** to_snapshot(Snapshot::Kind kind) { | 1512 RawObject** to_snapshot(Snapshot::Kind kind) { |
1512 switch (kind) { | 1513 switch (kind) { |
1513 case Snapshot::kAppNoJIT: | 1514 case Snapshot::kAppNoJIT: |
1514 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); | 1515 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); |
1515 case Snapshot::kCore: | 1516 case Snapshot::kCore: |
1516 case Snapshot::kScript: | 1517 case Snapshot::kScript: |
1517 case Snapshot::kAppWithJIT: | 1518 case Snapshot::kAppWithJIT: |
1518 return to(); | 1519 return to(); |
1519 case Snapshot::kMessage: | 1520 case Snapshot::kMessage: |
| 1521 case Snapshot::kNone: |
1520 break; | 1522 break; |
1521 } | 1523 } |
1522 UNREACHABLE(); | 1524 UNREACHABLE(); |
1523 return NULL; | 1525 return NULL; |
1524 } | 1526 } |
1525 int32_t deopt_id_; // Deoptimization id corresponding to this IC. | 1527 int32_t deopt_id_; // Deoptimization id corresponding to this IC. |
1526 uint32_t state_bits_; // Number of arguments tested in IC, deopt reasons, | 1528 uint32_t state_bits_; // Number of arguments tested in IC, deopt reasons, |
1527 // range feedback. | 1529 // range feedback. |
1528 #if defined(TAG_IC_DATA) | 1530 #if defined(TAG_IC_DATA) |
1529 intptr_t tag_; // Debugging, verifying that the icdata is assigned to the | 1531 intptr_t tag_; // Debugging, verifying that the icdata is assigned to the |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 } | 1643 } |
1642 RawObject** to_snapshot(Snapshot::Kind kind) { | 1644 RawObject** to_snapshot(Snapshot::Kind kind) { |
1643 switch (kind) { | 1645 switch (kind) { |
1644 case Snapshot::kCore: | 1646 case Snapshot::kCore: |
1645 case Snapshot::kScript: | 1647 case Snapshot::kScript: |
1646 case Snapshot::kAppWithJIT: | 1648 case Snapshot::kAppWithJIT: |
1647 return reinterpret_cast<RawObject**>(&ptr()->imports_); | 1649 return reinterpret_cast<RawObject**>(&ptr()->imports_); |
1648 case Snapshot::kAppNoJIT: | 1650 case Snapshot::kAppNoJIT: |
1649 return reinterpret_cast<RawObject**>(&ptr()->importer_); | 1651 return reinterpret_cast<RawObject**>(&ptr()->importer_); |
1650 case Snapshot::kMessage: | 1652 case Snapshot::kMessage: |
| 1653 case Snapshot::kNone: |
1651 break; | 1654 break; |
1652 } | 1655 } |
1653 UNREACHABLE(); | 1656 UNREACHABLE(); |
1654 return NULL; | 1657 return NULL; |
1655 } | 1658 } |
1656 uint16_t num_imports_; // Number of library entries in libraries_. | 1659 uint16_t num_imports_; // Number of library entries in libraries_. |
1657 bool is_deferred_load_; | 1660 bool is_deferred_load_; |
1658 bool is_loaded_; | 1661 bool is_loaded_; |
1659 }; | 1662 }; |
1660 | 1663 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2432 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2430 kTypedDataInt8ArrayViewCid + 15); | 2433 kTypedDataInt8ArrayViewCid + 15); |
2431 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2434 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2432 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2435 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2433 return (kNullCid - kTypedDataInt8ArrayCid); | 2436 return (kNullCid - kTypedDataInt8ArrayCid); |
2434 } | 2437 } |
2435 | 2438 |
2436 } // namespace dart | 2439 } // namespace dart |
2437 | 2440 |
2438 #endif // VM_RAW_OBJECT_H_ | 2441 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |