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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 } | 1511 } |
1509 RawObject** to_snapshot(Snapshot::Kind kind) { | 1512 RawObject** to_snapshot(Snapshot::Kind kind) { |
1510 switch (kind) { | 1513 switch (kind) { |
1511 case Snapshot::kAppNoJIT: | 1514 case Snapshot::kAppNoJIT: |
1512 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); | 1515 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); |
1513 case Snapshot::kCore: | 1516 case Snapshot::kCore: |
1514 case Snapshot::kScript: | 1517 case Snapshot::kScript: |
1515 case Snapshot::kAppWithJIT: | 1518 case Snapshot::kAppWithJIT: |
1516 return to(); | 1519 return to(); |
1517 case Snapshot::kMessage: | 1520 case Snapshot::kMessage: |
| 1521 case Snapshot::kNone: |
1518 break; | 1522 break; |
1519 } | 1523 } |
1520 UNREACHABLE(); | 1524 UNREACHABLE(); |
1521 return NULL; | 1525 return NULL; |
1522 } | 1526 } |
1523 int32_t deopt_id_; // Deoptimization id corresponding to this IC. | 1527 int32_t deopt_id_; // Deoptimization id corresponding to this IC. |
1524 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, |
1525 // range feedback. | 1529 // range feedback. |
1526 #if defined(TAG_IC_DATA) | 1530 #if defined(TAG_IC_DATA) |
1527 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... |
1639 } | 1643 } |
1640 RawObject** to_snapshot(Snapshot::Kind kind) { | 1644 RawObject** to_snapshot(Snapshot::Kind kind) { |
1641 switch (kind) { | 1645 switch (kind) { |
1642 case Snapshot::kCore: | 1646 case Snapshot::kCore: |
1643 case Snapshot::kScript: | 1647 case Snapshot::kScript: |
1644 case Snapshot::kAppWithJIT: | 1648 case Snapshot::kAppWithJIT: |
1645 return reinterpret_cast<RawObject**>(&ptr()->imports_); | 1649 return reinterpret_cast<RawObject**>(&ptr()->imports_); |
1646 case Snapshot::kAppNoJIT: | 1650 case Snapshot::kAppNoJIT: |
1647 return reinterpret_cast<RawObject**>(&ptr()->importer_); | 1651 return reinterpret_cast<RawObject**>(&ptr()->importer_); |
1648 case Snapshot::kMessage: | 1652 case Snapshot::kMessage: |
| 1653 case Snapshot::kNone: |
1649 break; | 1654 break; |
1650 } | 1655 } |
1651 UNREACHABLE(); | 1656 UNREACHABLE(); |
1652 return NULL; | 1657 return NULL; |
1653 } | 1658 } |
1654 uint16_t num_imports_; // Number of library entries in libraries_. | 1659 uint16_t num_imports_; // Number of library entries in libraries_. |
1655 bool is_deferred_load_; | 1660 bool is_deferred_load_; |
1656 bool is_loaded_; | 1661 bool is_loaded_; |
1657 }; | 1662 }; |
1658 | 1663 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2427 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2432 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2428 kTypedDataInt8ArrayViewCid + 15); | 2433 kTypedDataInt8ArrayViewCid + 15); |
2429 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2434 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2430 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2435 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2431 return (kNullCid - kTypedDataInt8ArrayCid); | 2436 return (kNullCid - kTypedDataInt8ArrayCid); |
2432 } | 2437 } |
2433 | 2438 |
2434 } // namespace dart | 2439 } // namespace dart |
2435 | 2440 |
2436 #endif // VM_RAW_OBJECT_H_ | 2441 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |