OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 #include "src/interpreter/bytecode-traits.h" | 10 #include "src/interpreter/bytecode-traits.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 s << "a" << parameter_index - 1; | 690 s << "a" << parameter_index - 1; |
691 return s.str(); | 691 return s.str(); |
692 } | 692 } |
693 } else { | 693 } else { |
694 std::ostringstream s; | 694 std::ostringstream s; |
695 s << "r" << index(); | 695 s << "r" << index(); |
696 return s.str(); | 696 return s.str(); |
697 } | 697 } |
698 } | 698 } |
699 | 699 |
| 700 ValidBytecodeOperandSizeCombinationsIterator:: |
| 701 ValidBytecodeOperandSizeCombinationsIterator() |
| 702 : reached_end_(false), |
| 703 operand_scale_(OperandScale::kSingle), |
| 704 bytecode_(kFirstBytecode) { |
| 705 // Advance to the first valid combination |
| 706 while (!done() && !CurrentCombinationIsValid()) { |
| 707 IncrementPosition(); |
| 708 } |
| 709 DCHECK(!done()); |
| 710 } |
| 711 |
| 712 void ValidBytecodeOperandSizeCombinationsIterator::Advance() { |
| 713 do { |
| 714 IncrementPosition(); |
| 715 } while (!done() && !CurrentCombinationIsValid()); |
| 716 } |
| 717 |
| 718 void ValidBytecodeOperandSizeCombinationsIterator::IncrementPosition() { |
| 719 if (bytecode_ == Bytecode::kLast) { |
| 720 if (operand_scale_ == OperandScale::kMaxValid) { |
| 721 reached_end_ = true; |
| 722 return; |
| 723 } |
| 724 bytecode_ = kFirstBytecode; |
| 725 operand_scale_ = Bytecodes::NextOperandScale(operand_scale_); |
| 726 } else { |
| 727 bytecode_ = Bytecodes::FromByte(static_cast<int>(bytecode_) + 1); |
| 728 } |
| 729 } |
| 730 |
| 731 bool ValidBytecodeOperandSizeCombinationsIterator::CurrentCombinationIsValid() { |
| 732 return Bytecodes::BytecodeHasHandler(bytecode_, operand_scale_); |
| 733 } |
| 734 |
700 } // namespace interpreter | 735 } // namespace interpreter |
701 } // namespace internal | 736 } // namespace internal |
702 } // namespace v8 | 737 } // namespace v8 |
OLD | NEW |