| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 return reinterpret_cast<RawObject**>(&ptr()->dependent_code_); | 705 return reinterpret_cast<RawObject**>(&ptr()->dependent_code_); |
| 706 } | 706 } |
| 707 RawObject** to_snapshot(Snapshot::Kind kind) { | 707 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 708 switch (kind) { | 708 switch (kind) { |
| 709 case Snapshot::kCore: | 709 case Snapshot::kCore: |
| 710 case Snapshot::kScript: | 710 case Snapshot::kScript: |
| 711 case Snapshot::kAppWithJIT: | 711 case Snapshot::kAppWithJIT: |
| 712 case Snapshot::kAppNoJIT: | 712 case Snapshot::kAppNoJIT: |
| 713 return reinterpret_cast<RawObject**>(&ptr()->direct_subclasses_); | 713 return reinterpret_cast<RawObject**>(&ptr()->direct_subclasses_); |
| 714 case Snapshot::kMessage: | 714 case Snapshot::kMessage: |
| 715 case Snapshot::kNone: |
| 716 case Snapshot::kInvalid: |
| 715 break; | 717 break; |
| 716 } | 718 } |
| 717 UNREACHABLE(); | 719 UNREACHABLE(); |
| 718 return NULL; | 720 return NULL; |
| 719 } | 721 } |
| 720 | 722 |
| 721 cpp_vtable handle_vtable_; | 723 cpp_vtable handle_vtable_; |
| 722 TokenPosition token_pos_; | 724 TokenPosition token_pos_; |
| 723 int32_t instance_size_in_words_; // Size if fixed len or 0 if variable len. | 725 int32_t instance_size_in_words_; // Size if fixed len or 0 if variable len. |
| 724 int32_t type_arguments_field_offset_in_words_; // Offset of type args fld. | 726 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... |
| 933 } | 935 } |
| 934 RawObject** to_snapshot(Snapshot::Kind kind) { | 936 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 935 switch (kind) { | 937 switch (kind) { |
| 936 case Snapshot::kCore: | 938 case Snapshot::kCore: |
| 937 case Snapshot::kScript: | 939 case Snapshot::kScript: |
| 938 case Snapshot::kAppWithJIT: | 940 case Snapshot::kAppWithJIT: |
| 939 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); | 941 return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_); |
| 940 case Snapshot::kAppNoJIT: | 942 case Snapshot::kAppNoJIT: |
| 941 return reinterpret_cast<RawObject**>(&ptr()->initializer_); | 943 return reinterpret_cast<RawObject**>(&ptr()->initializer_); |
| 942 case Snapshot::kMessage: | 944 case Snapshot::kMessage: |
| 945 case Snapshot::kNone: |
| 946 case Snapshot::kInvalid: |
| 943 break; | 947 break; |
| 944 } | 948 } |
| 945 UNREACHABLE(); | 949 UNREACHABLE(); |
| 946 return NULL; | 950 return NULL; |
| 947 } | 951 } |
| 948 | 952 |
| 949 TokenPosition token_pos_; | 953 TokenPosition token_pos_; |
| 950 classid_t guarded_cid_; | 954 classid_t guarded_cid_; |
| 951 classid_t is_nullable_; // kNullCid if field can contain null value and | 955 classid_t is_nullable_; // kNullCid if field can contain null value and |
| 952 // any other value otherwise. | 956 // any other value otherwise. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } | 1017 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->source_); } |
| 1014 RawObject** to_snapshot(Snapshot::Kind kind) { | 1018 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 1015 switch (kind) { | 1019 switch (kind) { |
| 1016 case Snapshot::kAppNoJIT: | 1020 case Snapshot::kAppNoJIT: |
| 1017 return reinterpret_cast<RawObject**>(&ptr()->url_); | 1021 return reinterpret_cast<RawObject**>(&ptr()->url_); |
| 1018 case Snapshot::kCore: | 1022 case Snapshot::kCore: |
| 1019 case Snapshot::kAppWithJIT: | 1023 case Snapshot::kAppWithJIT: |
| 1020 case Snapshot::kScript: | 1024 case Snapshot::kScript: |
| 1021 return reinterpret_cast<RawObject**>(&ptr()->tokens_); | 1025 return reinterpret_cast<RawObject**>(&ptr()->tokens_); |
| 1022 case Snapshot::kMessage: | 1026 case Snapshot::kMessage: |
| 1027 case Snapshot::kNone: |
| 1028 case Snapshot::kInvalid: |
| 1023 break; | 1029 break; |
| 1024 } | 1030 } |
| 1025 UNREACHABLE(); | 1031 UNREACHABLE(); |
| 1026 return NULL; | 1032 return NULL; |
| 1027 } | 1033 } |
| 1028 | 1034 |
| 1029 int32_t line_offset_; | 1035 int32_t line_offset_; |
| 1030 int32_t col_offset_; | 1036 int32_t col_offset_; |
| 1031 int8_t kind_; // Of type Kind. | 1037 int8_t kind_; // Of type Kind. |
| 1032 }; | 1038 }; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 } | 1505 } |
| 1500 RawObject** to_snapshot(Snapshot::Kind kind) { | 1506 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 1501 switch (kind) { | 1507 switch (kind) { |
| 1502 case Snapshot::kAppNoJIT: | 1508 case Snapshot::kAppNoJIT: |
| 1503 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); | 1509 return reinterpret_cast<RawObject**>(&ptr()->args_descriptor_); |
| 1504 case Snapshot::kCore: | 1510 case Snapshot::kCore: |
| 1505 case Snapshot::kScript: | 1511 case Snapshot::kScript: |
| 1506 case Snapshot::kAppWithJIT: | 1512 case Snapshot::kAppWithJIT: |
| 1507 return to(); | 1513 return to(); |
| 1508 case Snapshot::kMessage: | 1514 case Snapshot::kMessage: |
| 1515 case Snapshot::kNone: |
| 1516 case Snapshot::kInvalid: |
| 1509 break; | 1517 break; |
| 1510 } | 1518 } |
| 1511 UNREACHABLE(); | 1519 UNREACHABLE(); |
| 1512 return NULL; | 1520 return NULL; |
| 1513 } | 1521 } |
| 1514 int32_t deopt_id_; // Deoptimization id corresponding to this IC. | 1522 int32_t deopt_id_; // Deoptimization id corresponding to this IC. |
| 1515 uint32_t state_bits_; // Number of arguments tested in IC, deopt reasons, | 1523 uint32_t state_bits_; // Number of arguments tested in IC, deopt reasons, |
| 1516 // range feedback. | 1524 // range feedback. |
| 1517 #if defined(TAG_IC_DATA) | 1525 #if defined(TAG_IC_DATA) |
| 1518 intptr_t tag_; // Debugging, verifying that the icdata is assigned to the | 1526 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... |
| 1630 } | 1638 } |
| 1631 RawObject** to_snapshot(Snapshot::Kind kind) { | 1639 RawObject** to_snapshot(Snapshot::Kind kind) { |
| 1632 switch (kind) { | 1640 switch (kind) { |
| 1633 case Snapshot::kCore: | 1641 case Snapshot::kCore: |
| 1634 case Snapshot::kScript: | 1642 case Snapshot::kScript: |
| 1635 case Snapshot::kAppWithJIT: | 1643 case Snapshot::kAppWithJIT: |
| 1636 return reinterpret_cast<RawObject**>(&ptr()->imports_); | 1644 return reinterpret_cast<RawObject**>(&ptr()->imports_); |
| 1637 case Snapshot::kAppNoJIT: | 1645 case Snapshot::kAppNoJIT: |
| 1638 return reinterpret_cast<RawObject**>(&ptr()->importer_); | 1646 return reinterpret_cast<RawObject**>(&ptr()->importer_); |
| 1639 case Snapshot::kMessage: | 1647 case Snapshot::kMessage: |
| 1648 case Snapshot::kNone: |
| 1649 case Snapshot::kInvalid: |
| 1640 break; | 1650 break; |
| 1641 } | 1651 } |
| 1642 UNREACHABLE(); | 1652 UNREACHABLE(); |
| 1643 return NULL; | 1653 return NULL; |
| 1644 } | 1654 } |
| 1645 uint16_t num_imports_; // Number of library entries in libraries_. | 1655 uint16_t num_imports_; // Number of library entries in libraries_. |
| 1646 bool is_deferred_load_; | 1656 bool is_deferred_load_; |
| 1647 bool is_loaded_; | 1657 bool is_loaded_; |
| 1648 }; | 1658 }; |
| 1649 | 1659 |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2418 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2428 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
| 2419 kTypedDataInt8ArrayViewCid + 15); | 2429 kTypedDataInt8ArrayViewCid + 15); |
| 2420 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2430 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
| 2421 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2431 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
| 2422 return (kNullCid - kTypedDataInt8ArrayCid); | 2432 return (kNullCid - kTypedDataInt8ArrayCid); |
| 2423 } | 2433 } |
| 2424 | 2434 |
| 2425 } // namespace dart | 2435 } // namespace dart |
| 2426 | 2436 |
| 2427 #endif // VM_RAW_OBJECT_H_ | 2437 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |