Reviewers: Michael Starzinger,

Description:
[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.

[email protected]

Please review this at https://codereview.chromium.org/1175953002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+16, -4 lines):
  M src/compiler.h
  M src/compiler.cc
  M src/compiler/code-generator.cc
  M src/compiler/js-inlining.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index ef21f1f46f9e65ff227bdefb703fe4132101c59e..295c975150474619d14b3e703535c8c22b709d59 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -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),
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index 56de2b60aec47c7aee914e95bfc445137b75aac6..7f15b6f567544416b82a11e0f6888bbc548b780a 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -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_;
Index: src/compiler/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 752b3eaa55fa9419726624b32b98647c526da740..d93afc872394eab8649cbfc97e65a377741433cb 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -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);
     }
   }
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index b26b40502de250ee685c736aea4424f0ba221957..f4b2d0b0faeb627056d3429eed8d99b6a3d59845 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -300,6 +300,9 @@ Reduction JSInliner::Reduce(Node* node) {
     frame_state = CreateArgumentsAdaptorFrameState(&call, info.zone());
   }

+  // Remember that we inlined this function.
+  info_->AddInlinedFunction(info.shared_info());
+
   return InlineCall(node, frame_state, start, end);
 }



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to