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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 508863002: [turbofan] Refactor code generation for calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('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/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 void InstructionSelector::VisitFloat64Compare(Node* node, 574 void InstructionSelector::VisitFloat64Compare(Node* node,
575 FlagsContinuation* cont) { 575 FlagsContinuation* cont) {
576 Arm64OperandGenerator g(this); 576 Arm64OperandGenerator g(this);
577 Node* left = node->InputAt(0); 577 Node* left = node->InputAt(0);
578 Node* right = node->InputAt(1); 578 Node* right = node->InputAt(1);
579 VisitCompare(this, kArm64Float64Cmp, g.UseRegister(left), 579 VisitCompare(this, kArm64Float64Cmp, g.UseRegister(left),
580 g.UseRegister(right), cont); 580 g.UseRegister(right), cont);
581 } 581 }
582 582
583 583
584 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, 584 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation,
Jarin 2014/08/27 06:13:34 Could not we move VisitCall to the platform indepe
Benedikt Meurer 2014/08/27 06:24:46 Yep, that's the idea -> follow up CL
585 BasicBlock* deoptimization) { 585 BasicBlock* deoptimization) {
586 Arm64OperandGenerator g(this); 586 Arm64OperandGenerator g(this);
587 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(call); 587 CallDescriptor* descriptor = OpParameter<CallDescriptor*>(call);
588 588
589 FrameStateDescriptor* frame_state_descriptor = NULL; 589 FrameStateDescriptor* frame_state_descriptor = NULL;
590 if (descriptor->NeedsFrameState()) { 590 if (descriptor->NeedsFrameState()) {
591 frame_state_descriptor = 591 frame_state_descriptor =
592 GetFrameStateDescriptor(call->InputAt(descriptor->InputCount())); 592 GetFrameStateDescriptor(call->InputAt(descriptor->InputCount()));
593 } 593 }
594 594
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 Emit(kArm64PokePair | MiscField::encode(slot), NULL, 631 Emit(kArm64PokePair | MiscField::encode(slot), NULL,
632 g.UseRegister(buffer.pushed_nodes[slot]), 632 g.UseRegister(buffer.pushed_nodes[slot]),
633 g.UseRegister(buffer.pushed_nodes[slot - 1])); 633 g.UseRegister(buffer.pushed_nodes[slot - 1]));
634 } 634 }
635 } 635 }
636 636
637 // Select the appropriate opcode based on the call type. 637 // Select the appropriate opcode based on the call type.
638 InstructionCode opcode; 638 InstructionCode opcode;
639 switch (descriptor->kind()) { 639 switch (descriptor->kind()) {
640 case CallDescriptor::kCallCodeObject: { 640 case CallDescriptor::kCallCodeObject: {
641 opcode = kArm64CallCodeObject; 641 opcode = kArchCallCodeObject;
642 break; 642 break;
643 } 643 }
644 case CallDescriptor::kCallAddress: 644 case CallDescriptor::kCallAddress:
645 opcode = kArm64CallAddress; 645 opcode = kArchCallAddress;
646 break; 646 break;
647 case CallDescriptor::kCallJSFunction: 647 case CallDescriptor::kCallJSFunction:
648 opcode = kArm64CallJSFunction; 648 opcode = kArchCallJSFunction;
649 break; 649 break;
650 default: 650 default:
651 UNREACHABLE(); 651 UNREACHABLE();
652 return; 652 return;
653 } 653 }
654 opcode |= MiscField::encode(descriptor->deoptimization_support()); 654 opcode |= MiscField::encode(descriptor->deoptimization_support());
655 655
656 // Emit the call instruction. 656 // Emit the call instruction.
657 Instruction* call_instr = 657 Instruction* call_instr =
658 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(), 658 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(),
659 buffer.instruction_args.size(), &buffer.instruction_args.front()); 659 buffer.instruction_args.size(), &buffer.instruction_args.front());
660 660
661 call_instr->MarkAsCall(); 661 call_instr->MarkAsCall();
662 if (deoptimization != NULL) { 662 if (deoptimization != NULL) {
663 DCHECK(continuation != NULL); 663 DCHECK(continuation != NULL);
664 call_instr->MarkAsControl(); 664 call_instr->MarkAsControl();
665 } 665 }
666 666
667 // Caller clean up of stack for C-style calls. 667 // Caller clean up of stack for C-style calls.
668 if (is_c_frame && aligned_push_count > 0) { 668 if (is_c_frame && aligned_push_count > 0) {
669 DCHECK(deoptimization == NULL && continuation == NULL); 669 DCHECK(deoptimization == NULL && continuation == NULL);
670 Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL); 670 Emit(kArchDrop | MiscField::encode(aligned_push_count), NULL);
671 } 671 }
672 } 672 }
673 673
674 } // namespace compiler 674 } // namespace compiler
675 } // namespace internal 675 } // namespace internal
676 } // namespace v8 676 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698