| OLD | NEW |
| 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_LINKAGE_IMPL_H_ | 5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ |
| 6 #define V8_COMPILER_LINKAGE_IMPL_H_ | 6 #define V8_COMPILER_LINKAGE_IMPL_H_ |
| 7 | 7 |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler/osr.h" | 9 #include "src/compiler/osr.h" |
| 10 | 10 |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (i < LinkageTraits::CRegisterParametersLength()) { | 208 if (i < LinkageTraits::CRegisterParametersLength()) { |
| 209 locations.AddParam(regloc(LinkageTraits::CRegisterParameter(i))); | 209 locations.AddParam(regloc(LinkageTraits::CRegisterParameter(i))); |
| 210 } else { | 210 } else { |
| 211 locations.AddParam(stackloc(-1 - i)); | 211 locations.AddParam(stackloc(-1 - i)); |
| 212 } | 212 } |
| 213 } | 213 } |
| 214 | 214 |
| 215 // The target for C calls is always an address (i.e. machine pointer). | 215 // The target for C calls is always an address (i.e. machine pointer). |
| 216 MachineType target_type = kMachPtr; | 216 MachineType target_type = kMachPtr; |
| 217 LinkageLocation target_loc = LinkageLocation::AnyRegister(); | 217 LinkageLocation target_loc = LinkageLocation::AnyRegister(); |
| 218 return new (zone) CallDescriptor( // -- | 218 return new (zone) CallDescriptor( // -- |
| 219 CallDescriptor::kCallAddress, // kind | 219 CallDescriptor::kCallAddress, // kind |
| 220 target_type, // target MachineType | 220 target_type, // target MachineType |
| 221 target_loc, // target location | 221 target_loc, // target location |
| 222 msig, // machine_sig | 222 msig, // machine_sig |
| 223 locations.Build(), // location_sig | 223 locations.Build(), // location_sig |
| 224 0, // js_parameter_count | 224 0, // js_parameter_count |
| 225 Operator::kNoProperties, // properties | 225 Operator::kNoProperties, // properties |
| 226 LinkageTraits::CCalleeSaveRegisters(), CallDescriptor::kNoFlags, | 226 LinkageTraits::CCalleeSaveRegisters(), // callee-saved registers |
| 227 CallDescriptor::kNoFlags, // flags |
| 227 "c-call"); | 228 "c-call"); |
| 228 } | 229 } |
| 229 | 230 |
| 230 static LinkageLocation regloc(Register reg) { | 231 static LinkageLocation regloc(Register reg) { |
| 231 return LinkageLocation(Register::ToAllocationIndex(reg)); | 232 return LinkageLocation(Register::ToAllocationIndex(reg)); |
| 232 } | 233 } |
| 233 | 234 |
| 234 static LinkageLocation stackloc(int i) { | 235 static LinkageLocation stackloc(int i) { |
| 235 DCHECK_LT(i, 0); | 236 DCHECK_LT(i, 0); |
| 236 return LinkageLocation(i); | 237 return LinkageLocation(i); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 int parameter_index = 1 + index; // skip index 0, which is the target. | 284 int parameter_index = 1 + index; // skip index 0, which is the target. |
| 284 return incoming_->GetInputLocation(parameter_index); | 285 return incoming_->GetInputLocation(parameter_index); |
| 285 } | 286 } |
| 286 } | 287 } |
| 287 | 288 |
| 288 } // namespace compiler | 289 } // namespace compiler |
| 289 } // namespace internal | 290 } // namespace internal |
| 290 } // namespace v8 | 291 } // namespace v8 |
| 291 | 292 |
| 292 #endif // V8_COMPILER_LINKAGE_IMPL_H_ | 293 #endif // V8_COMPILER_LINKAGE_IMPL_H_ |
| OLD | NEW |