| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2180 void set_guarded_list_length(intptr_t list_length) const; | 2180 void set_guarded_list_length(intptr_t list_length) const; |
| 2181 static intptr_t guarded_list_length_offset() { | 2181 static intptr_t guarded_list_length_offset() { |
| 2182 return OFFSET_OF(RawField, guarded_list_length_); | 2182 return OFFSET_OF(RawField, guarded_list_length_); |
| 2183 } | 2183 } |
| 2184 bool needs_length_check() const { | 2184 bool needs_length_check() const { |
| 2185 const bool r = guarded_list_length() >= Field::kUnknownFixedLength; | 2185 const bool r = guarded_list_length() >= Field::kUnknownFixedLength; |
| 2186 ASSERT(!r || is_final()); | 2186 ASSERT(!r || is_final()); |
| 2187 return r; | 2187 return r; |
| 2188 } | 2188 } |
| 2189 | 2189 |
| 2190 bool IsUnboxedField() const { | 2190 intptr_t UnboxedFieldCid() const { |
| 2191 return is_unboxing_candidate() | 2191 ASSERT(IsUnboxedField()); |
| 2192 && !is_final() | 2192 return guarded_cid(); |
| 2193 && (guarded_cid() == kDoubleCid && !is_nullable()); | |
| 2194 } | 2193 } |
| 2195 | 2194 |
| 2196 bool IsPotentialUnboxedField() const { | 2195 bool IsUnboxedField() const; |
| 2197 return is_unboxing_candidate() | 2196 |
| 2198 && (IsUnboxedField() || | 2197 bool IsPotentialUnboxedField() const; |
| 2199 (!is_final() && (guarded_cid() == kIllegalCid))); | |
| 2200 } | |
| 2201 | 2198 |
| 2202 bool is_unboxing_candidate() const { | 2199 bool is_unboxing_candidate() const { |
| 2203 return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_); | 2200 return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_); |
| 2204 } | 2201 } |
| 2205 void set_is_unboxing_candidate(bool b) const { | 2202 void set_is_unboxing_candidate(bool b) const { |
| 2206 set_kind_bits(UnboxingCandidateBit::update(b, raw_ptr()->kind_bits_)); | 2203 set_kind_bits(UnboxingCandidateBit::update(b, raw_ptr()->kind_bits_)); |
| 2207 } | 2204 } |
| 2208 | 2205 |
| 2209 static bool IsExternalizableCid(intptr_t cid) { | 2206 static bool IsExternalizableCid(intptr_t cid) { |
| 2210 return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); | 2207 return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); |
| (...skipping 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6628 | 6625 |
| 6629 | 6626 |
| 6630 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6627 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6631 intptr_t index) { | 6628 intptr_t index) { |
| 6632 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6629 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6633 } | 6630 } |
| 6634 | 6631 |
| 6635 } // namespace dart | 6632 } // namespace dart |
| 6636 | 6633 |
| 6637 #endif // VM_OBJECT_H_ | 6634 #endif // VM_OBJECT_H_ |
| OLD | NEW |