| 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 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 return HasInitializerBit::decode(raw_ptr()->kind_bits_); | 1954 return HasInitializerBit::decode(raw_ptr()->kind_bits_); |
| 1955 } | 1955 } |
| 1956 void set_has_initializer(bool has_initializer) const { | 1956 void set_has_initializer(bool has_initializer) const { |
| 1957 set_kind_bits(HasInitializerBit::update(has_initializer, | 1957 set_kind_bits(HasInitializerBit::update(has_initializer, |
| 1958 raw_ptr()->kind_bits_)); | 1958 raw_ptr()->kind_bits_)); |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 // Return class id that any non-null value read from this field is guaranteed | 1961 // Return class id that any non-null value read from this field is guaranteed |
| 1962 // to have or kDynamicCid if such class id is not known. | 1962 // to have or kDynamicCid if such class id is not known. |
| 1963 // Stores to this field must update this information hence the name. | 1963 // Stores to this field must update this information hence the name. |
| 1964 intptr_t guarded_cid() const { | 1964 intptr_t guarded_cid() const { return raw_ptr()->guarded_cid_; } |
| 1965 const intptr_t cid = raw_ptr()->guarded_cid_; | 1965 |
| 1966 if (IsExternalizableCid(cid)) { | |
| 1967 return kDynamicCid; | |
| 1968 } else { | |
| 1969 return cid; | |
| 1970 } | |
| 1971 } | |
| 1972 void set_guarded_cid(intptr_t cid) const { | 1966 void set_guarded_cid(intptr_t cid) const { |
| 1973 raw_ptr()->guarded_cid_ = cid; | 1967 raw_ptr()->guarded_cid_ = cid; |
| 1974 } | 1968 } |
| 1975 static intptr_t guarded_cid_offset() { | 1969 static intptr_t guarded_cid_offset() { |
| 1976 return OFFSET_OF(RawField, guarded_cid_); | 1970 return OFFSET_OF(RawField, guarded_cid_); |
| 1977 } | 1971 } |
| 1978 | 1972 |
| 1979 static bool IsExternalizableCid(intptr_t cid) { | 1973 static bool IsExternalizableCid(intptr_t cid) { |
| 1980 return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); | 1974 return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); |
| 1981 } | 1975 } |
| (...skipping 4069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6051 | 6045 |
| 6052 | 6046 |
| 6053 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6047 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6054 intptr_t index) { | 6048 intptr_t index) { |
| 6055 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6049 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6056 } | 6050 } |
| 6057 | 6051 |
| 6058 } // namespace dart | 6052 } // namespace dart |
| 6059 | 6053 |
| 6060 #endif // VM_OBJECT_H_ | 6054 #endif // VM_OBJECT_H_ |
| OLD | NEW |