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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1161 | 1161 |
1162 // Push the arguments to the stack. | 1162 // Push the arguments to the stack. |
1163 bool pushed_count_uneven = buffer.pushed_nodes.size() & 1; | 1163 bool pushed_count_uneven = buffer.pushed_nodes.size() & 1; |
1164 int aligned_push_count = buffer.pushed_nodes.size(); | 1164 int aligned_push_count = buffer.pushed_nodes.size(); |
1165 // TODO(dcarney): claim and poke probably take small immediates, | 1165 // TODO(dcarney): claim and poke probably take small immediates, |
1166 // loop here or whatever. | 1166 // loop here or whatever. |
1167 // Bump the stack pointer(s). | 1167 // Bump the stack pointer(s). |
1168 if (aligned_push_count > 0) { | 1168 if (aligned_push_count > 0) { |
1169 // TODO(dcarney): it would be better to bump the csp here only | 1169 // TODO(dcarney): it would be better to bump the csp here only |
1170 // and emit paired stores with increment for non c frames. | 1170 // and emit paired stores with increment for non c frames. |
1171 Emit(kArm64Claim | MiscField::encode(aligned_push_count), g.NoOutput()); | 1171 Emit(kArm64Claim, g.NoOutput(), g.TempImmediate(aligned_push_count)); |
1172 } | 1172 } |
1173 // Move arguments to the stack. | 1173 // Move arguments to the stack. |
1174 { | 1174 { |
1175 int slot = buffer.pushed_nodes.size() - 1; | 1175 int slot = buffer.pushed_nodes.size() - 1; |
1176 // Emit the uneven pushes. | 1176 // Emit the uneven pushes. |
1177 if (pushed_count_uneven) { | 1177 if (pushed_count_uneven) { |
1178 Node* input = buffer.pushed_nodes[slot]; | 1178 Node* input = buffer.pushed_nodes[slot]; |
1179 Emit(kArm64Poke | MiscField::encode(slot), g.NoOutput(), | 1179 Emit(kArm64Poke, g.NoOutput(), g.UseRegister(input), |
1180 g.UseRegister(input)); | 1180 g.TempImmediate(slot)); |
1181 slot--; | 1181 slot--; |
1182 } | 1182 } |
1183 // Now all pushes can be done in pairs. | 1183 // Now all pushes can be done in pairs. |
1184 for (; slot >= 0; slot -= 2) { | 1184 for (; slot >= 0; slot -= 2) { |
1185 Emit(kArm64PokePair | MiscField::encode(slot), g.NoOutput(), | 1185 Emit(kArm64PokePair, g.NoOutput(), |
1186 g.UseRegister(buffer.pushed_nodes[slot]), | 1186 g.UseRegister(buffer.pushed_nodes[slot]), |
1187 g.UseRegister(buffer.pushed_nodes[slot - 1])); | 1187 g.UseRegister(buffer.pushed_nodes[slot - 1]), |
| 1188 g.TempImmediate(slot)); |
1188 } | 1189 } |
1189 } | 1190 } |
1190 | 1191 |
1191 // Pass label of exception handler block. | 1192 // Pass label of exception handler block. |
1192 CallDescriptor::Flags flags = descriptor->flags(); | 1193 CallDescriptor::Flags flags = descriptor->flags(); |
1193 if (handler != nullptr) { | 1194 if (handler != nullptr) { |
1194 flags |= CallDescriptor::kHasExceptionHandler; | 1195 flags |= CallDescriptor::kHasExceptionHandler; |
1195 buffer.instruction_args.push_back(g.Label(handler)); | 1196 buffer.instruction_args.push_back(g.Label(handler)); |
1196 } | 1197 } |
1197 | 1198 |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1659 MachineOperatorBuilder::kFloat64Max | | 1660 MachineOperatorBuilder::kFloat64Max | |
1660 MachineOperatorBuilder::kFloat64Min | | 1661 MachineOperatorBuilder::kFloat64Min | |
1661 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1662 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1662 MachineOperatorBuilder::kInt32DivIsSafe | | 1663 MachineOperatorBuilder::kInt32DivIsSafe | |
1663 MachineOperatorBuilder::kUint32DivIsSafe; | 1664 MachineOperatorBuilder::kUint32DivIsSafe; |
1664 } | 1665 } |
1665 | 1666 |
1666 } // namespace compiler | 1667 } // namespace compiler |
1667 } // namespace internal | 1668 } // namespace internal |
1668 } // namespace v8 | 1669 } // namespace v8 |
OLD | NEW |