| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/js-inlining-heuristic.h" | 5 #include "src/compiler/js-inlining-heuristic.h" |
| 6 | 6 |
| 7 #include "src/compiler/dead-code-elimination.h" // TODO(mstarzinger): Remove! | 7 #include "src/compiler/dead-code-elimination.h" // TODO(mstarzinger): Remove! |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return NoChange(); | 49 return NoChange(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Quick check on the size of the AST to avoid parsing large candidate. | 52 // Quick check on the size of the AST to avoid parsing large candidate. |
| 53 if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) { | 53 if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) { |
| 54 return NoChange(); | 54 return NoChange(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Gather feedback on how often this call site has been hit before. | 57 // Gather feedback on how often this call site has been hit before. |
| 58 CallFunctionParameters p = CallFunctionParametersOf(node->op()); | 58 CallFunctionParameters p = CallFunctionParametersOf(node->op()); |
| 59 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); | 59 int calls = -1; // Same default as CallICNexus::ExtractCallCount. |
| 60 int calls = nexus.ExtractCallCount(); | 60 if (p.feedback().IsValid()) { |
| 61 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
| 62 calls = nexus.ExtractCallCount(); |
| 63 } |
| 61 | 64 |
| 62 // --------------------------------------------------------------------------- | 65 // --------------------------------------------------------------------------- |
| 63 // Everything above this line is part of the inlining heuristic. | 66 // Everything above this line is part of the inlining heuristic. |
| 64 // --------------------------------------------------------------------------- | 67 // --------------------------------------------------------------------------- |
| 65 | 68 |
| 66 // In the general case we remember the candidate for later. | 69 // In the general case we remember the candidate for later. |
| 67 candidates_.push_back({function, node, calls}); | 70 candidates_.push_back({function, node, calls}); |
| 68 return NoChange(); | 71 return NoChange(); |
| 69 } | 72 } |
| 70 | 73 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 candidate.node->id(), candidate.calls, | 108 candidate.node->id(), candidate.calls, |
| 106 candidate.function->shared()->SourceSize(), | 109 candidate.function->shared()->SourceSize(), |
| 107 candidate.function->shared()->ast_node_count(), | 110 candidate.function->shared()->ast_node_count(), |
| 108 candidate.function->shared()->DebugName()->ToCString().get()); | 111 candidate.function->shared()->DebugName()->ToCString().get()); |
| 109 } | 112 } |
| 110 } | 113 } |
| 111 | 114 |
| 112 } // namespace compiler | 115 } // namespace compiler |
| 113 } // namespace internal | 116 } // namespace internal |
| 114 } // namespace v8 | 117 } // namespace v8 |
| OLD | NEW |