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

Side by Side Diff: src/compiler/arm/instruction-selector-arm.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
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/base/bits.h" 5 #include "src/base/bits.h"
6 #include "src/compiler/instruction-selector-impl.h" 6 #include "src/compiler/instruction-selector-impl.h"
7 #include "src/compiler/node-matchers.h" 7 #include "src/compiler/node-matchers.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 case kArmLdr: 67 case kArmLdr:
68 case kArmStr: 68 case kArmStr:
69 case kArmStoreWriteBarrier: 69 case kArmStoreWriteBarrier:
70 return value >= -4095 && value <= 4095; 70 return value >= -4095 && value <= 4095;
71 71
72 case kArmLdrh: 72 case kArmLdrh:
73 case kArmLdrsh: 73 case kArmLdrsh:
74 case kArmStrh: 74 case kArmStrh:
75 return value >= -255 && value <= 255; 75 return value >= -255 && value <= 255;
76 76
77 case kArchCallAddress:
78 case kArchCallCodeObject:
79 case kArchCallJSFunction:
80 case kArchDeoptimize:
81 case kArchDrop:
77 case kArchJmp: 82 case kArchJmp:
78 case kArchNop: 83 case kArchNop:
79 case kArchRet: 84 case kArchRet:
80 case kArchDeoptimize:
81 case kArchTruncateDoubleToI: 85 case kArchTruncateDoubleToI:
82 case kArmMul: 86 case kArmMul:
83 case kArmMla: 87 case kArmMla:
84 case kArmMls: 88 case kArmMls:
85 case kArmSdiv: 89 case kArmSdiv:
86 case kArmUdiv: 90 case kArmUdiv:
87 case kArmBfc: 91 case kArmBfc:
88 case kArmUbfx: 92 case kArmUbfx:
89 case kArmCallCodeObject:
90 case kArmCallJSFunction:
91 case kArmCallAddress:
92 case kArmPush:
93 case kArmDrop:
94 case kArmVcmpF64: 93 case kArmVcmpF64:
95 case kArmVaddF64: 94 case kArmVaddF64:
96 case kArmVsubF64: 95 case kArmVsubF64:
97 case kArmVmulF64: 96 case kArmVmulF64:
98 case kArmVmlaF64: 97 case kArmVmlaF64:
99 case kArmVmlsF64: 98 case kArmVmlsF64:
100 case kArmVdivF64: 99 case kArmVdivF64:
101 case kArmVmodF64: 100 case kArmVmodF64:
102 case kArmVnegF64: 101 case kArmVnegF64:
103 case kArmVcvtF64S32: 102 case kArmVcvtF64S32:
104 case kArmVcvtF64U32: 103 case kArmVcvtF64U32:
105 case kArmVcvtS32F64: 104 case kArmVcvtS32F64:
106 case kArmVcvtU32F64: 105 case kArmVcvtU32F64:
106 case kArmPush:
107 return false; 107 return false;
108 } 108 }
109 UNREACHABLE(); 109 UNREACHABLE();
110 return false; 110 return false;
111 } 111 }
112 112
113 private: 113 private:
114 bool ImmediateFitsAddrMode1Instruction(int32_t imm) const { 114 bool ImmediateFitsAddrMode1Instruction(int32_t imm) const {
115 return Assembler::ImmediateFitsAddrMode1Instruction(imm); 115 return Assembler::ImmediateFitsAddrMode1Instruction(imm);
116 } 116 }
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 // Push any stack arguments. 801 // Push any stack arguments.
802 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin(); 802 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin();
803 input != buffer.pushed_nodes.rend(); input++) { 803 input != buffer.pushed_nodes.rend(); input++) {
804 Emit(kArmPush, NULL, g.UseRegister(*input)); 804 Emit(kArmPush, NULL, g.UseRegister(*input));
805 } 805 }
806 806
807 // Select the appropriate opcode based on the call type. 807 // Select the appropriate opcode based on the call type.
808 InstructionCode opcode; 808 InstructionCode opcode;
809 switch (descriptor->kind()) { 809 switch (descriptor->kind()) {
810 case CallDescriptor::kCallCodeObject: { 810 case CallDescriptor::kCallCodeObject: {
811 opcode = kArmCallCodeObject; 811 opcode = kArchCallCodeObject;
812 break; 812 break;
813 } 813 }
814 case CallDescriptor::kCallAddress: 814 case CallDescriptor::kCallAddress:
815 opcode = kArmCallAddress; 815 opcode = kArchCallAddress;
816 break; 816 break;
817 case CallDescriptor::kCallJSFunction: 817 case CallDescriptor::kCallJSFunction:
818 opcode = kArmCallJSFunction; 818 opcode = kArchCallJSFunction;
819 break; 819 break;
820 default: 820 default:
821 UNREACHABLE(); 821 UNREACHABLE();
822 return; 822 return;
823 } 823 }
824 opcode |= MiscField::encode(descriptor->deoptimization_support()); 824 opcode |= MiscField::encode(descriptor->deoptimization_support());
825 825
826 // Emit the call instruction. 826 // Emit the call instruction.
827 Instruction* call_instr = 827 Instruction* call_instr =
828 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(), 828 Emit(opcode, buffer.outputs.size(), &buffer.outputs.front(),
829 buffer.instruction_args.size(), &buffer.instruction_args.front()); 829 buffer.instruction_args.size(), &buffer.instruction_args.front());
830 830
831 call_instr->MarkAsCall(); 831 call_instr->MarkAsCall();
832 if (deoptimization != NULL) { 832 if (deoptimization != NULL) {
833 DCHECK(continuation != NULL); 833 DCHECK(continuation != NULL);
834 call_instr->MarkAsControl(); 834 call_instr->MarkAsControl();
835 } 835 }
836 836
837 // Caller clean up of stack for C-style calls. 837 // Caller clean up of stack for C-style calls.
838 if (descriptor->kind() == CallDescriptor::kCallAddress && 838 if (descriptor->kind() == CallDescriptor::kCallAddress &&
839 !buffer.pushed_nodes.empty()) { 839 !buffer.pushed_nodes.empty()) {
840 DCHECK(deoptimization == NULL && continuation == NULL); 840 DCHECK(deoptimization == NULL && continuation == NULL);
841 Emit(kArmDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL); 841 Emit(kArchDrop | MiscField::encode(buffer.pushed_nodes.size()), NULL);
842 } 842 }
843 } 843 }
844 844
845 845
846 void InstructionSelector::VisitInt32AddWithOverflow(Node* node, 846 void InstructionSelector::VisitInt32AddWithOverflow(Node* node,
847 FlagsContinuation* cont) { 847 FlagsContinuation* cont) {
848 VisitBinop(this, node, kArmAdd, kArmAdd, cont); 848 VisitBinop(this, node, kArmAdd, kArmAdd, cont);
849 } 849 }
850 850
851 851
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 } else { 954 } else {
955 DCHECK(cont->IsSet()); 955 DCHECK(cont->IsSet());
956 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), 956 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()),
957 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); 957 g.UseRegister(m.left().node()), g.UseRegister(m.right().node()));
958 } 958 }
959 } 959 }
960 960
961 } // namespace compiler 961 } // namespace compiler
962 } // namespace internal 962 } // namespace internal
963 } // namespace v8 963 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698