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

Unified Diff: src/runtime/runtime-compiler.cc

Issue 1642613002: Reland of Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: %SetCode failed to install literals in cache. Created 4 years, 11 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/runtime/runtime.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-compiler.cc
diff --git a/src/runtime/runtime-compiler.cc b/src/runtime/runtime-compiler.cc
index de974a2df505aee31ec1604508e95b362ed3d13e..81f29887926f88264fc15fa4bffcf7d4665cf6c6 100644
--- a/src/runtime/runtime-compiler.cc
+++ b/src/runtime/runtime-compiler.cc
@@ -34,12 +34,28 @@ RUNTIME_FUNCTION(Runtime_CompileLazy) {
// Compile the target function.
DCHECK(function->shared()->allows_lazy_compilation());
+ // There is one special case where we have optimized code but we
+ // couldn't find a literals array for the native context. That's with
+ // FLAG_turbo_cache_shared_code.
+ if (FLAG_turbo_cache_shared_code) {
+ SharedFunctionInfo* shared = function->shared();
+ CodeAndLiterals result;
+ result = shared->SearchOptimizedCodeMap(*isolate->native_context(),
+ BailoutId::None());
+ if (result.code != nullptr) {
+ function->ReplaceCode(result.code);
+ JSFunction::EnsureLiterals(function);
+ return result.code;
+ }
+ }
+
Handle<Code> code;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code,
Compiler::GetLazyCode(function));
DCHECK(code->IsJavaScriptCode());
function->ReplaceCode(*code);
+ JSFunction::EnsureLiterals(function);
return *code;
}
@@ -71,6 +87,7 @@ Object* CompileOptimized(Isolate* isolate, Handle<JSFunction> function,
DCHECK(function->code()->kind() == Code::FUNCTION ||
function->code()->kind() == Code::OPTIMIZED_FUNCTION ||
+ function->code()->is_interpreter_entry_trampoline() ||
function->IsInOptimizationQueue());
return function->code();
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698