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

Unified Diff: src/frame-element.h

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
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.h » ('j') | src/ia32/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frame-element.h
===================================================================
--- src/frame-element.h (revision 4025)
+++ src/frame-element.h (working copy)
@@ -53,23 +53,23 @@
SYNCED
};
- inline NumberInfo::Type number_info() {
+ inline NumberInfo number_info() {
// Copied elements do not have number info. Instead
// we have to inspect their backing element in the frame.
ASSERT(!is_copy());
- if (!is_constant()) return NumberInfoField::decode(value_);
+ if (!is_constant()) return NumberInfo::FromInt(NumberInfoField::decode(value_));
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();
}
- inline void set_number_info(NumberInfo::Type info) {
+ inline void set_number_info(NumberInfo info) {
// Copied elements do not have number info. Instead
// we have to inspect their backing element in the frame.
ASSERT(!is_copy());
value_ = value_ & ~NumberInfoField::mask();
- value_ = value_ | NumberInfoField::encode(info);
+ value_ = value_ | NumberInfoField::encode(info.ToInt());
}
// The default constructor creates an invalid frame element.
@@ -77,7 +77,7 @@
value_ = TypeField::encode(INVALID)
| CopiedField::encode(false)
| SyncedField::encode(false)
- | NumberInfoField::encode(NumberInfo::kUninitialized)
+ | NumberInfoField::encode(NumberInfo::Uninitialized().ToInt())
| DataField::encode(0);
}
@@ -88,7 +88,7 @@
}
// Factory function to construct an in-memory frame element.
- static FrameElement MemoryElement(NumberInfo::Type info) {
+ static FrameElement MemoryElement(NumberInfo info) {
FrameElement result(MEMORY, no_reg, SYNCED, info);
return result;
}
@@ -96,7 +96,7 @@
// Factory function to construct an in-register frame element.
static FrameElement RegisterElement(Register reg,
SyncFlag is_synced,
- NumberInfo::Type info) {
+ NumberInfo info) {
return FrameElement(REGISTER, reg, is_synced, info);
}
@@ -210,11 +210,11 @@
FrameElement(Type type,
Register reg,
SyncFlag is_synced,
- NumberInfo::Type info) {
+ NumberInfo info) {
value_ = TypeField::encode(type)
| CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED)
- | NumberInfoField::encode(info)
+ | NumberInfoField::encode(info.ToInt())
| DataField::encode(reg.code_ > 0 ? reg.code_ : 0);
}
@@ -223,7 +223,7 @@
value_ = TypeField::encode(CONSTANT)
| CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED)
- | NumberInfoField::encode(NumberInfo::kUninitialized)
+ | NumberInfoField::encode(NumberInfo::Uninitialized().ToInt())
| DataField::encode(ConstantList()->length());
ConstantList()->Add(value);
}
@@ -252,8 +252,8 @@
class TypeField: public BitField<Type, 0, 3> {};
class CopiedField: public BitField<bool, 3, 1> {};
class SyncedField: public BitField<bool, 4, 1> {};
- class NumberInfoField: public BitField<NumberInfo::Type, 5, 3> {};
- class DataField: public BitField<uint32_t, 8, 32 - 8> {};
+ class NumberInfoField: public BitField<int, 5, 4> {};
+ class DataField: public BitField<uint32_t, 9, 32 - 9> {};
friend class VirtualFrame;
};
« no previous file with comments | « no previous file | src/ia32/codegen-ia32.h » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698