Commit 48cee973 authored by Mythri's avatar Mythri Committed by Commit Bot

[Turbofan] Include size of parent function in inlining decisions.

The size of parent function is not considered when taking decisions
on which functions to inline. This cl, includes the size of the
parent function to the cumulative count. 

Bug: 
Change-Id: Ib8f4ec684f8313f7c2e29237580bb3c0403930bd
Reviewed-on: https://chromium-review.googlesource.com/506205
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46789}
parent 80043a23
......@@ -19,6 +19,23 @@ namespace compiler {
if (FLAG_trace_turbo_inlining) PrintF(__VA_ARGS__); \
} while (false)
JSInliningHeuristic::JSInliningHeuristic(Editor* editor, Mode mode,
Zone* local_zone,
CompilationInfo* info,
JSGraph* jsgraph,
SourcePositionTable* source_positions)
: AdvancedReducer(editor),
mode_(mode),
inliner_(editor, local_zone, info, jsgraph, source_positions),
candidates_(local_zone),
seen_(local_zone),
jsgraph_(jsgraph) {
// Initialize cumulative_count_ with the size of the current function.
if (info->shared_info()->HasBytecodeArray()) {
cumulative_count_ = info->shared_info()->bytecode_array()->length();
}
}
namespace {
int CollectFunctions(Node* node, Handle<JSFunction>* functions,
......
......@@ -16,13 +16,7 @@ class JSInliningHeuristic final : public AdvancedReducer {
enum Mode { kGeneralInlining, kRestrictedInlining, kStressInlining };
JSInliningHeuristic(Editor* editor, Mode mode, Zone* local_zone,
CompilationInfo* info, JSGraph* jsgraph,
SourcePositionTable* source_positions)
: AdvancedReducer(editor),
mode_(mode),
inliner_(editor, local_zone, info, jsgraph, source_positions),
candidates_(local_zone),
seen_(local_zone),
jsgraph_(jsgraph) {}
SourcePositionTable* source_positions);
const char* reducer_name() const override { return "JSInliningHeuristic"; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment