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

Side by Side Diff: test/unittests/compiler/move-optimizer-unittest.cc

Issue 1050803002: [turbofan] cleanup InstructionOperand a little (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 8 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 | « test/unittests/compiler/instruction-selector-unittest.cc ('k') | no next file » | 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/move-optimizer.h" 5 #include "src/compiler/move-optimizer.h"
6 #include "test/unittests/compiler/instruction-sequence-unittest.h" 6 #include "test/unittests/compiler/instruction-sequence-unittest.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 << printable; 60 << printable;
61 } 61 }
62 } 62 }
63 63
64 private: 64 private:
65 InstructionOperand* ConvertMoveArg(TestOperand op) { 65 InstructionOperand* ConvertMoveArg(TestOperand op) {
66 CHECK_EQ(kNoValue, op.vreg_.value_); 66 CHECK_EQ(kNoValue, op.vreg_.value_);
67 CHECK_NE(kNoValue, op.value_); 67 CHECK_NE(kNoValue, op.value_);
68 switch (op.type_) { 68 switch (op.type_) {
69 case kConstant: 69 case kConstant:
70 return ConstantOperand::New(op.value_, zone()); 70 return ConstantOperand::New(zone(), op.value_);
71 case kFixedSlot: 71 case kFixedSlot:
72 return StackSlotOperand::New(op.value_, zone()); 72 return StackSlotOperand::New(zone(), op.value_);
73 case kFixedRegister: 73 case kFixedRegister:
74 CHECK(0 <= op.value_ && op.value_ < num_general_registers()); 74 CHECK(0 <= op.value_ && op.value_ < num_general_registers());
75 return RegisterOperand::New(op.value_, zone()); 75 return RegisterOperand::New(zone(), op.value_);
76 default: 76 default:
77 break; 77 break;
78 } 78 }
79 CHECK(false); 79 CHECK(false);
80 return nullptr; 80 return nullptr;
81 } 81 }
82 }; 82 };
83 83
84 84
85 TEST_F(MoveOptimizerTest, RemovesRedundant) { 85 TEST_F(MoveOptimizerTest, RemovesRedundant) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 CHECK(gap_1->AreMovesRedundant()); 171 CHECK(gap_1->AreMovesRedundant());
172 auto move = LastInstruction()->parallel_moves()[0]; 172 auto move = LastInstruction()->parallel_moves()[0];
173 CHECK_EQ(2, NonRedundantSize(move)); 173 CHECK_EQ(2, NonRedundantSize(move));
174 CHECK(Contains(move, Reg(0), Reg(1))); 174 CHECK(Contains(move, Reg(0), Reg(1)));
175 CHECK(Contains(move, Reg(1), Reg(0))); 175 CHECK(Contains(move, Reg(1), Reg(0)));
176 } 176 }
177 177
178 } // namespace compiler 178 } // namespace compiler
179 } // namespace internal 179 } // namespace internal
180 } // namespace v8 180 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/instruction-selector-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698