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

Unified Diff: src/compiler.cc

Issue 2642933003: Revert of Revert [TypeFeedbackVector] Root literal arrays in function literal slots (Closed)
Patch Set: Created 3 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/builtins/x87/builtins-x87.cc ('k') | src/compiler/js-create-lowering.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 5e23be5e5c7cd3b6306cfabb64f37eaa740beb8f..6f123ea2b3e6ad5db98cd7ac1d048fed70ab0e6a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -598,14 +598,13 @@
&RuntimeCallStats::CompileGetFromOptimizedCodeMap);
Handle<SharedFunctionInfo> shared(function->shared());
DisallowHeapAllocation no_gc;
- CodeAndLiterals cached = shared->SearchOptimizedCodeMap(
+ Code* code = shared->SearchOptimizedCodeMap(
function->context()->native_context(), osr_ast_id);
- if (cached.code != nullptr) {
+ if (code != nullptr) {
// Caching of optimized code enabled and optimized code found.
- if (cached.literals != nullptr) function->set_literals(cached.literals);
- DCHECK(!cached.code->marked_for_deoptimization());
+ DCHECK(!code->marked_for_deoptimization());
DCHECK(function->shared()->is_compiled());
- return Handle<Code>(cached.code);
+ return Handle<Code>(code);
}
return MaybeHandle<Code>();
}
@@ -627,10 +626,9 @@
// Cache optimized context-specific code.
Handle<JSFunction> function = info->closure();
Handle<SharedFunctionInfo> shared(function->shared());
- Handle<LiteralsArray> literals(function->literals());
Handle<Context> native_context(function->context()->native_context());
SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
- literals, info->osr_ast_id());
+ info->osr_ast_id());
}
bool GetOptimizedCodeNow(CompilationJob* job) {
@@ -866,10 +864,8 @@
} else if (job->FinalizeJob() == CompilationJob::SUCCEEDED) {
job->RecordOptimizedCompilationStats();
RecordFunctionCompilation(CodeEventListener::LAZY_COMPILE_TAG, info);
- if (shared
- ->SearchOptimizedCodeMap(info->context()->native_context(),
- info->osr_ast_id())
- .code == nullptr) {
+ if (shared->SearchOptimizedCodeMap(info->context()->native_context(),
+ info->osr_ast_id()) == nullptr) {
InsertCodeIntoOptimizedCodeMap(info);
}
if (FLAG_trace_opt) {
@@ -1757,19 +1753,16 @@
function->MarkForOptimization();
}
- CodeAndLiterals cached = shared->SearchOptimizedCodeMap(
+ Code* code = shared->SearchOptimizedCodeMap(
function->context()->native_context(), BailoutId::None());
- if (cached.code != nullptr) {
+ if (code != nullptr) {
// Caching of optimized code enabled and optimized code found.
- DCHECK(!cached.code->marked_for_deoptimization());
+ DCHECK(!code->marked_for_deoptimization());
DCHECK(function->shared()->is_compiled());
- function->ReplaceCode(cached.code);
- }
-
- if (cached.literals != nullptr) {
- DCHECK(shared->is_compiled());
- function->set_literals(cached.literals);
- } else if (shared->is_compiled()) {
+ function->ReplaceCode(code);
+ }
+
+ if (shared->is_compiled()) {
// TODO(mvstanton): pass pretenure flag to EnsureLiterals.
JSFunction::EnsureLiterals(function);
}
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/compiler/js-create-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698