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" |
| 11 #include "src/interpreter/interpreter.h" |
11 | 12 |
12 namespace v8 { | 13 namespace v8 { |
13 namespace internal { | 14 namespace internal { |
14 namespace interpreter { | 15 namespace interpreter { |
15 | 16 |
16 | 17 |
17 // static | 18 // static |
18 const char* Bytecodes::ToString(Bytecode bytecode) { | 19 const char* Bytecodes::ToString(Bytecode bytecode) { |
19 switch (bytecode) { | 20 switch (bytecode) { |
20 #define CASE(Name, ...) \ | 21 #define CASE(Name, ...) \ |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 UNREACHABLE(); | 568 UNREACHABLE(); |
568 break; | 569 break; |
569 } | 570 } |
570 if (i != number_of_operands - 1) { | 571 if (i != number_of_operands - 1) { |
571 os << ", "; | 572 os << ", "; |
572 } | 573 } |
573 } | 574 } |
574 return os; | 575 return os; |
575 } | 576 } |
576 | 577 |
| 578 // static |
| 579 bool Bytecodes::BytecodeHasHandler(Bytecode bytecode, |
| 580 OperandScale operand_scale) { |
| 581 return operand_scale == OperandScale::kSingle || |
| 582 Bytecodes::IsBytecodeWithScalableOperands(bytecode); |
| 583 } |
| 584 |
577 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) { | 585 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) { |
578 return os << Bytecodes::ToString(bytecode); | 586 return os << Bytecodes::ToString(bytecode); |
579 } | 587 } |
580 | 588 |
581 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { | 589 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { |
582 return os << Bytecodes::OperandSizeToString(operand_size); | 590 return os << Bytecodes::OperandSizeToString(operand_size); |
583 } | 591 } |
584 | 592 |
585 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) { | 593 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) { |
586 return os << Bytecodes::OperandScaleToString(operand_scale); | 594 return os << Bytecodes::OperandScaleToString(operand_scale); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 } else { | 693 } else { |
686 std::ostringstream s; | 694 std::ostringstream s; |
687 s << "r" << index(); | 695 s << "r" << index(); |
688 return s.str(); | 696 return s.str(); |
689 } | 697 } |
690 } | 698 } |
691 | 699 |
692 } // namespace interpreter | 700 } // namespace interpreter |
693 } // namespace internal | 701 } // namespace internal |
694 } // namespace v8 | 702 } // namespace v8 |
OLD | NEW |