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

Side by Side Diff: src/compiler/wasm-linkage.cc

Issue 2086653003: [Turbofan] Add the concept of aliasing to RegisterConfiguration. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/assembler.h" 5 #include "src/assembler.h"
6 #include "src/macro-assembler.h" 6 #include "src/macro-assembler.h"
7 #include "src/register-configuration.h"
7 8
8 #include "src/wasm/wasm-module.h" 9 #include "src/wasm/wasm-module.h"
9 10
10 #include "src/compiler/linkage.h" 11 #include "src/compiler/linkage.h"
11 12
12 #include "src/zone.h" 13 #include "src/zone.h"
13 14
14 namespace v8 { 15 namespace v8 {
15 namespace internal { 16 namespace internal {
16 // TODO(titzer): this should not be in the WASM namespace. 17 // TODO(titzer): this should not be in the WASM namespace.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 int fp_count; 172 int fp_count;
172 int fp_offset; 173 int fp_offset;
173 const DoubleRegister* fp_regs; 174 const DoubleRegister* fp_regs;
174 175
175 int stack_offset; 176 int stack_offset;
176 177
177 LinkageLocation Next(LocalType type) { 178 LinkageLocation Next(LocalType type) {
178 if (IsFloatingPoint(type)) { 179 if (IsFloatingPoint(type)) {
179 // Allocate a floating point register/stack location. 180 // Allocate a floating point register/stack location.
180 if (fp_offset < fp_count) { 181 if (fp_offset < fp_count) {
181 return regloc(fp_regs[fp_offset++]); 182 DoubleRegister reg = fp_regs[fp_offset++];
183 #if V8_TARGET_ARCH_ARM
184 // Allocate floats using a double register, but modify the code to
185 // reflect how ARM FP registers alias.
186 // TODO(bbudge) Modify wasm linkage to allow use of all float regs.
187 if (type == kAstF32) {
188 int float_reg_code = reg.code() * 2;
189 DCHECK(float_reg_code < RegisterConfiguration::kMaxFPRegisters);
190 return regloc(DoubleRegister::from_code(float_reg_code));
191 }
192 #endif
193 return regloc(reg);
182 } else { 194 } else {
183 int offset = -1 - stack_offset; 195 int offset = -1 - stack_offset;
184 stack_offset += Words(type); 196 stack_offset += Words(type);
185 return stackloc(offset); 197 return stackloc(offset);
186 } 198 }
187 } else { 199 } else {
188 // Allocate a general purpose register/stack location. 200 // Allocate a general purpose register/stack location.
189 if (gp_offset < gp_count) { 201 if (gp_offset < gp_count) {
190 return regloc(gp_regs[gp_offset++]); 202 return regloc(gp_regs[gp_offset++]);
191 } else { 203 } else {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs 387 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs
376 descriptor->flags(), // flags 388 descriptor->flags(), // flags
377 descriptor->debug_name()); 389 descriptor->debug_name());
378 390
379 return descriptor; 391 return descriptor;
380 } 392 }
381 393
382 } // namespace wasm 394 } // namespace wasm
383 } // namespace internal 395 } // namespace internal
384 } // namespace v8 396 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698