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

Unified Diff: src/compiler.cc

Issue 1670143002: Visit the Optimized Code Map on first call rather than closure creation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed overly-restrictive assert. Created 4 years, 8 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/ia32/builtins-ia32.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 e80dacef5cbb60ef07a8ef6c54c8b559524ef4f3..9cec9f3aadd82dd39697485e9997827d7e230108 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -893,6 +893,16 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
TimerEventScope<TimerEventCompileCode> compile_timer(isolate);
TRACE_EVENT0("v8", "V8.CompileCode");
AggregatedHistogramTimerScope timer(isolate->counters()->compile_lazy());
+
+ if (FLAG_turbo_cache_shared_code) {
+ CodeAndLiterals result;
+ result = function->shared()->SearchOptimizedCodeMap(
+ *isolate->native_context(), BailoutId::None());
+ if (result.code != nullptr) {
+ return Handle<Code>(result.code);
+ }
+ }
+
// If the debugger is active, do not compile with turbofan unless we can
// deopt from turbofan code.
if (FLAG_turbo_asm && function->shared()->asm_function() &&
@@ -1123,6 +1133,7 @@ bool Compiler::ParseAndAnalyze(ParseInfo* info) {
bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) {
if (function->is_compiled()) return true;
+
MaybeHandle<Code> maybe_code = GetLazyCode(function);
Handle<Code> code;
if (!maybe_code.ToHandle(&code)) {
@@ -1131,7 +1142,7 @@ bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) {
}
return false;
}
- DCHECK(code->IsJavaScriptCode());
+
function->ReplaceCode(*code);
DCHECK(function->is_compiled());
return true;
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698