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

Unified Diff: runtime/vm/compiler.cc

Issue 2994283002: [VM-Compiler] Don't inline if we don't have inlining budget enough to fully inline.
Patch Set: Created 3 years, 4 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: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 0e80977c90fc5ac418018ad2140ccc86222f325a..563ca1b7becf464614297ed9632acc851e263fb4 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -895,6 +895,8 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
FlowGraphInliner::SetInliningId(flow_graph, 0);
+ int inlining_depth = 0;
+
// Inlining (mutates the flow graph)
if (FLAG_use_inlining) {
NOT_IN_PRODUCT(TimelineDurationScope tds2(thread(), compiler_timeline,
@@ -913,7 +915,7 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
use_speculative_inlining,
/*inlining_black_list=*/NULL,
/*precompiler=*/NULL);
- inliner.Inline();
+ inlining_depth = inliner.Inline();
// Use lists are maintained and validated by the inliner.
DEBUG_ASSERT(flow_graph->VerifyUseLists());
thread()->CheckForSafepoint();
@@ -1152,6 +1154,7 @@ RawCode* CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
// Compute and store graph informations (call & instruction counts)
// to be later used by the inliner.
FlowGraphInliner::CollectGraphInfo(flow_graph, true);
+ function.set_inlining_depth(inlining_depth);
flow_graph->RemoveRedefinitions();
{
@@ -1261,7 +1264,7 @@ static RawObject* CompileFunctionHelper(CompilationPipeline* pipeline,
bool optimized,
intptr_t osr_id) {
ASSERT(!FLAG_precompiled_mode);
- ASSERT(!optimized || function.was_compiled());
+ ASSERT(!optimized || function.WasCompiled());
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
Thread* const thread = Thread::Current();
@@ -1318,7 +1321,7 @@ static RawObject* CompileFunctionHelper(CompilationPipeline* pipeline,
const Code& result = Code::Handle(helper.Compile(pipeline));
if (!result.IsNull()) {
if (!optimized) {
- function.set_was_compiled(true);
+ function.SetWasCompiled(true);
}
} else {
if (optimized) {
@@ -1426,7 +1429,7 @@ static RawError* ParseFunctionHelper(CompilationPipeline* pipeline,
bool optimized,
intptr_t osr_id) {
ASSERT(!FLAG_precompiled_mode);
- ASSERT(!optimized || function.was_compiled());
+ ASSERT(!optimized || function.WasCompiled());
LongJumpScope jump;
if (setjmp(*jump.Set()) == 0) {
Thread* const thread = Thread::Current();

Powered by Google App Engine
This is Rietveld 408576698