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

Unified Diff: src/ic.h

Issue 415543002: Express LoadIC extra ic state with LoadIC::State (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Code comments. Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index 44dd3c8c41a72f20bc0b2dcb6073f33dc6dceab0..cc316d09c3cc099e368cbfd939dfc4eb6228f27e 100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -374,9 +374,6 @@ OStream& operator<<(OStream& os, const CallIC::State& s);
class LoadIC: public IC {
public:
- // ExtraICState bits
- class ContextualModeBits: public BitField<ContextualMode, 0, 1> {};
- STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
enum ParameterIndices {
kReceiverIndex,
@@ -391,16 +388,37 @@ class LoadIC: public IC {
static const Register SlotRegister();
static const Register VectorRegister();
+ class State V8_FINAL BASE_EMBEDDED {
+ public:
+ explicit State(ExtraICState extra_ic_state)
+ : state_(extra_ic_state) {}
+
+ explicit State(ContextualMode mode)
+ : state_(ContextualModeBits::encode(mode)) {}
+
+ ExtraICState GetExtraICState() const { return state_; }
+
+ ContextualMode contextual_mode() const {
+ return ContextualModeBits::decode(state_);
+ }
+
+ private:
+ class ContextualModeBits: public BitField<ContextualMode, 0, 1> {};
+ STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0);
+
+ const ExtraICState state_;
+ };
+
static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) {
- return ContextualModeBits::encode(contextual_mode);
+ return State(contextual_mode).GetExtraICState();
}
static ContextualMode GetContextualMode(ExtraICState state) {
- return ContextualModeBits::decode(state);
+ return State(state).contextual_mode();
}
ContextualMode contextual_mode() const {
- return ContextualModeBits::decode(extra_ic_state());
+ return GetContextualMode(extra_ic_state());
}
explicit LoadIC(FrameDepth depth, Isolate* isolate)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698