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

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

Issue 2561103003: [Turbofan] Add CallConstructWithSpread JSOperator. (Closed)
Patch Set: Add line spaces back that auto-format zapped Created 4 years 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/bytecode-graph-builder.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/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 Node* new_target = node->InputAt(arg_count + 1); 467 Node* new_target = node->InputAt(arg_count + 1);
468 Node* receiver = jsgraph()->UndefinedConstant(); 468 Node* receiver = jsgraph()->UndefinedConstant();
469 node->RemoveInput(arg_count + 1); // Drop new target. 469 node->RemoveInput(arg_count + 1); // Drop new target.
470 node->InsertInput(zone(), 0, stub_code); 470 node->InsertInput(zone(), 0, stub_code);
471 node->InsertInput(zone(), 2, new_target); 471 node->InsertInput(zone(), 2, new_target);
472 node->InsertInput(zone(), 3, stub_arity); 472 node->InsertInput(zone(), 3, stub_arity);
473 node->InsertInput(zone(), 4, receiver); 473 node->InsertInput(zone(), 4, receiver);
474 NodeProperties::ChangeOp(node, common()->Call(desc)); 474 NodeProperties::ChangeOp(node, common()->Call(desc));
475 } 475 }
476 476
477 void JSGenericLowering::LowerJSCallConstructWithSpread(Node* node) {
478 CallConstructWithSpreadParameters const& p =
479 CallConstructWithSpreadParametersOf(node->op());
480 ReplaceWithRuntimeCall(node, Runtime::kNewWithSpread,
481 static_cast<int>(p.arity()));
482 }
477 483
478 void JSGenericLowering::LowerJSCallFunction(Node* node) { 484 void JSGenericLowering::LowerJSCallFunction(Node* node) {
479 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); 485 CallFunctionParameters const& p = CallFunctionParametersOf(node->op());
480 int const arg_count = static_cast<int>(p.arity() - 2); 486 int const arg_count = static_cast<int>(p.arity() - 2);
481 ConvertReceiverMode const mode = p.convert_mode(); 487 ConvertReceiverMode const mode = p.convert_mode();
482 Callable callable = CodeFactory::Call(isolate(), mode); 488 Callable callable = CodeFactory::Call(isolate(), mode);
483 CallDescriptor::Flags flags = FrameStateFlagForCall(node); 489 CallDescriptor::Flags flags = FrameStateFlagForCall(node);
484 if (p.tail_call_mode() == TailCallMode::kAllow) { 490 if (p.tail_call_mode() == TailCallMode::kAllow) {
485 flags |= CallDescriptor::kSupportsTailCalls; 491 flags |= CallDescriptor::kSupportsTailCalls;
486 } 492 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 } 616 }
611 617
612 618
613 MachineOperatorBuilder* JSGenericLowering::machine() const { 619 MachineOperatorBuilder* JSGenericLowering::machine() const {
614 return jsgraph()->machine(); 620 return jsgraph()->machine();
615 } 621 }
616 622
617 } // namespace compiler 623 } // namespace compiler
618 } // namespace internal 624 } // namespace internal
619 } // namespace v8 625 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698