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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); | 413 STATIC_ASSERT(2 == Linkage::kInterpreterBytecodeOffsetParameter); |
414 types.AddParam(kMachIntPtr); | 414 types.AddParam(kMachIntPtr); |
415 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister)); | 415 locations.AddParam(regloc(kInterpreterBytecodeOffsetRegister)); |
416 | 416 |
417 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); | 417 STATIC_ASSERT(3 == Linkage::kInterpreterBytecodeArrayParameter); |
418 types.AddParam(kMachAnyTagged); | 418 types.AddParam(kMachAnyTagged); |
419 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister)); | 419 locations.AddParam(regloc(kInterpreterBytecodeArrayRegister)); |
420 | 420 |
421 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); | 421 STATIC_ASSERT(4 == Linkage::kInterpreterDispatchTableParameter); |
422 types.AddParam(kMachPtr); | 422 types.AddParam(kMachPtr); |
| 423 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87) |
| 424 // TODO(rmcilroy): Make the context param the one spilled to the stack once |
| 425 // Turbofan supports modified stack arguments in tail calls. |
| 426 locations.AddParam( |
| 427 LinkageLocation::ForCallerFrameSlot(kInterpreterDispatchTableSpillSlot)); |
| 428 #else |
423 locations.AddParam(regloc(kInterpreterDispatchTableRegister)); | 429 locations.AddParam(regloc(kInterpreterDispatchTableRegister)); |
| 430 #endif |
424 | 431 |
425 STATIC_ASSERT(5 == Linkage::kInterpreterContextParameter); | 432 STATIC_ASSERT(5 == Linkage::kInterpreterContextParameter); |
426 types.AddParam(kMachAnyTagged); | 433 types.AddParam(kMachAnyTagged); |
427 #if defined(V8_TARGET_ARCH_IA32) || defined(V8_TARGET_ARCH_X87) | |
428 locations.AddParam( | |
429 LinkageLocation::ForCallerFrameSlot(kInterpreterContextSpillSlot)); | |
430 #else | |
431 locations.AddParam(regloc(kContextRegister)); | 434 locations.AddParam(regloc(kContextRegister)); |
432 #endif | |
433 | 435 |
434 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); | 436 LinkageLocation target_loc = LinkageLocation::ForAnyRegister(); |
435 return new (zone) CallDescriptor( // -- | 437 return new (zone) CallDescriptor( // -- |
436 CallDescriptor::kCallCodeObject, // kind | 438 CallDescriptor::kCallCodeObject, // kind |
437 kMachNone, // target MachineType | 439 kMachNone, // target MachineType |
438 target_loc, // target location | 440 target_loc, // target location |
439 types.Build(), // machine_sig | 441 types.Build(), // machine_sig |
440 locations.Build(), // location_sig | 442 locations.Build(), // location_sig |
441 0, // stack_parameter_count | 443 0, // stack_parameter_count |
442 Operator::kNoProperties, // properties | 444 Operator::kNoProperties, // properties |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 527 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
526 } else { | 528 } else { |
527 // Parameter. Use the assigned location from the incoming call descriptor. | 529 // Parameter. Use the assigned location from the incoming call descriptor. |
528 int parameter_index = 1 + index; // skip index 0, which is the target. | 530 int parameter_index = 1 + index; // skip index 0, which is the target. |
529 return incoming_->GetInputLocation(parameter_index); | 531 return incoming_->GetInputLocation(parameter_index); |
530 } | 532 } |
531 } | 533 } |
532 } // namespace compiler | 534 } // namespace compiler |
533 } // namespace internal | 535 } // namespace internal |
534 } // namespace v8 | 536 } // namespace v8 |
OLD | NEW |