| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |