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-call-reducer.h" | 5 #include "src/compiler/js-call-reducer.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 // Try to further reduce the JSCall {node}. | 657 // Try to further reduce the JSCall {node}. |
658 Reduction const reduction = ReduceJSCall(node); | 658 Reduction const reduction = ReduceJSCall(node); |
659 return reduction.Changed() ? reduction : Changed(node); | 659 return reduction.Changed() ? reduction : Changed(node); |
660 } | 660 } |
661 } | 661 } |
662 return NoChange(); | 662 return NoChange(); |
663 } | 663 } |
664 | 664 |
665 Reduction JSCallReducer::ReduceJSCallWithSpread(Node* node) { | 665 Reduction JSCallReducer::ReduceJSCallWithSpread(Node* node) { |
666 DCHECK_EQ(IrOpcode::kJSCallWithSpread, node->opcode()); | 666 DCHECK_EQ(IrOpcode::kJSCallWithSpread, node->opcode()); |
667 SpreadWithArityParameters const& p = SpreadWithArityParametersOf(node->op()); | 667 SpreadWithArityParameter const& p = SpreadWithArityParameterOf(node->op()); |
668 DCHECK_LE(3u, p.arity()); | 668 DCHECK_LE(3u, p.arity()); |
669 int arity = static_cast<int>(p.arity() - 1); | 669 int arity = static_cast<int>(p.arity() - 1); |
670 | 670 |
671 return ReduceSpreadCall(node, arity); | 671 return ReduceSpreadCall(node, arity); |
672 } | 672 } |
673 | 673 |
674 Reduction JSCallReducer::ReduceJSConstruct(Node* node) { | 674 Reduction JSCallReducer::ReduceJSConstruct(Node* node) { |
675 DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode()); | 675 DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode()); |
676 ConstructParameters const& p = ConstructParametersOf(node->op()); | 676 ConstructParameters const& p = ConstructParametersOf(node->op()); |
677 DCHECK_LE(2u, p.arity()); | 677 DCHECK_LE(2u, p.arity()); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 Reduction const reduction = ReduceJSConstruct(node); | 784 Reduction const reduction = ReduceJSConstruct(node); |
785 return reduction.Changed() ? reduction : Changed(node); | 785 return reduction.Changed() ? reduction : Changed(node); |
786 } | 786 } |
787 } | 787 } |
788 | 788 |
789 return NoChange(); | 789 return NoChange(); |
790 } | 790 } |
791 | 791 |
792 Reduction JSCallReducer::ReduceJSConstructWithSpread(Node* node) { | 792 Reduction JSCallReducer::ReduceJSConstructWithSpread(Node* node) { |
793 DCHECK_EQ(IrOpcode::kJSConstructWithSpread, node->opcode()); | 793 DCHECK_EQ(IrOpcode::kJSConstructWithSpread, node->opcode()); |
794 SpreadWithArityParameters const& p = SpreadWithArityParametersOf(node->op()); | 794 SpreadWithArityParameter const& p = SpreadWithArityParameterOf(node->op()); |
795 DCHECK_LE(3u, p.arity()); | 795 DCHECK_LE(3u, p.arity()); |
796 int arity = static_cast<int>(p.arity() - 2); | 796 int arity = static_cast<int>(p.arity() - 2); |
797 | 797 |
798 return ReduceSpreadCall(node, arity); | 798 return ReduceSpreadCall(node, arity); |
799 } | 799 } |
800 | 800 |
801 Graph* JSCallReducer::graph() const { return jsgraph()->graph(); } | 801 Graph* JSCallReducer::graph() const { return jsgraph()->graph(); } |
802 | 802 |
803 Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); } | 803 Isolate* JSCallReducer::isolate() const { return jsgraph()->isolate(); } |
804 | 804 |
805 Factory* JSCallReducer::factory() const { return isolate()->factory(); } | 805 Factory* JSCallReducer::factory() const { return isolate()->factory(); } |
806 | 806 |
807 CommonOperatorBuilder* JSCallReducer::common() const { | 807 CommonOperatorBuilder* JSCallReducer::common() const { |
808 return jsgraph()->common(); | 808 return jsgraph()->common(); |
809 } | 809 } |
810 | 810 |
811 JSOperatorBuilder* JSCallReducer::javascript() const { | 811 JSOperatorBuilder* JSCallReducer::javascript() const { |
812 return jsgraph()->javascript(); | 812 return jsgraph()->javascript(); |
813 } | 813 } |
814 | 814 |
815 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { | 815 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { |
816 return jsgraph()->simplified(); | 816 return jsgraph()->simplified(); |
817 } | 817 } |
818 | 818 |
819 } // namespace compiler | 819 } // namespace compiler |
820 } // namespace internal | 820 } // namespace internal |
821 } // namespace v8 | 821 } // namespace v8 |
OLD | NEW |