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 #ifndef V8_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 ConstantMap::const_iterator it = constants_.find(virtual_register); | 1327 ConstantMap::const_iterator it = constants_.find(virtual_register); |
1328 DCHECK(it != constants_.end()); | 1328 DCHECK(it != constants_.end()); |
1329 DCHECK_EQ(virtual_register, it->first); | 1329 DCHECK_EQ(virtual_register, it->first); |
1330 return it->second; | 1330 return it->second; |
1331 } | 1331 } |
1332 | 1332 |
1333 typedef ZoneVector<Constant> Immediates; | 1333 typedef ZoneVector<Constant> Immediates; |
1334 Immediates& immediates() { return immediates_; } | 1334 Immediates& immediates() { return immediates_; } |
1335 | 1335 |
1336 ImmediateOperand AddImmediate(const Constant& constant) { | 1336 ImmediateOperand AddImmediate(const Constant& constant) { |
1337 if (constant.type() == Constant::kInt32) { | 1337 if (constant.type() == Constant::kInt32 && |
| 1338 RelocInfo::IsNone(constant.rmode())) { |
1338 return ImmediateOperand(ImmediateOperand::INLINE, constant.ToInt32()); | 1339 return ImmediateOperand(ImmediateOperand::INLINE, constant.ToInt32()); |
1339 } | 1340 } |
1340 int index = static_cast<int>(immediates_.size()); | 1341 int index = static_cast<int>(immediates_.size()); |
1341 immediates_.push_back(constant); | 1342 immediates_.push_back(constant); |
1342 return ImmediateOperand(ImmediateOperand::INDEXED, index); | 1343 return ImmediateOperand(ImmediateOperand::INDEXED, index); |
1343 } | 1344 } |
1344 | 1345 |
1345 Constant GetImmediate(const ImmediateOperand* op) const { | 1346 Constant GetImmediate(const ImmediateOperand* op) const { |
1346 switch (op->type()) { | 1347 switch (op->type()) { |
1347 case ImmediateOperand::INLINE: | 1348 case ImmediateOperand::INLINE: |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 | 1430 |
1430 | 1431 |
1431 std::ostream& operator<<(std::ostream& os, | 1432 std::ostream& operator<<(std::ostream& os, |
1432 const PrintableInstructionSequence& code); | 1433 const PrintableInstructionSequence& code); |
1433 | 1434 |
1434 } // namespace compiler | 1435 } // namespace compiler |
1435 } // namespace internal | 1436 } // namespace internal |
1436 } // namespace v8 | 1437 } // namespace v8 |
1437 | 1438 |
1438 #endif // V8_COMPILER_INSTRUCTION_H_ | 1439 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |