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/compilation-info.h" | 7 #include "src/compilation-info.h" |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 | 279 |
280 return Replace(value); | 280 return Replace(value); |
281 } | 281 } |
282 | 282 |
283 bool JSInliningHeuristic::CandidateCompare::operator()( | 283 bool JSInliningHeuristic::CandidateCompare::operator()( |
284 const Candidate& left, const Candidate& right) const { | 284 const Candidate& left, const Candidate& right) const { |
285 if (left.calls != right.calls) { | 285 if (left.calls != right.calls) { |
286 return left.calls > right.calls; | 286 return left.calls > right.calls; |
287 } | 287 } |
288 return left.node < right.node; | 288 return left.node->id() > right.node->id(); |
289 } | 289 } |
290 | 290 |
291 void JSInliningHeuristic::PrintCandidates() { | 291 void JSInliningHeuristic::PrintCandidates() { |
292 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size()); | 292 PrintF("Candidates for inlining (size=%zu):\n", candidates_.size()); |
293 for (const Candidate& candidate : candidates_) { | 293 for (const Candidate& candidate : candidates_) { |
294 PrintF(" #%d:%s, calls:%d\n", candidate.node->id(), | 294 PrintF(" #%d:%s, calls:%d\n", candidate.node->id(), |
295 candidate.node->op()->mnemonic(), candidate.calls); | 295 candidate.node->op()->mnemonic(), candidate.calls); |
296 for (int i = 0; i < candidate.num_functions; ++i) { | 296 for (int i = 0; i < candidate.num_functions; ++i) { |
297 Handle<JSFunction> function = candidate.functions[i]; | 297 Handle<JSFunction> function = candidate.functions[i]; |
298 PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n", | 298 PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n", |
(...skipping 10 matching lines...) Expand all Loading... |
309 return jsgraph()->common(); | 309 return jsgraph()->common(); |
310 } | 310 } |
311 | 311 |
312 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const { | 312 SimplifiedOperatorBuilder* JSInliningHeuristic::simplified() const { |
313 return jsgraph()->simplified(); | 313 return jsgraph()->simplified(); |
314 } | 314 } |
315 | 315 |
316 } // namespace compiler | 316 } // namespace compiler |
317 } // namespace internal | 317 } // namespace internal |
318 } // namespace v8 | 318 } // namespace v8 |
OLD | NEW |