| 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-intrinsic-lowering.h" | 5 #include "src/compiler/js-intrinsic-lowering.h" |
| 6 | 6 |
| 7 #include <stack> | 7 #include <stack> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 case Runtime::kInlineToObject: | 107 case Runtime::kInlineToObject: |
| 108 return ReduceToObject(node); | 108 return ReduceToObject(node); |
| 109 case Runtime::kInlineToPrimitive: | 109 case Runtime::kInlineToPrimitive: |
| 110 return ReduceToPrimitive(node); | 110 return ReduceToPrimitive(node); |
| 111 case Runtime::kInlineToString: | 111 case Runtime::kInlineToString: |
| 112 return ReduceToString(node); | 112 return ReduceToString(node); |
| 113 case Runtime::kInlineThrowNotDateError: | 113 case Runtime::kInlineThrowNotDateError: |
| 114 return ReduceThrowNotDateError(node); | 114 return ReduceThrowNotDateError(node); |
| 115 case Runtime::kInlineCall: | 115 case Runtime::kInlineCall: |
| 116 return ReduceCall(node); | 116 return ReduceCall(node); |
| 117 case Runtime::kInlineTailCall: |
| 118 return ReduceTailCall(node); |
| 117 default: | 119 default: |
| 118 break; | 120 break; |
| 119 } | 121 } |
| 120 return NoChange(); | 122 return NoChange(); |
| 121 } | 123 } |
| 122 | 124 |
| 123 | 125 |
| 124 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) { | 126 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) { |
| 125 Node* high = NodeProperties::GetValueInput(node, 0); | 127 Node* high = NodeProperties::GetValueInput(node, 0); |
| 126 Node* low = NodeProperties::GetValueInput(node, 1); | 128 Node* low = NodeProperties::GetValueInput(node, 1); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 NodeProperties::ChangeOp(node, javascript()->ToString()); | 647 NodeProperties::ChangeOp(node, javascript()->ToString()); |
| 646 return Changed(node); | 648 return Changed(node); |
| 647 } | 649 } |
| 648 | 650 |
| 649 | 651 |
| 650 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { | 652 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { |
| 651 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); | 653 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); |
| 652 NodeProperties::ChangeOp( | 654 NodeProperties::ChangeOp( |
| 653 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), | 655 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), |
| 654 ConvertReceiverMode::kAny, | 656 ConvertReceiverMode::kAny, |
| 657 TailCallMode::kDisallow)); |
| 658 return Changed(node); |
| 659 } |
| 660 |
| 661 |
| 662 Reduction JSIntrinsicLowering::ReduceTailCall(Node* node) { |
| 663 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); |
| 664 NodeProperties::ChangeOp( |
| 665 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), |
| 666 ConvertReceiverMode::kAny, |
| 655 TailCallMode::kAllow)); | 667 TailCallMode::kAllow)); |
| 656 return Changed(node); | 668 return Changed(node); |
| 657 } | 669 } |
| 658 | 670 |
| 659 | 671 |
| 660 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, | 672 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, |
| 661 Node* b) { | 673 Node* b) { |
| 662 RelaxControls(node); | 674 RelaxControls(node); |
| 663 node->ReplaceInput(0, a); | 675 node->ReplaceInput(0, a); |
| 664 node->ReplaceInput(1, b); | 676 node->ReplaceInput(1, b); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 } | 731 } |
| 720 | 732 |
| 721 | 733 |
| 722 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { | 734 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { |
| 723 return jsgraph()->simplified(); | 735 return jsgraph()->simplified(); |
| 724 } | 736 } |
| 725 | 737 |
| 726 } // namespace compiler | 738 } // namespace compiler |
| 727 } // namespace internal | 739 } // namespace internal |
| 728 } // namespace v8 | 740 } // namespace v8 |
| OLD | NEW |