Chromium Code Reviews| Index: runtime/vm/object.h |
| =================================================================== |
| --- runtime/vm/object.h (revision 31125) |
| +++ runtime/vm/object.h (working copy) |
| @@ -2142,6 +2142,25 @@ |
| return r; |
| } |
| + bool IsUnboxedField() const { |
| + return is_unboxing_candidate() |
| + && !is_final() |
| + && guarded_cid() == kDoubleCid && !is_nullable(); |
|
srdjan
2013/12/13 18:13:17
APP
Florian Schneider
2013/12/16 13:08:09
Done.
|
| + } |
| + |
| + bool IsPotentialUnboxedField() const { |
| + return is_unboxing_candidate() |
| + && (IsUnboxedField() || |
| + (!is_final() && guarded_cid() == kIllegalCid)); |
|
srdjan
2013/12/13 18:13:17
APP
Florian Schneider
2013/12/16 13:08:09
Done.
|
| + } |
| + |
| + bool is_unboxing_candidate() const { |
| + return UnboxingCandidateBit::decode(raw_ptr()->kind_bits_); |
| + } |
| + void set_is_unboxing_candidate(bool b) const { |
| + set_kind_bits(UnboxingCandidateBit::update(b, raw_ptr()->kind_bits_)); |
| + } |
| + |
| static bool IsExternalizableCid(intptr_t cid) { |
| return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); |
| } |
| @@ -2206,11 +2225,15 @@ |
| kStaticBit, |
| kFinalBit, |
| kHasInitializerBit, |
| + kUnboxingCandidateBit |
| }; |
| class ConstBit : public BitField<bool, kConstBit, 1> {}; |
| class StaticBit : public BitField<bool, kStaticBit, 1> {}; |
| class FinalBit : public BitField<bool, kFinalBit, 1> {}; |
| class HasInitializerBit : public BitField<bool, kHasInitializerBit, 1> {}; |
| + class UnboxingCandidateBit : public BitField<bool, |
| + kUnboxingCandidateBit, 1> { |
| + }; |
| // Update guarded class id and nullability of the field to reflect assignment |
| // of the value with the given class id to this field. Returns true, if |