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/base/bits.h" | 5 #include "src/base/bits.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 FrameStateDescriptor* frame_state_descriptor = NULL; | 439 FrameStateDescriptor* frame_state_descriptor = NULL; |
440 if (descriptor->NeedsFrameState()) { | 440 if (descriptor->NeedsFrameState()) { |
441 frame_state_descriptor = | 441 frame_state_descriptor = |
442 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); | 442 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); |
443 } | 443 } |
444 | 444 |
445 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); | 445 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); |
446 | 446 |
447 // Compute InstructionOperands for inputs and outputs. | 447 // Compute InstructionOperands for inputs and outputs. |
448 InitializeCallBuffer(node, &buffer, true, false); | 448 InitializeCallBuffer(node, &buffer, true, false); |
449 | 449 // Possibly align stack here for functions. |
450 // TODO(dcarney): might be possible to use claim/poke instead | 450 int push_count = buffer.pushed_nodes.size(); |
451 // Push any stack arguments. | 451 if (push_count > 0) { |
| 452 Emit(kMipsStackClaim | MiscField::encode(push_count), NULL); |
| 453 } |
| 454 int slot = buffer.pushed_nodes.size() - 1; |
452 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin(); | 455 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin(); |
453 input != buffer.pushed_nodes.rend(); input++) { | 456 input != buffer.pushed_nodes.rend(); input++) { |
454 // TODO(plind): inefficient for MIPS, use MultiPush here. | 457 Emit(kMipsStoreToStackSlot | MiscField::encode(slot), NULL, |
455 // - Also need to align the stack. See arm64. | 458 g.UseRegister(*input)); |
456 // - Maybe combine with arg slot stuff in DirectCEntry stub. | 459 slot--; |
457 Emit(kMipsPush, NULL, g.UseRegister(*input)); | |
458 } | 460 } |
459 | 461 |
460 // Select the appropriate opcode based on the call type. | 462 // Select the appropriate opcode based on the call type. |
461 InstructionCode opcode; | 463 InstructionCode opcode; |
462 switch (descriptor->kind()) { | 464 switch (descriptor->kind()) { |
463 case CallDescriptor::kCallCodeObject: { | 465 case CallDescriptor::kCallCodeObject: { |
464 opcode = kArchCallCodeObject; | 466 opcode = kArchCallCodeObject; |
465 break; | 467 break; |
466 } | 468 } |
467 case CallDescriptor::kCallJSFunction: | 469 case CallDescriptor::kCallJSFunction: |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 | 783 |
782 // static | 784 // static |
783 MachineOperatorBuilder::Flags | 785 MachineOperatorBuilder::Flags |
784 InstructionSelector::SupportedMachineOperatorFlags() { | 786 InstructionSelector::SupportedMachineOperatorFlags() { |
785 return MachineOperatorBuilder::kNoFlags; | 787 return MachineOperatorBuilder::kNoFlags; |
786 } | 788 } |
787 | 789 |
788 } // namespace compiler | 790 } // namespace compiler |
789 } // namespace internal | 791 } // namespace internal |
790 } // namespace v8 | 792 } // namespace v8 |
OLD | NEW |