Chromium Code Reviews| 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 if (!p.feedback().IsValid()) return NoChange(); // No feedback. | |
|
Benedikt Meurer
2015/10/15 11:18:23
Nit: Can we set call count to zero in this case? I
Michael Starzinger
2015/10/15 11:29:30
Done. As discussed offline, I used {-1} instead of
| |
| 59 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); | 60 CallICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
| 60 int calls = nexus.ExtractCallCount(); | 61 int calls = nexus.ExtractCallCount(); |
| 61 | 62 |
| 62 // --------------------------------------------------------------------------- | 63 // --------------------------------------------------------------------------- |
| 63 // Everything above this line is part of the inlining heuristic. | 64 // Everything above this line is part of the inlining heuristic. |
| 64 // --------------------------------------------------------------------------- | 65 // --------------------------------------------------------------------------- |
| 65 | 66 |
| 66 // In the general case we remember the candidate for later. | 67 // In the general case we remember the candidate for later. |
| 67 candidates_.push_back({function, node, calls}); | 68 candidates_.push_back({function, node, calls}); |
| 68 return NoChange(); | 69 return NoChange(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 candidate.node->id(), candidate.calls, | 106 candidate.node->id(), candidate.calls, |
| 106 candidate.function->shared()->SourceSize(), | 107 candidate.function->shared()->SourceSize(), |
| 107 candidate.function->shared()->ast_node_count(), | 108 candidate.function->shared()->ast_node_count(), |
| 108 candidate.function->shared()->DebugName()->ToCString().get()); | 109 candidate.function->shared()->DebugName()->ToCString().get()); |
| 109 } | 110 } |
| 110 } | 111 } |
| 111 | 112 |
| 112 } // namespace compiler | 113 } // namespace compiler |
| 113 } // namespace internal | 114 } // namespace internal |
| 114 } // namespace v8 | 115 } // namespace v8 |
| OLD | NEW |