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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 bool is_compressed() const { | 953 bool is_compressed() const { |
954 return (token_pos_ & 0x1) == 1; | 954 return (token_pos_ & 0x1) == 1; |
955 } | 955 } |
956 | 956 |
957 uword pc_; | 957 uword pc_; |
958 int32_t deopt_id_and_kind_; // Bits 31..8 -> deopt_id, bits 7..0 kind. | 958 int32_t deopt_id_and_kind_; // Bits 31..8 -> deopt_id, bits 7..0 kind. |
959 int32_t token_pos_; // Bits 31..1 -> token_pos, bit 1 -> compressed flag; | 959 int32_t token_pos_; // Bits 31..1 -> token_pos, bit 1 -> compressed flag; |
960 int16_t try_index_; | 960 int16_t try_index_; |
961 }; | 961 }; |
962 | 962 |
| 963 static intptr_t RecordSize(bool has_try_index) { |
| 964 return has_try_index ? RawPcDescriptors::kFullRecSize |
| 965 : RawPcDescriptors::kCompressedRecSize; |
| 966 } |
| 967 |
| 968 private: |
| 969 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); |
| 970 |
963 static const intptr_t kFullRecSize = sizeof(PcDescriptorRec); | 971 static const intptr_t kFullRecSize = sizeof(PcDescriptorRec); |
964 static const intptr_t kCompressedRecSize = kFullRecSize - sizeof(int16_t); | 972 static const intptr_t kCompressedRecSize = kFullRecSize - sizeof(int16_t); |
965 | 973 |
966 private: | |
967 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); | |
968 | |
969 intptr_t record_size_in_bytes_; | 974 intptr_t record_size_in_bytes_; |
970 intptr_t length_; // Number of descriptors. | 975 intptr_t length_; // Number of descriptors. |
971 | 976 |
972 // Variable length data follows here. | 977 // Variable length data follows here. |
973 uint8_t* data() { OPEN_ARRAY_START(uint8_t, intptr_t); } | 978 uint8_t* data() { OPEN_ARRAY_START(uint8_t, intptr_t); } |
974 | 979 |
975 friend class Object; | 980 friend class Object; |
976 }; | 981 }; |
977 | 982 |
978 | 983 |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 1941 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
1937 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 1942 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
1938 kTypedDataInt8ArrayViewCid + 15); | 1943 kTypedDataInt8ArrayViewCid + 15); |
1939 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); | 1944 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
1940 return (kNullCid - kTypedDataInt8ArrayCid); | 1945 return (kNullCid - kTypedDataInt8ArrayCid); |
1941 } | 1946 } |
1942 | 1947 |
1943 } // namespace dart | 1948 } // namespace dart |
1944 | 1949 |
1945 #endif // VM_RAW_OBJECT_H_ | 1950 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |