Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index de0ffa3731b02c06273201cce9c83f52a0c08140..df44674a1ada01f354a8f678db327e5246ecff04 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -2416,6 +2416,12 @@ InlineCacheState Code::ic_state() { |
} |
+Code::ExtraICState Code::extra_ic_state() { |
+ ASSERT(is_inline_cache_stub()); |
+ return ExtractExtraICStateFromFlags(flags()); |
+} |
+ |
+ |
PropertyType Code::type() { |
ASSERT(ic_state() == MONOMORPHIC); |
return ExtractTypeFromFlags(flags()); |
@@ -2592,14 +2598,20 @@ bool Code::is_inline_cache_stub() { |
Code::Flags Code::ComputeFlags(Kind kind, |
InLoopFlag in_loop, |
InlineCacheState ic_state, |
+ ExtraICState extra_ic_state, |
PropertyType type, |
int argc, |
InlineCacheHolderFlag holder) { |
+ // Extra IC state is only allowed for monomorphic call IC stubs. |
+ ASSERT(extra_ic_state == kNoExtraICState || |
+ (kind == CALL_IC && (ic_state == MONOMORPHIC || |
+ ic_state == MONOMORPHIC_PROTOTYPE_FAILURE))); |
// Compute the bit mask. |
int bits = kind << kFlagsKindShift; |
if (in_loop) bits |= kFlagsICInLoopMask; |
bits |= ic_state << kFlagsICStateShift; |
bits |= type << kFlagsTypeShift; |
+ bits |= extra_ic_state << kFlagsExtraICStateShift; |
bits |= argc << kFlagsArgumentsCountShift; |
if (holder == PROTOTYPE_MAP) bits |= kFlagsCacheInPrototypeMapMask; |
// Cast to flags and validate result before returning it. |
@@ -2608,6 +2620,7 @@ Code::Flags Code::ComputeFlags(Kind kind, |
ASSERT(ExtractICStateFromFlags(result) == ic_state); |
ASSERT(ExtractICInLoopFromFlags(result) == in_loop); |
ASSERT(ExtractTypeFromFlags(result) == type); |
+ ASSERT(ExtractExtraICStateFromFlags(result) == extra_ic_state); |
ASSERT(ExtractArgumentsCountFromFlags(result) == argc); |
return result; |
} |
@@ -2615,10 +2628,12 @@ Code::Flags Code::ComputeFlags(Kind kind, |
Code::Flags Code::ComputeMonomorphicFlags(Kind kind, |
PropertyType type, |
+ ExtraICState extra_ic_state, |
InlineCacheHolderFlag holder, |
InLoopFlag in_loop, |
int argc) { |
- return ComputeFlags(kind, in_loop, MONOMORPHIC, type, argc, holder); |
+ return ComputeFlags( |
+ kind, in_loop, MONOMORPHIC, extra_ic_state, type, argc, holder); |
} |
@@ -2634,6 +2649,12 @@ InlineCacheState Code::ExtractICStateFromFlags(Flags flags) { |
} |
+Code::ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) { |
+ int bits = (flags & kFlagsExtraICStateMask) >> kFlagsExtraICStateShift; |
+ return static_cast<ExtraICState>(bits); |
+} |
+ |
+ |
InLoopFlag Code::ExtractICInLoopFromFlags(Flags flags) { |
int bits = (flags & kFlagsICInLoopMask); |
return bits != 0 ? IN_LOOP : NOT_IN_LOOP; |