Commit c5c27dd5 authored by bmeurer's avatar bmeurer Committed by Commit bot

[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

Committed: https://chromium.googlesource.com/v8/v8/+/ffa0b4007cd7de0cfd6d37079ef360e3beeb5686

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

Cr-Commit-Position: refs/heads/master@{#28922}
parent 77893a97
......@@ -384,6 +384,14 @@ class CompilationInfo {
Handle<Code> GenerateCodeStub();
typedef std::vector<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