Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 9a903f1ff59ad217d25a74e53589927ea1d12ff7..1b066d89cb2e1d270d117b711ac6995bc61931a5 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -15175,6 +15175,19 @@ int BytecodeArray::LookupRangeInHandlerTable( |
return table->LookupRange(code_offset, data, prediction); |
} |
+void BytecodeArray::MakeOlder() { |
+ Age age = bytecode_age(); |
+ if (age < kLastBytecodeAge) { |
+ set_bytecode_age(static_cast<Age>(age + 1)); |
+ } |
+ DCHECK_GE(age, kFirstBytecodeAge); |
+ DCHECK_LE(age, kLastBytecodeAge); |
Michael Starzinger
2016/11/28 14:21:30
nit: Shouldn't these DCHECKs be applied on the _ne
rmcilroy
2016/11/28 14:29:04
Yes the should, updated to check bytecode_age() in
|
+} |
+ |
+bool BytecodeArray::IsOld() const { |
+ return bytecode_age() >= kIsOldBytecodeAge; |
+} |
+ |
// static |
void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { |
DCHECK(capacity >= 0); |
@@ -17970,7 +17983,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(); |