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/gap-resolver.h" | 5 #include "src/compiler/gap-resolver.h" |
6 | 6 |
7 #include "src/base/utils/random-number-generator.h" | 7 #include "src/base/utils/random-number-generator.h" |
8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 static Key KeyFor(const InstructionOperand& op) { | 76 static Key KeyFor(const InstructionOperand& op) { |
77 bool is_constant = op.IsConstant(); | 77 bool is_constant = op.IsConstant(); |
78 bool is_float = false; | 78 bool is_float = false; |
79 LocationOperand::LocationKind kind; | 79 LocationOperand::LocationKind kind; |
80 int index; | 80 int index; |
81 if (!is_constant) { | 81 if (!is_constant) { |
82 if (op.IsRegister()) { | 82 if (op.IsRegister()) { |
83 index = LocationOperand::cast(op).GetRegister().code(); | 83 index = LocationOperand::cast(op).GetRegister().code(); |
84 } else if (op.IsDoubleRegister()) { | 84 } else if (op.IsFPRegister()) { |
85 index = LocationOperand::cast(op).GetDoubleRegister().code(); | 85 index = LocationOperand::cast(op).GetDoubleRegister().code(); |
86 } else { | 86 } else { |
87 index = LocationOperand::cast(op).index(); | 87 index = LocationOperand::cast(op).index(); |
88 } | 88 } |
89 is_float = IsFloatingPoint(LocationOperand::cast(op).representation()); | 89 is_float = IsFloatingPoint(LocationOperand::cast(op).representation()); |
90 kind = LocationOperand::cast(op).location_kind(); | 90 kind = LocationOperand::cast(op).location_kind(); |
91 } else { | 91 } else { |
92 index = ConstantOperand::cast(op).virtual_register(); | 92 index = ConstantOperand::cast(op).virtual_register(); |
93 kind = LocationOperand::REGISTER; | 93 kind = LocationOperand::REGISTER; |
94 } | 94 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 resolver.Resolve(pm); | 251 resolver.Resolve(pm); |
252 | 252 |
253 CHECK(mi1.state() == mi2.state()); | 253 CHECK(mi1.state() == mi2.state()); |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 } // namespace compiler | 258 } // namespace compiler |
259 } // namespace internal | 259 } // namespace internal |
260 } // namespace v8 | 260 } // namespace v8 |
OLD | NEW |