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

Unified Diff: src/register-allocator.h

Issue 668151: Make more use of the NumberInfo data.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 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
Index: src/register-allocator.h
===================================================================
--- src/register-allocator.h (revision 4025)
+++ src/register-allocator.h (working copy)
@@ -65,12 +65,12 @@
Result() { invalidate(); }
// Construct a register Result.
- explicit Result(Register reg, NumberInfo::Type info = NumberInfo::kUnknown);
+ explicit Result(Register reg, NumberInfo info = NumberInfo::Unknown());
// Construct a Result whose value is a compile-time constant.
explicit Result(Handle<Object> value) {
value_ = TypeField::encode(CONSTANT)
- | NumberInfoField::encode(NumberInfo::kUninitialized)
+ | NumberInfoField::encode(NumberInfo::Uninitialized().ToInt())
| DataField::encode(ConstantList()->length());
ConstantList()->Add(value);
}
@@ -101,13 +101,12 @@
void invalidate() { value_ = TypeField::encode(INVALID); }
- NumberInfo::Type number_info();
- void set_number_info(NumberInfo::Type info);
- bool is_number() {
- return (number_info() & NumberInfo::kNumber) != 0;
- }
- bool is_smi() { return number_info() == NumberInfo::kSmi; }
- bool is_heap_number() { return number_info() == NumberInfo::kHeapNumber; }
+ NumberInfo number_info() const;
fschneider 2010/03/05 15:01:07 Maybe make this an inline function?
+ void set_number_info(NumberInfo info);
fschneider 2010/03/05 15:01:07 Maybe make this an inline function?
+ bool is_number() const { return number_info().IsNumber(); }
+ bool is_smi() const { return number_info().IsSmi(); }
+ bool is_integer32() const { return number_info().IsInteger32(); }
+ bool is_heap_number() const { return number_info().IsHeapNumber(); }
bool is_valid() const { return type() != INVALID; }
bool is_register() const { return type() == REGISTER; }
@@ -140,8 +139,8 @@
uint32_t value_;
class TypeField: public BitField<Type, 0, 2> {};
- class NumberInfoField : public BitField<NumberInfo::Type, 2, 3> {};
- class DataField: public BitField<uint32_t, 5, 32 - 5> {};
+ class NumberInfoField : public BitField<int, 2, 4> {};
+ class DataField: public BitField<uint32_t, 6, 32 - 6> {};
inline void CopyTo(Result* destination) const;

Powered by Google App Engine
This is Rietveld 408576698