Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 6959c40d1f5dab0a7c04fdd485cb6e252807fa81..11114f9c04d007dc7c4309a23b43230135fbfedd 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -15143,6 +15143,19 @@ void BytecodeArray::CopyBytecodesTo(BytecodeArray* to) { |
from->length()); |
} |
+void BytecodeArray::MakeOlder() { |
+ Age age = bytecode_age(); |
+ if (age < kLastBytecodeAge) { |
+ set_bytecode_age(static_cast<Age>(age + 1)); |
+ } |
+ DCHECK_GE(bytecode_age(), kFirstBytecodeAge); |
+ DCHECK_LE(bytecode_age(), kLastBytecodeAge); |
+} |
+ |
+bool BytecodeArray::IsOld() const { |
+ return bytecode_age() >= kIsOldBytecodeAge; |
+} |
+ |
// static |
void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { |
DCHECK(capacity >= 0); |
@@ -18030,7 +18043,11 @@ void CompilationCacheTable::Age() { |
} |
} else if (get(entry_index)->IsFixedArray()) { |
SharedFunctionInfo* info = SharedFunctionInfo::cast(get(value_index)); |
- if (info->code()->kind() != Code::FUNCTION || info->code()->IsOld()) { |
+ bool is_old = |
+ info->IsInterpreted() |
+ ? info->bytecode_array()->IsOld() |
+ : info->code()->kind() != Code::FUNCTION || info->code()->IsOld(); |
+ if (is_old) { |
NoWriteBarrierSet(this, entry_index, the_hole_value); |
NoWriteBarrierSet(this, value_index, the_hole_value); |
ElementRemoved(); |