Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 893913004: [turbofan] push virtual register field down to InstructionOperand (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/register-allocator-verifier.cc ('k') | test/cctest/compiler/test-instruction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/compiler/register-allocator-verifier.cc ('k') | test/cctest/compiler/test-instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698