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

Unified Diff: runtime/vm/object.h

Issue 99573005: Add mutable double boxes for fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 31159)
+++ 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());
+ }
+
+ bool IsPotentialUnboxedField() const {
+ return is_unboxing_candidate()
+ && (IsUnboxedField() ||
+ (!is_final() && (guarded_cid() == kIllegalCid)));
+ }
+
+ 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
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698