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

Unified Diff: src/register-allocator-inl.h

Issue 844006: Merge changes up to V8 version 2.1.3 into the partial snapshots (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/register-allocator-inl.h
===================================================================
--- src/register-allocator-inl.h (revision 3964)
+++ src/register-allocator-inl.h (working copy)
@@ -30,7 +30,6 @@
#include "codegen.h"
#include "register-allocator.h"
-#include "virtual-frame.h"
#if V8_TARGET_ARCH_IA32
#include "ia32/register-allocator-ia32-inl.h"
@@ -104,6 +103,45 @@
registers_.Unuse(ToNumber(reg));
}
+
+NumberInfo Result::number_info() const {
+ ASSERT(is_valid());
+ if (!is_constant()) {
+ return NumberInfo::FromInt(NumberInfoField::decode(value_));
+ }
+ Handle<Object> value = handle();
+ if (value->IsSmi()) return NumberInfo::Smi();
+ if (value->IsHeapNumber()) return NumberInfo::HeapNumber();
+ return NumberInfo::Unknown();
+}
+
+
+void Result::set_number_info(NumberInfo info) {
+ ASSERT(is_valid());
+ value_ &= ~NumberInfoField::mask();
+ value_ |= NumberInfoField::encode(info.ToInt());
+}
+
+
+bool Result::is_number() const {
+ return number_info().IsNumber();
+}
+
+
+bool Result::is_smi() const {
+ return number_info().IsSmi();
+}
+
+
+bool Result::is_integer32() const {
+ return number_info().IsInteger32();
+}
+
+
+bool Result::is_heap_number() const {
+ return number_info().IsHeapNumber();
+}
+
} } // namespace v8::internal
#endif // V8_REGISTER_ALLOCATOR_INL_H_
« no previous file with comments | « src/register-allocator.cc ('k') | src/rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698