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

Unified Diff: runtime/vm/compiler/jit/compiler.cc

Issue 2994283002: [VM-Compiler] Don't inline if we don't have inlining budget enough to fully inline.
Patch Set: Do InliningDecision the way Slava suggested Created 3 years, 3 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 | « runtime/vm/compiler/backend/inliner.cc ('k') | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler/jit/compiler.cc
diff --git a/runtime/vm/compiler/jit/compiler.cc b/runtime/vm/compiler/jit/compiler.cc
index 5ee8d269409f573747f1a1fd1714fca562f0422e..0e571fdf85ceedc33483afef1280d42d7050ea8b 100644
--- a/runtime/vm/compiler/jit/compiler.cc
+++ b/runtime/vm/compiler/jit/compiler.cc
@@ -899,6 +899,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,
@@ -917,7 +919,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();
{
@@ -1262,7 +1265,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();
@@ -1319,7 +1322,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) {
@@ -1427,7 +1430,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();
« no previous file with comments | « runtime/vm/compiler/backend/inliner.cc ('k') | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698