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/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
8 | 9 |
9 namespace v8 { | 10 namespace v8 { |
10 namespace internal { | 11 namespace internal { |
11 namespace compiler { | 12 namespace compiler { |
12 | 13 |
13 enum ImmediateMode { | 14 enum ImmediateMode { |
14 kInt16Imm, | 15 kInt16Imm, |
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); | 1447 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); |
1447 | 1448 |
1448 // Compute InstructionOperands for inputs and outputs. | 1449 // Compute InstructionOperands for inputs and outputs. |
1449 // TODO(turbofan): on PPC it's probably better to use the code object in a | 1450 // TODO(turbofan): on PPC it's probably better to use the code object in a |
1450 // register if there are multiple uses of it. Improve constant pool and the | 1451 // register if there are multiple uses of it. Improve constant pool and the |
1451 // heuristics in the register allocator for where to emit constants. | 1452 // heuristics in the register allocator for where to emit constants. |
1452 InitializeCallBuffer(node, &buffer, true, false); | 1453 InitializeCallBuffer(node, &buffer, true, false); |
1453 | 1454 |
1454 // Push any stack arguments. | 1455 // Push any stack arguments. |
1455 // TODO(mbrandy): reverse order and use push only for first | 1456 // TODO(mbrandy): reverse order and use push only for first |
1456 for (auto i = buffer.pushed_nodes.rbegin(); i != buffer.pushed_nodes.rend(); | 1457 for (Node* node : base::Reversed(buffer.pushed_nodes)) { |
1457 i++) { | 1458 Emit(kPPC_Push, g.NoOutput(), g.UseRegister(node)); |
1458 Emit(kPPC_Push, g.NoOutput(), g.UseRegister(*i)); | |
1459 } | 1459 } |
1460 | 1460 |
1461 // Pass label of exception handler block. | 1461 // Pass label of exception handler block. |
1462 CallDescriptor::Flags flags = descriptor->flags(); | 1462 CallDescriptor::Flags flags = descriptor->flags(); |
1463 if (handler != nullptr) { | 1463 if (handler != nullptr) { |
1464 flags |= CallDescriptor::kHasExceptionHandler; | 1464 flags |= CallDescriptor::kHasExceptionHandler; |
1465 buffer.instruction_args.push_back(g.Label(handler)); | 1465 buffer.instruction_args.push_back(g.Label(handler)); |
1466 } | 1466 } |
1467 | 1467 |
1468 // Select the appropriate opcode based on the call type. | 1468 // Select the appropriate opcode based on the call type. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 MachineOperatorBuilder::kFloat64Min | | 1548 MachineOperatorBuilder::kFloat64Min | |
1549 MachineOperatorBuilder::kFloat64RoundDown | | 1549 MachineOperatorBuilder::kFloat64RoundDown | |
1550 MachineOperatorBuilder::kFloat64RoundTruncate | | 1550 MachineOperatorBuilder::kFloat64RoundTruncate | |
1551 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1551 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1552 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. | 1552 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. |
1553 } | 1553 } |
1554 | 1554 |
1555 } // namespace compiler | 1555 } // namespace compiler |
1556 } // namespace internal | 1556 } // namespace internal |
1557 } // namespace v8 | 1557 } // namespace v8 |
OLD | NEW |