Commit ffa0b400 authored by Benedikt Meurer's avatar Benedikt Meurer

[turbofan] Record the SharedFunctionInfo of ALL inlined functions.

Previously we only recorded the SharedFunctionInfo of inlined functions
that had at least one (lazy) deopt point left at code generation time.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1175953002.

Cr-Commit-Position: refs/heads/master@{#28919}
parent 3548c5c6
......@@ -150,6 +150,7 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub,
: nullptr),
track_positions_(FLAG_hydrogen_track_positions ||
isolate->cpu_profiler()->is_profiling()),
inlined_functions_(zone),
opt_count_(has_shared_info() ? shared_info()->opt_count() : 0),
parameter_count_(0),
optimization_id_(-1),
......
......@@ -384,6 +384,14 @@ class CompilationInfo {
Handle<Code> GenerateCodeStub();
typedef ZoneVector<Handle<SharedFunctionInfo>> InlinedFunctionList;
InlinedFunctionList const& inlined_functions() const {
return inlined_functions_;
}
void AddInlinedFunction(Handle<SharedFunctionInfo> inlined_function) {
inlined_functions_.push_back(inlined_function);
}
protected:
ParseInfo* parse_info_;
......@@ -458,6 +466,8 @@ class CompilationInfo {
std::vector<InlinedFunctionInfo> inlined_function_infos_;
bool track_positions_;
InlinedFunctionList inlined_functions_;
// A copy of shared_info()->opt_count() to avoid handle deref
// during graph optimization.
int opt_count_;
......
......@@ -76,10 +76,8 @@ Handle<Code> CodeGenerator::GenerateCode() {
// Define deoptimization literals for all inlined functions.
DCHECK_EQ(0u, deoptimization_literals_.size());
for (auto frame_state_descriptor : code()->frame_state_descriptors()) {
Handle<SharedFunctionInfo> shared_info;
if (frame_state_descriptor->shared_info().ToHandle(&shared_info) &&
!shared_info.is_identical_to(info->shared_info())) {
for (auto shared_info : info->inlined_functions()) {
if (!shared_info.is_identical_to(info->shared_info())) {
DefineDeoptimizationLiteral(shared_info);
}
}
......
......@@ -302,6 +302,9 @@ Reduction JSInliner::Reduce(Node* node) {
info.zone());
}
// Remember that we inlined this function.
info_->AddInlinedFunction(info.shared_info());
return InlineCall(node, frame_state, start, end);
}
......
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