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

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

Issue 2950773002: [turbofan] Introduce new JSCallWithArrayLike operator. (Closed)
Patch Set: REBASE Created 3 years, 6 months 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
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-generic-lowering.h" 5 #include "src/compiler/js-generic-lowering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/builtins/builtins-constructor.h" 8 #include "src/builtins/builtins-constructor.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 } 645 }
646 CallDescriptor* desc = Linkage::GetStubCallDescriptor( 646 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
647 isolate(), zone(), callable.descriptor(), arg_count + 1, flags); 647 isolate(), zone(), callable.descriptor(), arg_count + 1, flags);
648 Node* stub_code = jsgraph()->HeapConstant(callable.code()); 648 Node* stub_code = jsgraph()->HeapConstant(callable.code());
649 Node* stub_arity = jsgraph()->Int32Constant(arg_count); 649 Node* stub_arity = jsgraph()->Int32Constant(arg_count);
650 node->InsertInput(zone(), 0, stub_code); 650 node->InsertInput(zone(), 0, stub_code);
651 node->InsertInput(zone(), 2, stub_arity); 651 node->InsertInput(zone(), 2, stub_arity);
652 NodeProperties::ChangeOp(node, common()->Call(desc)); 652 NodeProperties::ChangeOp(node, common()->Call(desc));
653 } 653 }
654 654
655 void JSGenericLowering::LowerJSCallWithArrayLike(Node* node) {
656 Callable callable = CodeFactory::CallWithArrayLike(isolate());
657 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
658 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
659 isolate(), zone(), callable.descriptor(), 1, flags);
660 Node* stub_code = jsgraph()->HeapConstant(callable.code());
661 Node* receiver = node->InputAt(1);
662 Node* arguments_list = node->InputAt(2);
663 node->InsertInput(zone(), 0, stub_code);
664 node->ReplaceInput(3, receiver);
665 node->ReplaceInput(2, arguments_list);
666 NodeProperties::ChangeOp(node, common()->Call(desc));
667 }
668
655 void JSGenericLowering::LowerJSCallWithSpread(Node* node) { 669 void JSGenericLowering::LowerJSCallWithSpread(Node* node) {
656 SpreadWithArityParameter const& p = SpreadWithArityParameterOf(node->op()); 670 SpreadWithArityParameter const& p = SpreadWithArityParameterOf(node->op());
657 int const arg_count = static_cast<int>(p.arity() - 2); 671 int const arg_count = static_cast<int>(p.arity() - 2);
658 int const spread_index = static_cast<int>(p.arity() + 1); 672 int const spread_index = static_cast<int>(p.arity() + 1);
659 CallDescriptor::Flags flags = FrameStateFlagForCall(node); 673 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
660 Callable callable = CodeFactory::CallWithSpread(isolate()); 674 Callable callable = CodeFactory::CallWithSpread(isolate());
661 CallDescriptor* desc = Linkage::GetStubCallDescriptor( 675 CallDescriptor* desc = Linkage::GetStubCallDescriptor(
662 isolate(), zone(), callable.descriptor(), arg_count, flags); 676 isolate(), zone(), callable.descriptor(), arg_count, flags);
663 Node* stub_code = jsgraph()->HeapConstant(callable.code()); 677 Node* stub_code = jsgraph()->HeapConstant(callable.code());
664 // We pass the spread in a register, not on the stack. 678 // We pass the spread in a register, not on the stack.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 } 804 }
791 805
792 806
793 MachineOperatorBuilder* JSGenericLowering::machine() const { 807 MachineOperatorBuilder* JSGenericLowering::machine() const {
794 return jsgraph()->machine(); 808 return jsgraph()->machine();
795 } 809 }
796 810
797 } // namespace compiler 811 } // namespace compiler
798 } // namespace internal 812 } // namespace internal
799 } // namespace v8 813 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-call-reducer.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698