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

Unified Diff: src/compiler.cc

Issue 1208013002: [turbofan] Implement sharing of context-independent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_opt-code-map-3
Patch Set: Disable test for GC stress. Created 5 years, 6 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/code-stubs-hydrogen.cc ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index f04b231a1bc87eec6f4cc8db581dd17df4157191..9092fb5a65edb8b8389971700643d890806a1eb7 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -714,17 +714,28 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
if (code->is_turbofanned() && info->is_context_specializing()) return;
// Do not cache bound functions.
- if (info->closure()->shared()->bound()) return;
+ Handle<JSFunction> function = info->closure();
+ if (function->shared()->bound()) return;
- // Cache optimized code.
+ // Cache optimized context-specific code.
if (FLAG_cache_optimized_code) {
- Handle<JSFunction> function = info->closure();
Handle<SharedFunctionInfo> shared(function->shared());
Handle<FixedArray> literals(function->literals());
Handle<Context> native_context(function->context()->native_context());
SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
literals, info->osr_ast_id());
}
+
+ // Do not cache context-independent code compiled for OSR.
+ if (code->is_turbofanned() && info->is_osr()) return;
+
+ // Cache optimized context-independent code.
+ if (FLAG_turbo_cache_shared_code && code->is_turbofanned()) {
+ DCHECK(!info->is_context_specializing());
+ DCHECK(info->osr_ast_id().IsNone());
+ Handle<SharedFunctionInfo> shared(function->shared());
+ SharedFunctionInfo::AddSharedCodeToOptimizedCodeMap(shared, code);
+ }
}
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698