Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: runtime/vm/object.h

Issue 1278003002: Change heuristic to determine which fields contain modifieable double boxes: do it if field was ini… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: better Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_synthetic() const { 2817 bool is_synthetic() const {
2818 return SyntheticBit::decode(raw_ptr()->kind_bits_); 2818 return SyntheticBit::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 }
2826
2820 2827
2821 inline intptr_t Offset() const; 2828 inline intptr_t Offset() const;
2822 inline void SetOffset(intptr_t value_in_bytes) const; 2829 inline void SetOffset(intptr_t value_in_bytes) const;
2823 2830
2824 RawInstance* value() const; 2831 RawInstance* value() const;
2825 void set_value(const Instance& value) const; 2832 void set_value(const Instance& value) const;
2826 2833
2827 RawClass* owner() const; 2834 RawClass* owner() const;
2828 RawClass* origin() const; // Either mixin class, or same as owner(). 2835 RawClass* origin() const; // Either mixin class, or same as owner().
2829 2836
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
2980 2987
2981 private: 2988 private:
2982 friend class StoreInstanceFieldInstr; // Generated code access to bit field. 2989 friend class StoreInstanceFieldInstr; // Generated code access to bit field.
2983 2990
2984 enum { 2991 enum {
2985 kConstBit = 0, 2992 kConstBit = 0,
2986 kStaticBit, 2993 kStaticBit,
2987 kFinalBit, 2994 kFinalBit,
2988 kHasInitializerBit, 2995 kHasInitializerBit,
2989 kUnboxingCandidateBit, 2996 kUnboxingCandidateBit,
2990 kSyntheticBit 2997 kSyntheticBit,
2998 kDoubleInitializedBit,
2991 }; 2999 };
2992 class ConstBit : public BitField<bool, kConstBit, 1> {}; 3000 class ConstBit : public BitField<bool, kConstBit, 1> {};
2993 class StaticBit : public BitField<bool, kStaticBit, 1> {}; 3001 class StaticBit : public BitField<bool, kStaticBit, 1> {};
2994 class FinalBit : public BitField<bool, kFinalBit, 1> {}; 3002 class FinalBit : public BitField<bool, kFinalBit, 1> {};
2995 class HasInitializerBit : public BitField<bool, kHasInitializerBit, 1> {}; 3003 class HasInitializerBit : public BitField<bool, kHasInitializerBit, 1> {};
2996 class UnboxingCandidateBit : public BitField<bool, 3004 class UnboxingCandidateBit : public BitField<bool,
2997 kUnboxingCandidateBit, 1> { 3005 kUnboxingCandidateBit, 1> {};
2998 };
2999 class SyntheticBit : public BitField<bool, kSyntheticBit, 1> {}; 3006 class SyntheticBit : public BitField<bool, kSyntheticBit, 1> {};
3007 class DoubleInitializedBit : public BitField<bool,
3008 kDoubleInitializedBit, 1> {};
3000 3009
3001 // Update guarded cid and guarded length for this field. Returns true, if 3010 // Update guarded cid and guarded length for this field. Returns true, if
3002 // deoptimization of dependent code is required. 3011 // deoptimization of dependent code is required.
3003 bool UpdateGuardedCidAndLength(const Object& value) const; 3012 bool UpdateGuardedCidAndLength(const Object& value) const;
3004 3013
3005 void set_name(const String& value) const; 3014 void set_name(const String& value) const;
3006 void set_is_static(bool is_static) const { 3015 void set_is_static(bool is_static) const {
3007 set_kind_bits(StaticBit::update(is_static, raw_ptr()->kind_bits_)); 3016 set_kind_bits(StaticBit::update(is_static, raw_ptr()->kind_bits_));
3008 } 3017 }
3009 void set_is_final(bool is_final) const { 3018 void set_is_final(bool is_final) const {
(...skipping 5021 matching lines...) Expand 10 before | Expand all | Expand 10 after
8031 8040
8032 8041
8033 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8042 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8034 intptr_t index) { 8043 intptr_t index) {
8035 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8044 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8036 } 8045 }
8037 8046
8038 } // namespace dart 8047 } // namespace dart
8039 8048
8040 #endif // VM_OBJECT_H_ 8049 #endif // VM_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698