Index: src/compiler/js-inlining-heuristic.cc |
diff --git a/src/compiler/js-inlining-heuristic.cc b/src/compiler/js-inlining-heuristic.cc |
index 700d7467262dba0b1b18d54392f5113d336a41ef..d8a191b6cd4354509b98229840f344ff82b9c2ae 100644 |
--- a/src/compiler/js-inlining-heuristic.cc |
+++ b/src/compiler/js-inlining-heuristic.cc |
@@ -13,7 +13,7 @@ namespace internal { |
namespace compiler { |
Reduction JSInliningHeuristic::Reduce(Node* node) { |
- if (node->opcode() != IrOpcode::kJSCallFunction) return NoChange(); |
+ if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange(); |
// Check if we already saw that {node} before, and if so, just skip it. |
if (seen_.find(node->id()) != seen_.end()) return NoChange(); |
@@ -26,7 +26,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) { |
// Functions marked with %SetForceInlineFlag are immediately inlined. |
if (function->shared()->force_inline()) { |
- return inliner_.ReduceJSCallFunction(node, function); |
+ return inliner_.ReduceJSCall(node, function); |
} |
// Handling of special inlining modes right away: |
@@ -36,7 +36,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) { |
case kRestrictedInlining: |
return NoChange(); |
case kStressInlining: |
- return inliner_.ReduceJSCallFunction(node, function); |
+ return inliner_.ReduceJSCall(node, function); |
case kGeneralInlining: |
break; |
} |
@@ -67,18 +67,21 @@ Reduction JSInliningHeuristic::Reduce(Node* node) { |
// Stop inlinining once the maximum allowed level is reached. |
int level = 0; |
- for (Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
+ for (Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); |
frame_state->opcode() == IrOpcode::kFrameState; |
frame_state = NodeProperties::GetFrameStateInput(frame_state, 0)) { |
if (++level > FLAG_max_inlining_levels) return NoChange(); |
} |
// Gather feedback on how often this call site has been hit before. |
- CallFunctionParameters p = CallFunctionParametersOf(node->op()); |
int calls = -1; // Same default as CallICNexus::ExtractCallCount. |
- if (p.feedback().IsValid()) { |
- CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
- calls = nexus.ExtractCallCount(); |
+ // TODO(turbofan): We also want call counts for constructor calls. |
+ if (node->opcode() == IrOpcode::kJSCallFunction) { |
+ CallFunctionParameters p = CallFunctionParametersOf(node->op()); |
+ if (p.feedback().IsValid()) { |
+ CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
+ calls = nexus.ExtractCallCount(); |
+ } |
} |
// --------------------------------------------------------------------------- |
@@ -99,7 +102,7 @@ void JSInliningHeuristic::Finalize() { |
if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) break; |
auto i = candidates_.begin(); |
Candidate const& candidate = *i; |
- inliner_.ReduceJSCallFunction(candidate.node, candidate.function); |
+ inliner_.ReduceJSCall(candidate.node, candidate.function); |
cumulative_count_ += candidate.function->shared()->ast_node_count(); |
candidates_.erase(i); |
} |