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

Side by Side Diff: src/compiler/instruction-selector-impl.h

Issue 1455833004: [turbofan]: Implement tail calls with more callee than caller parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improve comment Created 5 years, 1 month 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/instruction-selector.cc ('k') | src/compiler/linkage.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 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/compiler/instruction-selector.h" 9 #include "src/compiler/instruction-selector.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return Use(node, UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, 121 return Use(node, UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
122 reg.code(), GetVReg(node))); 122 reg.code(), GetVReg(node)));
123 } 123 }
124 124
125 InstructionOperand UseFixed(Node* node, DoubleRegister reg) { 125 InstructionOperand UseFixed(Node* node, DoubleRegister reg) {
126 return Use(node, 126 return Use(node,
127 UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER, 127 UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER,
128 reg.code(), GetVReg(node))); 128 reg.code(), GetVReg(node)));
129 } 129 }
130 130
131 InstructionOperand UseExplicit(Register reg) { 131 InstructionOperand UseExplicit(LinkageLocation location) {
132 MachineType machine_type = InstructionSequence::DefaultRepresentation(); 132 MachineType machine_type = InstructionSequence::DefaultRepresentation();
133 return ExplicitOperand(LocationOperand::REGISTER, machine_type, reg.code()); 133 if (location.IsRegister()) {
134 return ExplicitOperand(LocationOperand::REGISTER, machine_type,
135 location.AsRegister());
136 } else {
137 return ExplicitOperand(LocationOperand::STACK_SLOT, machine_type,
138 location.GetLocation());
139 }
134 } 140 }
135 141
136 InstructionOperand UseImmediate(Node* node) { 142 InstructionOperand UseImmediate(Node* node) {
137 return sequence()->AddImmediate(ToConstant(node)); 143 return sequence()->AddImmediate(ToConstant(node));
138 } 144 }
139 145
140 InstructionOperand UseLocation(Node* node, LinkageLocation location, 146 InstructionOperand UseLocation(Node* node, LinkageLocation location,
141 MachineType type) { 147 MachineType type) {
142 return Use(node, ToUnallocatedOperand(location, type, GetVReg(node))); 148 return Use(node, ToUnallocatedOperand(location, type, GetVReg(node)));
143 } 149 }
144 150
151 // Used to force gap moves from the from_location to the to_location
152 // immediately before an instruction.
153 InstructionOperand UsePointerLocation(LinkageLocation to_location,
154 LinkageLocation from_location) {
155 MachineType type = static_cast<MachineType>(kTypeAny | kMachPtr);
156 UnallocatedOperand casted_from_operand =
157 UnallocatedOperand::cast(TempLocation(from_location, type));
158 selector_->Emit(kArchNop, casted_from_operand);
159 return ToUnallocatedOperand(to_location, type,
160 casted_from_operand.virtual_register());
161 }
162
145 InstructionOperand TempRegister() { 163 InstructionOperand TempRegister() {
146 return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER, 164 return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
147 UnallocatedOperand::USED_AT_START, 165 UnallocatedOperand::USED_AT_START,
148 sequence()->NextVirtualRegister()); 166 sequence()->NextVirtualRegister());
149 } 167 }
150 168
151 InstructionOperand TempDoubleRegister() { 169 InstructionOperand TempDoubleRegister() {
152 UnallocatedOperand op = UnallocatedOperand( 170 UnallocatedOperand op = UnallocatedOperand(
153 UnallocatedOperand::MUST_HAVE_REGISTER, 171 UnallocatedOperand::MUST_HAVE_REGISTER,
154 UnallocatedOperand::USED_AT_START, sequence()->NextVirtualRegister()); 172 UnallocatedOperand::USED_AT_START, sequence()->NextVirtualRegister());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 Node* result_; // Only valid if mode_ == kFlags_set. 359 Node* result_; // Only valid if mode_ == kFlags_set.
342 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch. 360 BasicBlock* true_block_; // Only valid if mode_ == kFlags_branch.
343 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch. 361 BasicBlock* false_block_; // Only valid if mode_ == kFlags_branch.
344 }; 362 };
345 363
346 } // namespace compiler 364 } // namespace compiler
347 } // namespace internal 365 } // namespace internal
348 } // namespace v8 366 } // namespace v8
349 367
350 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_ 368 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698