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

Unified Diff: vm/object.h

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/memory_region.h ('k') | vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.h
===================================================================
--- vm/object.h (revision 12729)
+++ vm/object.h (working copy)
@@ -1802,8 +1802,8 @@
return HasInitializerBit::decode(raw_ptr()->kind_bits_);
}
void set_has_initializer(bool has_initializer) const {
- uword bits = raw_ptr()->kind_bits_;
- raw_ptr()->kind_bits_ = HasInitializerBit::update(has_initializer, bits);
+ raw_ptr()->kind_bits_ = static_cast<uint8_t>(
+ HasInitializerBit::update(has_initializer, raw_ptr()->kind_bits_));
}
// Constructs getter and setter names for fields and vice versa.
@@ -1830,16 +1830,13 @@
void set_name(const String& value) const;
void set_is_static(bool is_static) const {
- uword bits = raw_ptr()->kind_bits_;
- raw_ptr()->kind_bits_ = StaticBit::update(is_static, bits);
+ set_kind_bits(StaticBit::update(is_static, raw_ptr()->kind_bits_));
}
void set_is_final(bool is_final) const {
- uword bits = raw_ptr()->kind_bits_;
- raw_ptr()->kind_bits_ = FinalBit::update(is_final, bits);
+ set_kind_bits(FinalBit::update(is_final, raw_ptr()->kind_bits_));
}
void set_is_const(bool value) const {
- uword bits = raw_ptr()->kind_bits_;
- raw_ptr()->kind_bits_ = ConstBit::update(value, bits);
+ set_kind_bits(ConstBit::update(value, raw_ptr()->kind_bits_));
}
void set_owner(const Class& value) const {
StorePointer(&raw_ptr()->owner_, value.raw());
@@ -1848,7 +1845,7 @@
raw_ptr()->token_pos_ = token_pos;
}
void set_kind_bits(intptr_t value) const {
- raw_ptr()->kind_bits_ = value;
+ raw_ptr()->kind_bits_ = static_cast<uint8_t>(value);
}
static RawField* New();
@@ -1935,7 +1932,7 @@
intptr_t ReadToken() {
int64_t value = stream_.ReadUnsigned();
ASSERT((value >= 0) && (value <= kIntptrMax));
- return value;
+ return static_cast<intptr_t>(value);
}
const TokenStream& tokens_;
« no previous file with comments | « vm/memory_region.h ('k') | vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698