| 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 2799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2810 RawString* PrettyName() const; | 2810 RawString* PrettyName() const; |
| 2811 RawString* UserVisibleName() const; | 2811 RawString* UserVisibleName() const; |
| 2812 virtual RawString* DictionaryName() const { return name(); } | 2812 virtual RawString* DictionaryName() const { return name(); } |
| 2813 | 2813 |
| 2814 bool is_static() const { return StaticBit::decode(raw_ptr()->kind_bits_); } | 2814 bool is_static() const { return StaticBit::decode(raw_ptr()->kind_bits_); } |
| 2815 bool is_final() const { return FinalBit::decode(raw_ptr()->kind_bits_); } | 2815 bool is_final() const { return FinalBit::decode(raw_ptr()->kind_bits_); } |
| 2816 bool is_const() const { return ConstBit::decode(raw_ptr()->kind_bits_); } | 2816 bool is_const() const { return ConstBit::decode(raw_ptr()->kind_bits_); } |
| 2817 bool is_reflectable() const { | 2817 bool is_reflectable() const { |
| 2818 return ReflectableBit::decode(raw_ptr()->kind_bits_); | 2818 return ReflectableBit::decode(raw_ptr()->kind_bits_); |
| 2819 } | 2819 } |
| 2820 bool is_double_initialized() const { |
| 2821 return DoubleInitializedBit::decode(raw_ptr()->kind_bits_); |
| 2822 } |
| 2823 void set_is_double_initialized(bool value) const { |
| 2824 set_kind_bits(DoubleInitializedBit::update(value, raw_ptr()->kind_bits_)); |
| 2825 } |
| 2820 | 2826 |
| 2821 inline intptr_t Offset() const; | 2827 inline intptr_t Offset() const; |
| 2822 inline void SetOffset(intptr_t value_in_bytes) const; | 2828 inline void SetOffset(intptr_t value_in_bytes) const; |
| 2823 | 2829 |
| 2824 RawInstance* value() const; | 2830 RawInstance* value() const; |
| 2825 void set_value(const Instance& value) const; | 2831 void set_value(const Instance& value) const; |
| 2826 | 2832 |
| 2827 RawClass* owner() const; | 2833 RawClass* owner() const; |
| 2828 RawClass* origin() const; // Either mixin class, or same as owner(). | 2834 RawClass* origin() const; // Either mixin class, or same as owner(). |
| 2829 | 2835 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2980 | 2986 |
| 2981 private: | 2987 private: |
| 2982 friend class StoreInstanceFieldInstr; // Generated code access to bit field. | 2988 friend class StoreInstanceFieldInstr; // Generated code access to bit field. |
| 2983 | 2989 |
| 2984 enum { | 2990 enum { |
| 2985 kConstBit = 0, | 2991 kConstBit = 0, |
| 2986 kStaticBit, | 2992 kStaticBit, |
| 2987 kFinalBit, | 2993 kFinalBit, |
| 2988 kHasInitializerBit, | 2994 kHasInitializerBit, |
| 2989 kUnboxingCandidateBit, | 2995 kUnboxingCandidateBit, |
| 2990 kReflectableBit | 2996 kReflectableBit, |
| 2997 kDoubleInitializedBit, |
| 2991 }; | 2998 }; |
| 2992 class ConstBit : public BitField<bool, kConstBit, 1> {}; | 2999 class ConstBit : public BitField<bool, kConstBit, 1> {}; |
| 2993 class StaticBit : public BitField<bool, kStaticBit, 1> {}; | 3000 class StaticBit : public BitField<bool, kStaticBit, 1> {}; |
| 2994 class FinalBit : public BitField<bool, kFinalBit, 1> {}; | 3001 class FinalBit : public BitField<bool, kFinalBit, 1> {}; |
| 2995 class HasInitializerBit : public BitField<bool, kHasInitializerBit, 1> {}; | 3002 class HasInitializerBit : public BitField<bool, kHasInitializerBit, 1> {}; |
| 2996 class UnboxingCandidateBit : public BitField<bool, | 3003 class UnboxingCandidateBit : public BitField<bool, |
| 2997 kUnboxingCandidateBit, 1> { | 3004 kUnboxingCandidateBit, 1> {}; |
| 2998 }; | |
| 2999 class ReflectableBit : public BitField<bool, kReflectableBit, 1> {}; | 3005 class ReflectableBit : public BitField<bool, kReflectableBit, 1> {}; |
| 3006 class DoubleInitializedBit : public BitField<bool, |
| 3007 kDoubleInitializedBit, 1> {}; |
| 3000 | 3008 |
| 3001 // Update guarded cid and guarded length for this field. Returns true, if | 3009 // Update guarded cid and guarded length for this field. Returns true, if |
| 3002 // deoptimization of dependent code is required. | 3010 // deoptimization of dependent code is required. |
| 3003 bool UpdateGuardedCidAndLength(const Object& value) const; | 3011 bool UpdateGuardedCidAndLength(const Object& value) const; |
| 3004 | 3012 |
| 3005 void set_name(const String& value) const; | 3013 void set_name(const String& value) const; |
| 3006 void set_is_static(bool is_static) const { | 3014 void set_is_static(bool is_static) const { |
| 3007 set_kind_bits(StaticBit::update(is_static, raw_ptr()->kind_bits_)); | 3015 set_kind_bits(StaticBit::update(is_static, raw_ptr()->kind_bits_)); |
| 3008 } | 3016 } |
| 3009 void set_is_final(bool is_final) const { | 3017 void set_is_final(bool is_final) const { |
| (...skipping 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8031 | 8039 |
| 8032 | 8040 |
| 8033 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 8041 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 8034 intptr_t index) { | 8042 intptr_t index) { |
| 8035 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 8043 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 8036 } | 8044 } |
| 8037 | 8045 |
| 8038 } // namespace dart | 8046 } // namespace dart |
| 8039 | 8047 |
| 8040 #endif // VM_OBJECT_H_ | 8048 #endif // VM_OBJECT_H_ |
| OLD | NEW |