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 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 bool is_unboxing_candidate() const { | 3080 bool is_unboxing_candidate() const { |
3081 return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_); | 3081 return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_); |
3082 } | 3082 } |
3083 // Default 'true', set to false once optimizing compiler determines it should | 3083 // Default 'true', set to false once optimizing compiler determines it should |
3084 // be boxed. | 3084 // be boxed. |
3085 void set_is_unboxing_candidate(bool b) const { | 3085 void set_is_unboxing_candidate(bool b) const { |
3086 ASSERT(IsOriginal()); | 3086 ASSERT(IsOriginal()); |
3087 set_kind_bits(UnboxingCandidateBit::update(b, raw_ptr()->kind_bits_)); | 3087 set_kind_bits(UnboxingCandidateBit::update(b, raw_ptr()->kind_bits_)); |
3088 } | 3088 } |
3089 | 3089 |
3090 static bool IsExternalizableCid(intptr_t cid) { | 3090 static bool IsExternalizableCid(intptr_t cid); |
3091 return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); | |
3092 } | |
3093 | 3091 |
3094 enum { | 3092 enum { |
3095 kUnknownLengthOffset = -1, | 3093 kUnknownLengthOffset = -1, |
3096 kUnknownFixedLength = -1, | 3094 kUnknownFixedLength = -1, |
3097 kNoFixedLength = -2, | 3095 kNoFixedLength = -2, |
3098 }; | 3096 }; |
3099 // Returns false if any value read from this field is guaranteed to be | 3097 // Returns false if any value read from this field is guaranteed to be |
3100 // not null. | 3098 // not null. |
3101 // Internally we is_nullable_ field contains either kNullCid (nullable) or | 3099 // Internally we is_nullable_ field contains either kNullCid (nullable) or |
3102 // any other value (non-nullable) instead of boolean. This is done to simplify | 3100 // any other value (non-nullable) instead of boolean. This is done to simplify |
(...skipping 5331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8434 | 8432 |
8435 | 8433 |
8436 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8434 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
8437 intptr_t index) { | 8435 intptr_t index) { |
8438 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8436 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
8439 } | 8437 } |
8440 | 8438 |
8441 } // namespace dart | 8439 } // namespace dart |
8442 | 8440 |
8443 #endif // VM_OBJECT_H_ | 8441 #endif // VM_OBJECT_H_ |
OLD | NEW |