Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index abfd4436dfa1720a540d7777d555b5c5f58ccefb..de0ffa3731b02c06273201cce9c83f52a0c08140 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1978,13 +1978,13 @@ void ExternalTwoByteString::set_resource( |
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 @@ void JSFunctionResultCache::Clear() { |
} |
+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); |