OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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.h" | 5 #include "src/compiler/js-inlining.h" |
6 | 6 |
7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return NodeProperties::GetFrameStateInput(call_); | 59 return NodeProperties::GetFrameStateInput(call_); |
60 } | 60 } |
61 | 61 |
62 int formal_arguments() { | 62 int formal_arguments() { |
63 // Both, {JSCall} and {JSConstruct}, have two extra inputs: | 63 // Both, {JSCall} and {JSConstruct}, have two extra inputs: |
64 // - JSConstruct: Includes target function and new target. | 64 // - JSConstruct: Includes target function and new target. |
65 // - JSCall: Includes target function and receiver. | 65 // - JSCall: Includes target function and receiver. |
66 return call_->op()->ValueInputCount() - 2; | 66 return call_->op()->ValueInputCount() - 2; |
67 } | 67 } |
68 | 68 |
69 float frequency() const { | 69 CallFrequency frequency() const { |
70 return (call_->opcode() == IrOpcode::kJSCall) | 70 return (call_->opcode() == IrOpcode::kJSCall) |
71 ? CallParametersOf(call_->op()).frequency() | 71 ? CallParametersOf(call_->op()).frequency() |
72 : ConstructParametersOf(call_->op()).frequency(); | 72 : ConstructParametersOf(call_->op()).frequency(); |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 Node* call_; | 76 Node* call_; |
77 }; | 77 }; |
78 | 78 |
79 Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context, | 79 Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context, |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 745 |
746 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 746 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
747 | 747 |
748 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 748 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
749 return jsgraph()->simplified(); | 749 return jsgraph()->simplified(); |
750 } | 750 } |
751 | 751 |
752 } // namespace compiler | 752 } // namespace compiler |
753 } // namespace internal | 753 } // namespace internal |
754 } // namespace v8 | 754 } // namespace v8 |
OLD | NEW |