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

Unified Diff: src/objects.cc

Issue 2534763003: [Interpreter] Add bytecode aging and use it enable CompilationCache for bytecode (Closed)
Patch Set: Created 4 years, 1 month 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.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698