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

Unified Diff: src/objects-inl.h

Issue 6321012: Version 3.0.9... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 11 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 | « src/objects-debug.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 6384)
+++ src/objects-inl.h (working copy)
@@ -1978,13 +1978,13 @@
void JSFunctionResultCache::MakeZeroSize() {
- set(kFingerIndex, Smi::FromInt(kEntriesIndex));
- set(kCacheSizeIndex, Smi::FromInt(kEntriesIndex));
+ set_finger_index(kEntriesIndex);
+ set_size(kEntriesIndex);
}
void JSFunctionResultCache::Clear() {
- int cache_size = Smi::cast(get(kCacheSizeIndex))->value();
+ int cache_size = size();
Object** entries_start = RawField(this, OffsetOfElementAt(kEntriesIndex));
MemsetPointer(entries_start,
Heap::the_hole_value(),
@@ -1993,6 +1993,26 @@
}
+int JSFunctionResultCache::size() {
+ return Smi::cast(get(kCacheSizeIndex))->value();
+}
+
+
+void JSFunctionResultCache::set_size(int size) {
+ set(kCacheSizeIndex, Smi::FromInt(size));
+}
+
+
+int JSFunctionResultCache::finger_index() {
+ return Smi::cast(get(kFingerIndex))->value();
+}
+
+
+void JSFunctionResultCache::set_finger_index(int finger_index) {
+ set(kFingerIndex, Smi::FromInt(finger_index));
+}
+
+
byte ByteArray::get(int index) {
ASSERT(index >= 0 && index < this->length());
return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
@@ -2396,6 +2416,12 @@
}
+Code::ExtraICState Code::extra_ic_state() {
+ ASSERT(is_inline_cache_stub());
+ return ExtractExtraICStateFromFlags(flags());
+}
+
+
PropertyType Code::type() {
ASSERT(ic_state() == MONOMORPHIC);
return ExtractTypeFromFlags(flags());
@@ -2572,14 +2598,20 @@
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.
@@ -2588,6 +2620,7 @@
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;
}
@@ -2595,10 +2628,12 @@
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);
}
@@ -2614,6 +2649,12 @@
}
+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;
« no previous file with comments | « src/objects-debug.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698