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

Side by Side Diff: src/compiler.cc

Issue 1811553003: [Interpreter] Make ignition compiler eagerly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test which was missed 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 unified diff | Download patch
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler.h" 5 #include "src/compiler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/ast/ast-numbering.h" 9 #include "src/ast/ast-numbering.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 // functions, so do not parse lazily in that case. 1264 // functions, so do not parse lazily in that case.
1265 ScriptCompiler::CompileOptions options = parse_info->compile_options(); 1265 ScriptCompiler::CompileOptions options = parse_info->compile_options();
1266 bool parse_allow_lazy = (options == ScriptCompiler::kConsumeParserCache || 1266 bool parse_allow_lazy = (options == ScriptCompiler::kConsumeParserCache ||
1267 String::cast(script->source())->length() > 1267 String::cast(script->source())->length() >
1268 FLAG_min_preparse_length) && 1268 FLAG_min_preparse_length) &&
1269 !info->is_debug(); 1269 !info->is_debug();
1270 1270
1271 // Consider parsing eagerly when targeting the code cache. 1271 // Consider parsing eagerly when targeting the code cache.
1272 parse_allow_lazy &= !(FLAG_serialize_eager && info->will_serialize()); 1272 parse_allow_lazy &= !(FLAG_serialize_eager && info->will_serialize());
1273 1273
1274 // Consider parsing eagerly when targeting Ignition.
1275 parse_allow_lazy &= !(FLAG_ignition && FLAG_ignition_eager &&
1276 !isolate->serializer_enabled());
1277
1274 parse_info->set_allow_lazy_parsing(parse_allow_lazy); 1278 parse_info->set_allow_lazy_parsing(parse_allow_lazy);
1275 if (!parse_allow_lazy && 1279 if (!parse_allow_lazy &&
1276 (options == ScriptCompiler::kProduceParserCache || 1280 (options == ScriptCompiler::kProduceParserCache ||
1277 options == ScriptCompiler::kConsumeParserCache)) { 1281 options == ScriptCompiler::kConsumeParserCache)) {
1278 // We are going to parse eagerly, but we either 1) have cached data 1282 // We are going to parse eagerly, but we either 1) have cached data
1279 // produced by lazy parsing or 2) are asked to generate cached data. 1283 // produced by lazy parsing or 2) are asked to generate cached data.
1280 // Eager parsing cannot benefit from cached data, and producing cached 1284 // Eager parsing cannot benefit from cached data, and producing cached
1281 // data while parsing eagerly is not implemented. 1285 // data while parsing eagerly is not implemented.
1282 parse_info->set_cached_data(nullptr); 1286 parse_info->set_cached_data(nullptr);
1283 parse_info->set_compile_options(ScriptCompiler::kNoCompileOptions); 1287 parse_info->set_compile_options(ScriptCompiler::kNoCompileOptions);
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 // unless we can lazily compile without the context. 1783 // unless we can lazily compile without the context.
1780 bool allow_lazy = literal->AllowsLazyCompilation() && 1784 bool allow_lazy = literal->AllowsLazyCompilation() &&
1781 !LiveEditFunctionTracker::IsActive(isolate) && 1785 !LiveEditFunctionTracker::IsActive(isolate) &&
1782 (!info.is_debug() || allow_lazy_without_ctx); 1786 (!info.is_debug() || allow_lazy_without_ctx);
1783 1787
1784 bool lazy = FLAG_lazy && allow_lazy && !literal->should_eager_compile(); 1788 bool lazy = FLAG_lazy && allow_lazy && !literal->should_eager_compile();
1785 1789
1786 // Consider compiling eagerly when targeting the code cache. 1790 // Consider compiling eagerly when targeting the code cache.
1787 lazy &= !(FLAG_serialize_eager && info.will_serialize()); 1791 lazy &= !(FLAG_serialize_eager && info.will_serialize());
1788 1792
1793 // Consider compiling eagerly when compiling bytecode for Ignition.
1794 lazy &=
1795 !(FLAG_ignition && FLAG_ignition_eager && !isolate->serializer_enabled());
1796
1789 // Generate code 1797 // Generate code
1790 TimerEventScope<TimerEventCompileCode> timer(isolate); 1798 TimerEventScope<TimerEventCompileCode> timer(isolate);
1791 TRACE_EVENT0("v8", "V8.CompileCode"); 1799 TRACE_EVENT0("v8", "V8.CompileCode");
1792 if (lazy) { 1800 if (lazy) {
1793 info.SetCode(isolate->builtins()->CompileLazy()); 1801 info.SetCode(isolate->builtins()->CompileLazy());
1794 } else if (Renumber(info.parse_info()) && GenerateBaselineCode(&info)) { 1802 } else if (Renumber(info.parse_info()) && GenerateBaselineCode(&info)) {
1795 // Code generation will ensure that the feedback vector is present and 1803 // Code generation will ensure that the feedback vector is present and
1796 // appropriately sized. 1804 // appropriately sized.
1797 DCHECK(!info.code().is_null()); 1805 DCHECK(!info.code().is_null());
1798 Handle<ScopeInfo> scope_info = 1806 Handle<ScopeInfo> scope_info =
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 MaybeHandle<Code> code; 1956 MaybeHandle<Code> code;
1949 if (cached.code != nullptr) code = handle(cached.code); 1957 if (cached.code != nullptr) code = handle(cached.code);
1950 Handle<Context> native_context(function->context()->native_context()); 1958 Handle<Context> native_context(function->context()->native_context());
1951 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, 1959 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code,
1952 literals, BailoutId::None()); 1960 literals, BailoutId::None());
1953 } 1961 }
1954 } 1962 }
1955 1963
1956 } // namespace internal 1964 } // namespace internal
1957 } // namespace v8 1965 } // namespace v8
OLDNEW
« no previous file with comments | « src/background-parsing-task.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698