Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1439613003: [turbofan] Better and more sane support for tail calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename tests Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 case Runtime::kInlineToObject: 104 case Runtime::kInlineToObject:
105 return ReduceToObject(node); 105 return ReduceToObject(node);
106 case Runtime::kInlineToPrimitive: 106 case Runtime::kInlineToPrimitive:
107 return ReduceToPrimitive(node); 107 return ReduceToPrimitive(node);
108 case Runtime::kInlineToString: 108 case Runtime::kInlineToString:
109 return ReduceToString(node); 109 return ReduceToString(node);
110 case Runtime::kInlineThrowNotDateError: 110 case Runtime::kInlineThrowNotDateError:
111 return ReduceThrowNotDateError(node); 111 return ReduceThrowNotDateError(node);
112 case Runtime::kInlineCall: 112 case Runtime::kInlineCall:
113 return ReduceCall(node); 113 return ReduceCall(node);
114 case Runtime::kInlineTailCall:
115 return ReduceTailCall(node);
114 default: 116 default:
115 break; 117 break;
116 } 118 }
117 return NoChange(); 119 return NoChange();
118 } 120 }
119 121
120 122
121 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) { 123 Reduction JSIntrinsicLowering::ReduceConstructDouble(Node* node) {
122 Node* high = NodeProperties::GetValueInput(node, 0); 124 Node* high = NodeProperties::GetValueInput(node, 0);
123 Node* low = NodeProperties::GetValueInput(node, 1); 125 Node* low = NodeProperties::GetValueInput(node, 1);
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 NodeProperties::ChangeOp(node, javascript()->ToString()); 603 NodeProperties::ChangeOp(node, javascript()->ToString());
602 return Changed(node); 604 return Changed(node);
603 } 605 }
604 606
605 607
606 Reduction JSIntrinsicLowering::ReduceCall(Node* node) { 608 Reduction JSIntrinsicLowering::ReduceCall(Node* node) {
607 size_t const arity = CallRuntimeParametersOf(node->op()).arity(); 609 size_t const arity = CallRuntimeParametersOf(node->op()).arity();
608 NodeProperties::ChangeOp( 610 NodeProperties::ChangeOp(
609 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(), 611 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(),
610 ConvertReceiverMode::kAny, 612 ConvertReceiverMode::kAny,
613 TailCallMode::kDisallow));
614 return Changed(node);
615 }
616
617
618 Reduction JSIntrinsicLowering::ReduceTailCall(Node* node) {
619 size_t const arity = CallRuntimeParametersOf(node->op()).arity();
620 NodeProperties::ChangeOp(
621 node, javascript()->CallFunction(arity, STRICT, VectorSlotPair(),
622 ConvertReceiverMode::kAny,
611 TailCallMode::kAllow)); 623 TailCallMode::kAllow));
612 return Changed(node); 624 return Changed(node);
613 } 625 }
614 626
615 627
616 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, 628 Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
617 Node* b) { 629 Node* b) {
618 RelaxControls(node); 630 RelaxControls(node);
619 node->ReplaceInput(0, a); 631 node->ReplaceInput(0, a);
620 node->ReplaceInput(1, b); 632 node->ReplaceInput(1, b);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 687 }
676 688
677 689
678 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const { 690 SimplifiedOperatorBuilder* JSIntrinsicLowering::simplified() const {
679 return jsgraph()->simplified(); 691 return jsgraph()->simplified();
680 } 692 }
681 693
682 } // namespace compiler 694 } // namespace compiler
683 } // namespace internal 695 } // namespace internal
684 } // namespace v8 696 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698