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

Unified Diff: src/register-allocator.h

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/number-info.h ('k') | src/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/register-allocator.h
===================================================================
--- src/register-allocator.h (revision 3859)
+++ src/register-allocator.h (working copy)
@@ -29,6 +29,7 @@
#define V8_REGISTER_ALLOCATOR_H_
#include "macro-assembler.h"
+#include "number-info.h"
#if V8_TARGET_ARCH_IA32
#include "ia32/register-allocator-ia32.h"
@@ -64,11 +65,12 @@
Result() { invalidate(); }
// Construct a register Result.
- explicit Result(Register reg);
+ explicit Result(Register reg, NumberInfo::Type info = NumberInfo::kUnknown);
// Construct a Result whose value is a compile-time constant.
explicit Result(Handle<Object> value) {
value_ = TypeField::encode(CONSTANT)
+ | NumberInfoField::encode(NumberInfo::kUninitialized)
| DataField::encode(ConstantList()->length());
ConstantList()->Add(value);
}
@@ -99,6 +101,14 @@
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; }
+
bool is_valid() const { return type() != INVALID; }
bool is_register() const { return type() == REGISTER; }
bool is_constant() const { return type() == CONSTANT; }
@@ -130,7 +140,8 @@
uint32_t value_;
class TypeField: public BitField<Type, 0, 2> {};
- class DataField: public BitField<uint32_t, 2, 32 - 3> {};
+ class NumberInfoField : public BitField<NumberInfo::Type, 2, 3> {};
+ class DataField: public BitField<uint32_t, 5, 32 - 6> {};
inline void CopyTo(Result* destination) const;
« no previous file with comments | « src/number-info.h ('k') | src/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698