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

Unified Diff: src/register-allocator.cc

Issue 545007: Introduce number type information in the virtual frame. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: merged with latest rev. 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
« no previous file with comments | « src/register-allocator.h ('k') | src/virtual-frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/register-allocator.h ('k') | src/virtual-frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698