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

Unified Diff: src/frame-element.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 | « no previous file | src/frame-element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frame-element.h
===================================================================
--- src/frame-element.h (revision 3859)
+++ src/frame-element.h (working copy)
@@ -28,6 +28,7 @@
#ifndef V8_FRAME_ELEMENT_H_
#define V8_FRAME_ELEMENT_H_
+#include "number-info.h"
#include "macro-assembler.h"
namespace v8 {
@@ -52,11 +53,18 @@
SYNCED
};
+ NumberInfo::Type number_info();
+ void set_number_info(NumberInfo::Type info) {
+ value_ = value_ & ~NumberInfoField::mask();
+ value_ = value_ | NumberInfoField::encode(info);
+ }
+
// The default constructor creates an invalid frame element.
FrameElement() {
value_ = TypeField::encode(INVALID)
| CopiedField::encode(false)
| SyncedField::encode(false)
+ | NumberInfoField::encode(NumberInfo::kUninitialized)
| DataField::encode(0);
}
@@ -67,15 +75,16 @@
}
// Factory function to construct an in-memory frame element.
- static FrameElement MemoryElement() {
- FrameElement result(MEMORY, no_reg, SYNCED);
+ static FrameElement MemoryElement(NumberInfo::Type info) {
+ FrameElement result(MEMORY, no_reg, SYNCED, info);
return result;
}
// Factory function to construct an in-register frame element.
static FrameElement RegisterElement(Register reg,
- SyncFlag is_synced) {
- return FrameElement(REGISTER, reg, is_synced);
+ SyncFlag is_synced,
+ NumberInfo::Type info) {
+ return FrameElement(REGISTER, reg, is_synced, info);
}
// Factory function to construct a frame element whose value is known at
@@ -185,10 +194,14 @@
};
// Used to construct memory and register elements.
- FrameElement(Type type, Register reg, SyncFlag is_synced) {
+ FrameElement(Type type,
+ Register reg,
+ SyncFlag is_synced,
+ NumberInfo::Type info) {
value_ = TypeField::encode(type)
| CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED)
+ | NumberInfoField::encode(info)
| DataField::encode(reg.code_ > 0 ? reg.code_ : 0);
}
@@ -197,6 +210,7 @@
value_ = TypeField::encode(CONSTANT)
| CopiedField::encode(false)
| SyncedField::encode(is_synced != NOT_SYNCED)
+ | NumberInfoField::encode(NumberInfo::kUninitialized)
| DataField::encode(ConstantList()->length());
ConstantList()->Add(value);
}
@@ -223,9 +237,10 @@
uint32_t value_;
class TypeField: public BitField<Type, 0, 3> {};
- class CopiedField: public BitField<uint32_t, 3, 1> {};
- class SyncedField: public BitField<uint32_t, 4, 1> {};
- class DataField: public BitField<uint32_t, 5, 32 - 6> {};
+ 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 - 9> {};
friend class VirtualFrame;
};
« no previous file with comments | « no previous file | src/frame-element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698