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