| 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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { | 1192 void InstructionSelector::VisitFloat32RoundTiesEven(Node* node) { |
| 1193 VisitRR(this, kMips64Float32RoundTiesEven, node); | 1193 VisitRR(this, kMips64Float32RoundTiesEven, node); |
| 1194 } | 1194 } |
| 1195 | 1195 |
| 1196 | 1196 |
| 1197 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { | 1197 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { |
| 1198 VisitRR(this, kMips64Float64RoundTiesEven, node); | 1198 VisitRR(this, kMips64Float64RoundTiesEven, node); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 | 1201 |
| 1202 void InstructionSelector::EmitPrepareArguments(NodeVector* arguments, | 1202 void InstructionSelector::EmitPrepareArguments( |
| 1203 const CallDescriptor* descriptor, | 1203 ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor, |
| 1204 Node* node) { | 1204 Node* node) { |
| 1205 Mips64OperandGenerator g(this); | 1205 Mips64OperandGenerator g(this); |
| 1206 | 1206 |
| 1207 // Prepare for C function call. | 1207 // Prepare for C function call. |
| 1208 if (descriptor->IsCFunctionCall()) { | 1208 if (descriptor->IsCFunctionCall()) { |
| 1209 Emit(kArchPrepareCallCFunction | | 1209 Emit(kArchPrepareCallCFunction | |
| 1210 MiscField::encode(static_cast<int>(descriptor->CParameterCount())), | 1210 MiscField::encode(static_cast<int>(descriptor->CParameterCount())), |
| 1211 0, nullptr, 0, nullptr); | 1211 0, nullptr, 0, nullptr); |
| 1212 | 1212 |
| 1213 // Poke any stack arguments. | 1213 // Poke any stack arguments. |
| 1214 int slot = kCArgSlotCount; | 1214 int slot = kCArgSlotCount; |
| 1215 for (Node* input : (*arguments)) { | 1215 for (PushParameter input : (*arguments)) { |
| 1216 Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input), | 1216 Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node()), |
| 1217 g.TempImmediate(slot << kPointerSizeLog2)); | 1217 g.TempImmediate(slot << kPointerSizeLog2)); |
| 1218 ++slot; | 1218 ++slot; |
| 1219 } | 1219 } |
| 1220 } else { | 1220 } else { |
| 1221 int push_count = static_cast<int>(descriptor->StackParameterCount()); | 1221 int push_count = static_cast<int>(descriptor->StackParameterCount()); |
| 1222 if (push_count > 0) { | 1222 if (push_count > 0) { |
| 1223 Emit(kMips64StackClaim, g.NoOutput(), | 1223 Emit(kMips64StackClaim, g.NoOutput(), |
| 1224 g.TempImmediate(push_count << kPointerSizeLog2)); | 1224 g.TempImmediate(push_count << kPointerSizeLog2)); |
| 1225 } | 1225 } |
| 1226 for (size_t n = 0; n < arguments->size(); ++n) { | 1226 for (size_t n = 0; n < arguments->size(); ++n) { |
| 1227 if (Node* input = (*arguments)[n]) { | 1227 PushParameter input = (*arguments)[n]; |
| 1228 Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input), | 1228 if (input.node()) { |
| 1229 Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input.node()), |
| 1229 g.TempImmediate(static_cast<int>(n << kPointerSizeLog2))); | 1230 g.TempImmediate(static_cast<int>(n << kPointerSizeLog2))); |
| 1230 } | 1231 } |
| 1231 } | 1232 } |
| 1232 } | 1233 } |
| 1233 } | 1234 } |
| 1234 | 1235 |
| 1235 | 1236 |
| 1236 bool InstructionSelector::IsTailCallAddressImmediate() { return false; } | 1237 bool InstructionSelector::IsTailCallAddressImmediate() { return false; } |
| 1237 | 1238 |
| 1238 | 1239 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 MachineOperatorBuilder::kFloat32RoundUp | | 1787 MachineOperatorBuilder::kFloat32RoundUp | |
| 1787 MachineOperatorBuilder::kFloat64RoundTruncate | | 1788 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1788 MachineOperatorBuilder::kFloat32RoundTruncate | | 1789 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 1789 MachineOperatorBuilder::kFloat64RoundTiesEven | | 1790 MachineOperatorBuilder::kFloat64RoundTiesEven | |
| 1790 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1791 MachineOperatorBuilder::kFloat32RoundTiesEven; |
| 1791 } | 1792 } |
| 1792 | 1793 |
| 1793 } // namespace compiler | 1794 } // namespace compiler |
| 1794 } // namespace internal | 1795 } // namespace internal |
| 1795 } // namespace v8 | 1796 } // namespace v8 |
| OLD | NEW |