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

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

Issue 1262343002: [turbofan]: Add better encapsulation to LinkageLocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Really fix it this time Created 5 years, 4 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
« no previous file with comments | « no previous file | src/compiler/instruction-selector-impl.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 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/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 9
10 #include "src/zone.h" 10 #include "src/zone.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 namespace { 16 namespace {
17 // Platform-specific configuration for C calling convention. 17 // Platform-specific configuration for C calling convention.
18 LinkageLocation regloc(Register reg) { 18 LinkageLocation regloc(Register reg) {
19 return LinkageLocation(Register::ToAllocationIndex(reg)); 19 return LinkageLocation::ForRegister(Register::ToAllocationIndex(reg));
20 } 20 }
21 21
22 22
23 LinkageLocation stackloc(int i) { 23 LinkageLocation stackloc(int i) {
24 DCHECK_LT(i, 0); 24 DCHECK_LT(i, 0);
25 return LinkageLocation(i); 25 return LinkageLocation::ForCallerFrameSlot(i);
26 } 26 }
27 27
28 28
29 #if V8_TARGET_ARCH_IA32 29 #if V8_TARGET_ARCH_IA32
30 // =========================================================================== 30 // ===========================================================================
31 // == ia32 =================================================================== 31 // == ia32 ===================================================================
32 // =========================================================================== 32 // ===========================================================================
33 #define RETURN_REGISTER_0 eax 33 #define RETURN_REGISTER_0 eax
34 #define RETURN_REGISTER_1 edx 34 #define RETURN_REGISTER_1 edx
35 #define CALLEE_SAVE_REGISTERS esi.bit() | edi.bit() | ebx.bit() 35 #define CALLEE_SAVE_REGISTERS esi.bit() | edi.bit() | ebx.bit()
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 #endif 219 #endif
220 220
221 #ifdef CALLEE_SAVE_FP_REGISTERS 221 #ifdef CALLEE_SAVE_FP_REGISTERS
222 const RegList kCalleeSaveFPRegisters = CALLEE_SAVE_FP_REGISTERS; 222 const RegList kCalleeSaveFPRegisters = CALLEE_SAVE_FP_REGISTERS;
223 #else 223 #else
224 const RegList kCalleeSaveFPRegisters = 0; 224 const RegList kCalleeSaveFPRegisters = 0;
225 #endif 225 #endif
226 226
227 // The target for C calls is always an address (i.e. machine pointer). 227 // The target for C calls is always an address (i.e. machine pointer).
228 MachineType target_type = kMachPtr; 228 MachineType target_type = kMachPtr;
229 LinkageLocation target_loc = LinkageLocation::AnyRegister(); 229 LinkageLocation target_loc = LinkageLocation::ForAnyRegister();
230 return new (zone) CallDescriptor( // -- 230 return new (zone) CallDescriptor( // --
231 CallDescriptor::kCallAddress, // kind 231 CallDescriptor::kCallAddress, // kind
232 target_type, // target MachineType 232 target_type, // target MachineType
233 target_loc, // target location 233 target_loc, // target location
234 msig, // machine_sig 234 msig, // machine_sig
235 locations.Build(), // location_sig 235 locations.Build(), // location_sig
236 0, // js_parameter_count 236 0, // js_parameter_count
237 Operator::kNoProperties, // properties 237 Operator::kNoProperties, // properties
238 kCalleeSaveRegisters, // callee-saved registers 238 kCalleeSaveRegisters, // callee-saved registers
239 kCalleeSaveFPRegisters, // callee-saved fp regs 239 kCalleeSaveFPRegisters, // callee-saved fp regs
240 CallDescriptor::kNoFlags, // flags 240 CallDescriptor::kNoFlags, // flags
241 "c-call"); 241 "c-call");
242 } 242 }
243 } 243 }
244 } 244 }
245 } 245 }
OLDNEW
« no previous file with comments | « no previous file | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698