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

Unified Diff: src/compiler.cc

Issue 1387393002: [turbofan] Add initial support for global specialization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AstGraphBuilder
Patch Set: Fix typo. Created 5 years, 2 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/compiler.h ('k') | src/compiler/access-builder.h » ('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 a368f29810bde90f624fe77ffcca11c18455b63a..5aef46ee3d040b8000b2b1605fd462abbb0f10eb 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -445,6 +445,9 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
FLAG_turbo_asm_deoptimization) {
info()->MarkAsDeoptimizationEnabled();
}
+ if (info()->has_global_object() && FLAG_native_context_specialization) {
+ info()->MarkAsNativeContextSpecializing();
+ }
Timer t(this, &time_taken_to_create_graph_);
compiler::Pipeline pipeline(info());
@@ -772,7 +775,8 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
Handle<Code> code = info->code();
if (code->kind() != Code::OPTIMIZED_FUNCTION) return; // Nothing to do.
- // Context specialization folds-in the context, so no sharing can occur.
+ // Function context specialization folds-in the function context,
+ // so no sharing can occur.
if (info->is_function_context_specializing()) return;
// Frame specialization implies function context specialization.
DCHECK(!info->is_frame_specializing());
@@ -790,11 +794,12 @@ static void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
literals, info->osr_ast_id());
}
- // Do not cache context-independent code compiled for OSR.
+ // Do not cache (native) 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()) {
+ // Cache optimized (native) context-independent code.
+ if (FLAG_turbo_cache_shared_code && code->is_turbofanned() &&
+ !info->is_native_context_specializing()) {
DCHECK(!info->is_function_context_specializing());
DCHECK(info->osr_ast_id().IsNone());
Handle<SharedFunctionInfo> shared(function->shared());
« no previous file with comments | « src/compiler.h ('k') | src/compiler/access-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698