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 { |
11 namespace compiler { | 11 namespace compiler { |
12 | 12 |
13 // Adds X64-specific methods for generating operands. | 13 // Adds X64-specific methods for generating operands. |
14 class X64OperandGenerator FINAL : public OperandGenerator { | 14 class X64OperandGenerator FINAL : public OperandGenerator { |
15 public: | 15 public: |
16 explicit X64OperandGenerator(InstructionSelector* selector) | 16 explicit X64OperandGenerator(InstructionSelector* selector) |
17 : OperandGenerator(selector) {} | 17 : OperandGenerator(selector) {} |
18 | 18 |
19 InstructionOperand* TempRegister(Register reg) { | |
20 return new (zone()) UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER, | |
21 Register::ToAllocationIndex(reg)); | |
22 } | |
23 | |
24 bool CanBeImmediate(Node* node) { | 19 bool CanBeImmediate(Node* node) { |
25 switch (node->opcode()) { | 20 switch (node->opcode()) { |
26 case IrOpcode::kInt32Constant: | 21 case IrOpcode::kInt32Constant: |
27 return true; | 22 return true; |
28 case IrOpcode::kInt64Constant: { | 23 case IrOpcode::kInt64Constant: { |
29 const int64_t value = OpParameter<int64_t>(node); | 24 const int64_t value = OpParameter<int64_t>(node); |
30 return value == static_cast<int64_t>(static_cast<int32_t>(value)); | 25 return value == static_cast<int64_t>(static_cast<int32_t>(value)); |
31 } | 26 } |
32 default: | 27 default: |
33 return false; | 28 return false; |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 MachineOperatorBuilder::kFloat64Ceil | | 1310 MachineOperatorBuilder::kFloat64Ceil | |
1316 MachineOperatorBuilder::kFloat64RoundTruncate | | 1311 MachineOperatorBuilder::kFloat64RoundTruncate | |
1317 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1312 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1318 } | 1313 } |
1319 return MachineOperatorBuilder::kNoFlags; | 1314 return MachineOperatorBuilder::kNoFlags; |
1320 } | 1315 } |
1321 | 1316 |
1322 } // namespace compiler | 1317 } // namespace compiler |
1323 } // namespace internal | 1318 } // namespace internal |
1324 } // namespace v8 | 1319 } // namespace v8 |
OLD | NEW |