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

Side by Side Diff: src/compiler/mips64/instruction-selector-mips64.cc

Issue 769283002: MIPS: Improve pushing arguments on stack. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 6 years 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 | « src/compiler/mips64/instruction-codes-mips64.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 if (descriptor->NeedsFrameState()) { 636 if (descriptor->NeedsFrameState()) {
637 frame_state_descriptor = 637 frame_state_descriptor =
638 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); 638 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount()));
639 } 639 }
640 640
641 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); 641 CallBuffer buffer(zone(), descriptor, frame_state_descriptor);
642 642
643 // Compute InstructionOperands for inputs and outputs. 643 // Compute InstructionOperands for inputs and outputs.
644 InitializeCallBuffer(node, &buffer, true, false); 644 InitializeCallBuffer(node, &buffer, true, false);
645 645
646 // TODO(dcarney): might be possible to use claim/poke instead 646 int push_count = buffer.pushed_nodes.size();
647 // Push any stack arguments. 647 if (push_count > 0) {
648 Emit(kMips64StackClaim | MiscField::encode(push_count), NULL);
649 }
650 int slot = buffer.pushed_nodes.size() - 1;
648 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin(); 651 for (NodeVectorRIter input = buffer.pushed_nodes.rbegin();
649 input != buffer.pushed_nodes.rend(); input++) { 652 input != buffer.pushed_nodes.rend(); input++) {
650 // TODO(plind): inefficient for MIPS, use MultiPush here. 653 Emit(kMips64StoreToStackSlot | MiscField::encode(slot), NULL,
651 // - Also need to align the stack. See arm64. 654 g.UseRegister(*input));
652 // - Maybe combine with arg slot stuff in DirectCEntry stub. 655 slot--;
653 Emit(kMips64Push, NULL, g.UseRegister(*input));
654 } 656 }
655 657
656 // Select the appropriate opcode based on the call type. 658 // Select the appropriate opcode based on the call type.
657 InstructionCode opcode; 659 InstructionCode opcode;
658 switch (descriptor->kind()) { 660 switch (descriptor->kind()) {
659 case CallDescriptor::kCallCodeObject: { 661 case CallDescriptor::kCallCodeObject: {
660 opcode = kArchCallCodeObject; 662 opcode = kArchCallCodeObject;
661 break; 663 break;
662 } 664 }
663 case CallDescriptor::kCallJSFunction: 665 case CallDescriptor::kCallJSFunction:
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 981
980 // static 982 // static
981 MachineOperatorBuilder::Flags 983 MachineOperatorBuilder::Flags
982 InstructionSelector::SupportedMachineOperatorFlags() { 984 InstructionSelector::SupportedMachineOperatorFlags() {
983 return MachineOperatorBuilder::kNoFlags; 985 return MachineOperatorBuilder::kNoFlags;
984 } 986 }
985 987
986 } // namespace compiler 988 } // namespace compiler
987 } // namespace internal 989 } // namespace internal
988 } // namespace v8 990 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/instruction-codes-mips64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698