OLD | NEW |
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 #include "src/register-configuration.h" |
8 | 8 |
9 #include "src/wasm/wasm-module.h" | 9 #include "src/wasm/wasm-module.h" |
10 | 10 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 int fp_offset; | 170 int fp_offset; |
171 const DoubleRegister* fp_regs; | 171 const DoubleRegister* fp_regs; |
172 | 172 |
173 int stack_offset; | 173 int stack_offset; |
174 | 174 |
175 LinkageLocation Next(LocalType type) { | 175 LinkageLocation Next(LocalType type) { |
176 if (IsFloatingPoint(type)) { | 176 if (IsFloatingPoint(type)) { |
177 // Allocate a floating point register/stack location. | 177 // Allocate a floating point register/stack location. |
178 if (fp_offset < fp_count) { | 178 if (fp_offset < fp_count) { |
179 DoubleRegister reg = fp_regs[fp_offset++]; | 179 DoubleRegister reg = fp_regs[fp_offset++]; |
180 #if V8_TARGET_ARCH_ARM | |
181 // Allocate floats using a double register, but modify the code to | |
182 // reflect how ARM FP registers alias. | |
183 // TODO(bbudge) Modify wasm linkage to allow use of all float regs. | |
184 if (type == kAstF32) { | |
185 int float_reg_code = reg.code() * 2; | |
186 DCHECK(float_reg_code < RegisterConfiguration::kMaxFPRegisters); | |
187 return regloc(DoubleRegister::from_code(float_reg_code), | |
188 MachineTypeFor(type)); | |
189 } | |
190 #endif | |
191 return regloc(reg, MachineTypeFor(type)); | 180 return regloc(reg, MachineTypeFor(type)); |
192 } else { | 181 } else { |
193 int offset = -1 - stack_offset; | 182 int offset = -1 - stack_offset; |
194 stack_offset += Words(type); | 183 stack_offset += Words(type); |
195 return stackloc(offset, MachineTypeFor(type)); | 184 return stackloc(offset, MachineTypeFor(type)); |
196 } | 185 } |
197 } else { | 186 } else { |
198 // Allocate a general purpose register/stack location. | 187 // Allocate a general purpose register/stack location. |
199 if (gp_offset < gp_count) { | 188 if (gp_offset < gp_count) { |
200 return regloc(gp_regs[gp_offset++], MachineTypeFor(type)); | 189 return regloc(gp_regs[gp_offset++], MachineTypeFor(type)); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs | 362 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs |
374 descriptor->flags(), // flags | 363 descriptor->flags(), // flags |
375 descriptor->debug_name()); | 364 descriptor->debug_name()); |
376 | 365 |
377 return descriptor; | 366 return descriptor; |
378 } | 367 } |
379 | 368 |
380 } // namespace wasm | 369 } // namespace wasm |
381 } // namespace internal | 370 } // namespace internal |
382 } // namespace v8 | 371 } // namespace v8 |
OLD | NEW |