Index: src/register-allocator.cc |
=================================================================== |
--- src/register-allocator.cc (revision 3859) |
+++ src/register-allocator.cc (working copy) |
@@ -37,10 +37,12 @@ |
// Result implementation. |
-Result::Result(Register reg) { |
+Result::Result(Register reg, NumberInfo::Type info) { |
ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg)); |
CodeGeneratorScope::Current()->allocator()->Use(reg); |
- value_ = TypeField::encode(REGISTER) | DataField::encode(reg.code_); |
+ value_ = TypeField::encode(REGISTER) |
+ | NumberInfoField::encode(info) |
+ | DataField::encode(reg.code_); |
} |
@@ -50,6 +52,23 @@ |
} |
+NumberInfo::Type Result::number_info() { |
+ ASSERT(is_valid()); |
+ if (!is_constant()) return NumberInfoField::decode(value_); |
+ Handle<Object> value = handle(); |
+ if (value->IsSmi()) return NumberInfo::kSmi; |
+ if (value->IsHeapNumber()) return NumberInfo::kHeapNumber; |
+ return NumberInfo::kUnknown; |
+} |
+ |
+ |
+void Result::set_number_info(NumberInfo::Type info) { |
+ ASSERT(is_valid()); |
+ value_ = value_ & ~NumberInfoField::mask(); |
+ value_ = value_ | NumberInfoField::encode(info); |
+} |
+ |
+ |
// ------------------------------------------------------------------------- |
// RegisterAllocator implementation. |