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 #ifndef V8_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 523 |
524 private: | 524 private: |
525 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 525 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
526 }; | 526 }; |
527 | 527 |
528 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 528 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
529 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 529 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
530 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 530 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
531 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 531 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
532 | 532 |
| 533 class ValidBytecodeOperandSizeCombinationsIterator final { |
| 534 public: |
| 535 ValidBytecodeOperandSizeCombinationsIterator(); |
| 536 |
| 537 void Advance(); |
| 538 bool done() { return reached_end_; } |
| 539 |
| 540 OperandScale operand_scale() const { return operand_scale_; } |
| 541 Bytecode bytecode() const { return bytecode_; } |
| 542 |
| 543 private: |
| 544 void IncrementPosition(); |
| 545 bool CurrentCombinationIsValid(); |
| 546 |
| 547 bool reached_end_; |
| 548 OperandScale operand_scale_; |
| 549 Bytecode bytecode_; |
| 550 |
| 551 static const Bytecode kFirstBytecode = static_cast<Bytecode>(0); |
| 552 |
| 553 DISALLOW_COPY_AND_ASSIGN(ValidBytecodeOperandSizeCombinationsIterator); |
| 554 }; |
| 555 |
533 } // namespace interpreter | 556 } // namespace interpreter |
534 } // namespace internal | 557 } // namespace internal |
535 } // namespace v8 | 558 } // namespace v8 |
536 | 559 |
537 #endif // V8_INTERPRETER_BYTECODES_H_ | 560 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |