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

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

Issue 1207283002: MIPS: Followup to '[turbofan] Add basic support for calling to (a subset of) C functions.' Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months 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 | « no previous file | src/compiler/mips/linkage-mips.cc » ('j') | 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/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 // Compute InstructionOperands for inputs and outputs. 526 // Compute InstructionOperands for inputs and outputs.
527 InitializeCallBuffer(node, &buffer, true, true); 527 InitializeCallBuffer(node, &buffer, true, true);
528 528
529 // Prepare for C function call. 529 // Prepare for C function call.
530 if (descriptor->IsCFunctionCall()) { 530 if (descriptor->IsCFunctionCall()) {
531 Emit(kArchPrepareCallCFunction | 531 Emit(kArchPrepareCallCFunction |
532 MiscField::encode(static_cast<int>(descriptor->CParameterCount())), 532 MiscField::encode(static_cast<int>(descriptor->CParameterCount())),
533 0, nullptr, 0, nullptr); 533 0, nullptr, 0, nullptr);
534 534
535 // Poke any stack arguments. 535 // Poke any stack arguments.
536 int slot = kCArgSlotCount; 536 for (size_t n = 0; n < buffer.pushed_nodes.size(); ++n) {
537 for (Node* node : buffer.pushed_nodes) { 537 if (Node* node = buffer.pushed_nodes[n]) {
538 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(node), 538 int const slot = static_cast<int>(n);
539 g.TempImmediate(slot << kPointerSizeLog2)); 539 Emit(kMipsStoreToStackSlot, g.NoOutput(), g.UseRegister(node),
540 ++slot; 540 g.TempImmediate(slot << kPointerSizeLog2));
541 }
541 } 542 }
542 } else { 543 } else {
543 // Possibly align stack here for functions. 544 // Possibly align stack here for functions.
544 int push_count = buffer.pushed_nodes.size(); 545 int push_count = buffer.pushed_nodes.size();
545 if (push_count > 0) { 546 if (push_count > 0) {
546 Emit(kMipsStackClaim, g.NoOutput(), 547 Emit(kMipsStackClaim, g.NoOutput(),
547 g.TempImmediate(push_count << kPointerSizeLog2)); 548 g.TempImmediate(push_count << kPointerSizeLog2));
548 } 549 }
549 int slot = buffer.pushed_nodes.size() - 1; 550 int slot = buffer.pushed_nodes.size() - 1;
550 for (Node* node : base::Reversed(buffer.pushed_nodes)) { 551 for (Node* node : base::Reversed(buffer.pushed_nodes)) {
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 IsFp64Mode()) { 1106 IsFp64Mode()) {
1106 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1107 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1107 MachineOperatorBuilder::kFloat64RoundTruncate; 1108 MachineOperatorBuilder::kFloat64RoundTruncate;
1108 } 1109 }
1109 return flags; 1110 return flags;
1110 } 1111 }
1111 1112
1112 } // namespace compiler 1113 } // namespace compiler
1113 } // namespace internal 1114 } // namespace internal
1114 } // namespace v8 1115 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips/linkage-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698