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 | 7 |
8 #include "src/wasm/wasm-module.h" | 8 #include "src/wasm/wasm-module.h" |
9 | 9 |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 int offset = -1 - stack_offset; | 192 int offset = -1 - stack_offset; |
193 stack_offset += Words(type); | 193 stack_offset += Words(type); |
194 return stackloc(offset); | 194 return stackloc(offset); |
195 } | 195 } |
196 } | 196 } |
197 } | 197 } |
198 bool IsFloatingPoint(LocalType type) { | 198 bool IsFloatingPoint(LocalType type) { |
199 return type == kAstF32 || type == kAstF64; | 199 return type == kAstF32 || type == kAstF64; |
200 } | 200 } |
201 int Words(LocalType type) { | 201 int Words(LocalType type) { |
202 // The code generation for pushing parameters on the stack does not | 202 if (kPointerSize < 8 && (type == kAstI64 || type == kAstF64)) { |
203 // distinguish between float32 and float64. Therefore also float32 needs | |
204 // two words. | |
205 if (kPointerSize < 8 && | |
206 (type == kAstI64 || type == kAstF64 || type == kAstF32)) { | |
207 return 2; | 203 return 2; |
208 } | 204 } |
209 return 1; | 205 return 1; |
210 } | 206 } |
211 }; | 207 }; |
212 } // namespace | 208 } // namespace |
213 | 209 |
214 static Allocator GetReturnRegisters() { | 210 static Allocator GetReturnRegisters() { |
215 #ifdef GP_RETURN_REGISTERS | 211 #ifdef GP_RETURN_REGISTERS |
216 static const Register kGPReturnRegisters[] = {GP_RETURN_REGISTERS}; | 212 static const Register kGPReturnRegisters[] = {GP_RETURN_REGISTERS}; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs | 375 descriptor->CalleeSavedFPRegisters(), // callee-saved fp regs |
380 descriptor->flags(), // flags | 376 descriptor->flags(), // flags |
381 descriptor->debug_name()); | 377 descriptor->debug_name()); |
382 | 378 |
383 return descriptor; | 379 return descriptor; |
384 } | 380 } |
385 | 381 |
386 } // namespace wasm | 382 } // namespace wasm |
387 } // namespace internal | 383 } // namespace internal |
388 } // namespace v8 | 384 } // namespace v8 |
OLD | NEW |