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

Unified Diff: src/factory.cc

Issue 1764023003: [compiler] Move JSFunction post-instantiation tasks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. Created 4 years, 9 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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 5babef6733306be9c5c986f863650ef2a95e9bde..b51fa73087e1063a4ad4da1e604a61a8a90f5010 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1350,35 +1350,8 @@ Handle<JSFunction> Factory::NewFunctionFromSharedFunctionInfo(
info->ResetForNewContext(isolate()->heap()->global_ic_age());
}
- if (FLAG_always_opt && info->allows_lazy_compilation()) {
- result->MarkForOptimization();
- }
-
- CodeAndLiterals cached = info->SearchOptimizedCodeMap(
- context->native_context(), BailoutId::None());
- if (cached.code != nullptr) {
- // Caching of optimized code enabled and optimized code found.
- DCHECK(!cached.code->marked_for_deoptimization());
- DCHECK(result->shared()->is_compiled());
- result->ReplaceCode(cached.code);
- }
-
- if (cached.literals != nullptr) {
- result->set_literals(cached.literals);
- } else {
- int number_of_literals = info->num_literals();
- Handle<LiteralsArray> literals =
- LiteralsArray::New(isolate(), handle(info->feedback_vector()),
- number_of_literals, pretenure);
- result->set_literals(*literals);
-
- // Cache context-specific literals.
- MaybeHandle<Code> code;
- if (cached.code != nullptr) code = handle(cached.code);
- Handle<Context> native_context(context->native_context());
- SharedFunctionInfo::AddToOptimizedCodeMap(info, native_context, code,
- literals, BailoutId::None());
- }
+ // Give compiler a chance to pre-initialize.
+ Compiler::PostInstantiation(result, pretenure);
return result;
}
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698