Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 2034) |
+++ src/objects-inl.h (working copy) |
@@ -1897,6 +1897,11 @@ |
} |
+InlineCacheInLoop Code::ic_in_loop() { |
+ return ExtractICInLoopFromFlags(flags()); |
+} |
+ |
+ |
InlineCacheState Code::ic_state() { |
InlineCacheState result = ExtractICStateFromFlags(flags()); |
// Only allow uninitialized or debugger states for non-IC code |
@@ -1943,11 +1948,13 @@ |
Code::Flags Code::ComputeFlags(Kind kind, |
+ InlineCacheInLoop in_loop, |
InlineCacheState ic_state, |
PropertyType type, |
int argc) { |
// Compute the bit mask. |
int bits = kind << kFlagsKindShift; |
+ if (in_loop) bits |= kFlagsICInLoopMask; |
Kevin Millikin (Chromium)
2009/05/25 11:00:42
if (in_loop == IN_LOOP) ...
|
bits |= ic_state << kFlagsICStateShift; |
bits |= type << kFlagsTypeShift; |
bits |= argc << kFlagsArgumentsCountShift; |
@@ -1955,6 +1962,7 @@ |
Flags result = static_cast<Flags>(bits); |
ASSERT(ExtractKindFromFlags(result) == kind); |
ASSERT(ExtractICStateFromFlags(result) == ic_state); |
+ ASSERT(ExtractICInLoopFromFlags(result) == in_loop); |
ASSERT(ExtractTypeFromFlags(result) == type); |
ASSERT(ExtractArgumentsCountFromFlags(result) == argc); |
return result; |
@@ -1963,8 +1971,9 @@ |
Code::Flags Code::ComputeMonomorphicFlags(Kind kind, |
PropertyType type, |
+ InlineCacheInLoop in_loop, |
int argc) { |
- return ComputeFlags(kind, MONOMORPHIC, type, argc); |
+ return ComputeFlags(kind, in_loop, MONOMORPHIC, type, argc); |
} |
@@ -1980,6 +1989,12 @@ |
} |
+InlineCacheInLoop Code::ExtractICInLoopFromFlags(Flags flags) { |
+ int bits = (flags & kFlagsICInLoopMask); |
+ return bits != 0 ? IN_LOOP : NOT_IN_LOOP; |
+} |
+ |
+ |
PropertyType Code::ExtractTypeFromFlags(Flags flags) { |
int bits = (flags & kFlagsTypeMask) >> kFlagsTypeShift; |
return static_cast<PropertyType>(bits); |