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

Unified Diff: vm/object.cc

Issue 10967044: Fix the types used in bit fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/object.h ('k') | vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 12729)
+++ vm/object.cc (working copy)
@@ -1434,8 +1434,8 @@
ASSERT((state == RawClass::kAllocated) ||
(state == RawClass::kPreFinalized) ||
(state == RawClass::kFinalized));
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = StateBits::update(state, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ StateBits::update(state, raw_ptr()->state_bits_));
}
@@ -1893,33 +1893,33 @@
void Class::set_is_interface() const {
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = InterfaceBit::update(true, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ InterfaceBit::update(true, raw_ptr()->state_bits_));
}
void Class::set_is_abstract() const {
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = AbstractBit::update(true, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ AbstractBit::update(true, raw_ptr()->state_bits_));
}
void Class::set_is_const() const {
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = ConstBit::update(true, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ ConstBit::update(true, raw_ptr()->state_bits_));
}
void Class::set_is_finalized() const {
ASSERT(!is_finalized());
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = StateBits::update(RawClass::kFinalized, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ StateBits::update(RawClass::kFinalized, raw_ptr()->state_bits_));
}
void Class::set_is_prefinalized() const {
ASSERT(!is_finalized());
- uword bits = raw_ptr()->state_bits_;
- raw_ptr()->state_bits_ = StateBits::update(RawClass::kPreFinalized, bits);
+ raw_ptr()->state_bits_ = static_cast<uint8_t>(
+ StateBits::update(RawClass::kPreFinalized, raw_ptr()->state_bits_));
}
@@ -4010,26 +4010,22 @@
void Function::set_kind(RawFunction::Kind value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = KindBits::update(value, bits);
+ set_kind_tag(KindBits::update(value, raw_ptr()->kind_tag_));
}
void Function::set_is_static(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = StaticBit::update(value, bits);
+ set_kind_tag(StaticBit::update(value, raw_ptr()->kind_tag_));
}
void Function::set_is_const(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = ConstBit::update(value, bits);
+ set_kind_tag(ConstBit::update(value, raw_ptr()->kind_tag_));
}
void Function::set_is_external(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = ExternalBit::update(value, bits);
+ set_kind_tag(ExternalBit::update(value, raw_ptr()->kind_tag_));
}
@@ -4040,7 +4036,7 @@
void Function::set_kind_tag(intptr_t value) const {
- raw_ptr()->kind_tag_ = value;
+ raw_ptr()->kind_tag_ = static_cast<uint16_t>(value);
}
@@ -4075,26 +4071,22 @@
void Function::set_is_optimizable(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = OptimizableBit::update(value, bits);
+ set_kind_tag(OptimizableBit::update(value, raw_ptr()->kind_tag_));
}
void Function::set_has_finally(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = HasFinallyBit::update(value, bits);
+ set_kind_tag(HasFinallyBit::update(value, raw_ptr()->kind_tag_));
}
void Function::set_is_native(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = NativeBit::update(value, bits);
+ set_kind_tag(NativeBit::update(value, raw_ptr()->kind_tag_));
}
void Function::set_is_abstract(bool value) const {
- uword bits = raw_ptr()->kind_tag_;
- raw_ptr()->kind_tag_ = AbstractBit::update(value, bits);
+ set_kind_tag(AbstractBit::update(value, raw_ptr()->kind_tag_));
}
« no previous file with comments | « vm/object.h ('k') | vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698