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

Unified Diff: src/register-allocator.cc

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.cc
===================================================================
--- src/register-allocator.cc (revision 4025)
+++ src/register-allocator.cc (working copy)
@@ -38,11 +38,11 @@
// Result implementation.
-Result::Result(Register reg, NumberInfo::Type info) {
+Result::Result(Register reg, NumberInfo info) {
ASSERT(reg.is_valid() && !RegisterAllocator::IsReserved(reg));
CodeGeneratorScope::Current()->allocator()->Use(reg);
value_ = TypeField::encode(REGISTER)
- | NumberInfoField::encode(info)
+ | NumberInfoField::encode(info.ToInt())
| DataField::encode(reg.code_);
}
@@ -53,20 +53,20 @@
}
-NumberInfo::Type Result::number_info() {
+NumberInfo Result::number_info() const {
fschneider 2010/03/05 15:01:07 Move this to register-allocator-inl.h.
ASSERT(is_valid());
- if (!is_constant()) return NumberInfoField::decode(value_);
+ if (!is_constant()) return NumberInfo::FromInt(NumberInfoField::decode(value_));
fschneider 2010/03/05 15:01:07 Long line.
Handle<Object> value = handle();
- if (value->IsSmi()) return NumberInfo::kSmi;
- if (value->IsHeapNumber()) return NumberInfo::kHeapNumber;
- return NumberInfo::kUnknown;
+ if (value->IsSmi()) return NumberInfo::Smi();
+ if (value->IsHeapNumber()) return NumberInfo::HeapNumber();
+ return NumberInfo::Unknown();
}
-void Result::set_number_info(NumberInfo::Type info) {
+void Result::set_number_info(NumberInfo info) {
fschneider 2010/03/05 15:01:07 Move this to register-allocator-inl.h.
ASSERT(is_valid());
- value_ = value_ & ~NumberInfoField::mask();
- value_ = value_ | NumberInfoField::encode(info);
+ value_ &= ~NumberInfoField::mask();
+ value_ |= NumberInfoField::encode(info.ToInt());
}
« src/register-allocator.h ('K') | « src/register-allocator.h ('k') | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698