OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |