| 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 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/frame.h" | 8 #include "src/compiler/frame.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 276 } |
| 277 for (size_t i = 0; i < ReturnCount(); ++i) { | 277 for (size_t i = 0; i < ReturnCount(); ++i) { |
| 278 if (!GetReturnLocation(i).IsRegister()) return false; | 278 if (!GetReturnLocation(i).IsRegister()) return false; |
| 279 } | 279 } |
| 280 return true; | 280 return true; |
| 281 } | 281 } |
| 282 | 282 |
| 283 | 283 |
| 284 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | 284 CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| 285 Zone* zone, Runtime::FunctionId function_id, int js_parameter_count, | 285 Zone* zone, Runtime::FunctionId function_id, int js_parameter_count, |
| 286 Operator::Properties properties) { | 286 Operator::Properties properties, bool needs_frame_state) { |
| 287 const size_t function_count = 1; | 287 const size_t function_count = 1; |
| 288 const size_t num_args_count = 1; | 288 const size_t num_args_count = 1; |
| 289 const size_t context_count = 1; | 289 const size_t context_count = 1; |
| 290 const size_t parameter_count = function_count + | 290 const size_t parameter_count = function_count + |
| 291 static_cast<size_t>(js_parameter_count) + | 291 static_cast<size_t>(js_parameter_count) + |
| 292 num_args_count + context_count; | 292 num_args_count + context_count; |
| 293 | 293 |
| 294 const Runtime::Function* function = Runtime::FunctionForId(function_id); | 294 const Runtime::Function* function = Runtime::FunctionForId(function_id); |
| 295 const size_t return_count = static_cast<size_t>(function->result_size); | 295 const size_t return_count = static_cast<size_t>(function->result_size); |
| 296 | 296 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 319 types.AddParam(kMachAnyTagged); | 319 types.AddParam(kMachAnyTagged); |
| 320 | 320 |
| 321 // Add runtime call argument count. | 321 // Add runtime call argument count. |
| 322 locations.AddParam(regloc(kRuntimeCallArgCountRegister)); | 322 locations.AddParam(regloc(kRuntimeCallArgCountRegister)); |
| 323 types.AddParam(kMachPtr); | 323 types.AddParam(kMachPtr); |
| 324 | 324 |
| 325 // Add context. | 325 // Add context. |
| 326 locations.AddParam(regloc(kContextRegister)); | 326 locations.AddParam(regloc(kContextRegister)); |
| 327 types.AddParam(kMachAnyTagged); | 327 types.AddParam(kMachAnyTagged); |
| 328 | 328 |
| 329 CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0 | 329 CallDescriptor::Flags flags = |
| 330 ? CallDescriptor::kNeedsFrameState | 330 needs_frame_state && (Linkage::FrameStateInputCount(function_id) > 0) |
| 331 : CallDescriptor::kNoFlags; | 331 ? CallDescriptor::kNeedsFrameState |
| 332 : CallDescriptor::kNoFlags; |
| 332 | 333 |
| 333 // The target for runtime calls is a code object. | 334 // The target for runtime calls is a code object. |
| 334 MachineType target_type = kMachAnyTagged; | 335 MachineType target_type = kMachAnyTagged; |
| 335 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); | 336 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); |
| 336 return new (zone) CallDescriptor( // -- | 337 return new (zone) CallDescriptor( // -- |
| 337 CallDescriptor::kCallCodeObject, // kind | 338 CallDescriptor::kCallCodeObject, // kind |
| 338 target_type, // target MachineType | 339 target_type, // target MachineType |
| 339 target_loc, // target location | 340 target_loc, // target location |
| 340 types.Build(), // machine_sig | 341 types.Build(), // machine_sig |
| 341 locations.Build(), // location_sig | 342 locations.Build(), // location_sig |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 523 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
| 523 } else { | 524 } else { |
| 524 // Parameter. Use the assigned location from the incoming call descriptor. | 525 // Parameter. Use the assigned location from the incoming call descriptor. |
| 525 int parameter_index = 1 + index; // skip index 0, which is the target. | 526 int parameter_index = 1 + index; // skip index 0, which is the target. |
| 526 return incoming_->GetInputLocation(parameter_index); | 527 return incoming_->GetInputLocation(parameter_index); |
| 527 } | 528 } |
| 528 } | 529 } |
| 529 } // namespace compiler | 530 } // namespace compiler |
| 530 } // namespace internal | 531 } // namespace internal |
| 531 } // namespace v8 | 532 } // namespace v8 |
| OLD | NEW |