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

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: Fix mips64 rebase error. 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
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 7977bd04d3da23c6ef018fd343906bd241a27e86..dcf11f4a836c3f85aac4e9180e598a648217c847 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -1079,6 +1079,17 @@ 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) {
+ SharedFunctionInfo* shared = function->shared();
+ CodeAndLiterals result;
+ result = shared->SearchOptimizedCodeMap(
Michael Starzinger 2016/04/08 12:44:02 nit: Just use "function->shared()" directly here,
mvstanton 2016/04/11 13:36:14 Done.
+ *function->GetIsolate()->native_context(), BailoutId::None());
Michael Starzinger 2016/04/08 12:44:02 nit: The "isolate" variable is available, let's us
mvstanton 2016/04/11 13:36:14 Done.
+ 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() &&
@@ -1315,6 +1326,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)) {
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698