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 "src/frames.h" | 7 #include "src/frames.h" |
8 #include "src/interpreter/bytecode-traits.h" | 8 #include "src/interpreter/bytecode-traits.h" |
| 9 #include "src/interpreter/interpreter.h" |
9 | 10 |
10 namespace v8 { | 11 namespace v8 { |
11 namespace internal { | 12 namespace internal { |
12 namespace interpreter { | 13 namespace interpreter { |
13 | 14 |
14 | 15 |
15 // static | 16 // static |
16 const char* Bytecodes::ToString(Bytecode bytecode) { | 17 const char* Bytecodes::ToString(Bytecode bytecode) { |
17 switch (bytecode) { | 18 switch (bytecode) { |
18 #define CASE(Name, ...) \ | 19 #define CASE(Name, ...) \ |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 UNREACHABLE(); | 559 UNREACHABLE(); |
559 break; | 560 break; |
560 } | 561 } |
561 if (i != number_of_operands - 1) { | 562 if (i != number_of_operands - 1) { |
562 os << ", "; | 563 os << ", "; |
563 } | 564 } |
564 } | 565 } |
565 return os; | 566 return os; |
566 } | 567 } |
567 | 568 |
| 569 // static |
| 570 bool Bytecodes::BytecodeHasHandler(Bytecode bytecode, |
| 571 OperandScale operand_scale) { |
| 572 return operand_scale == OperandScale::kSingle || |
| 573 Bytecodes::IsBytecodeWithScalableOperands(bytecode); |
| 574 } |
| 575 |
568 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) { | 576 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode) { |
569 return os << Bytecodes::ToString(bytecode); | 577 return os << Bytecodes::ToString(bytecode); |
570 } | 578 } |
571 | 579 |
572 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { | 580 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size) { |
573 return os << Bytecodes::OperandSizeToString(operand_size); | 581 return os << Bytecodes::OperandSizeToString(operand_size); |
574 } | 582 } |
575 | 583 |
576 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) { | 584 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale) { |
577 return os << Bytecodes::OperandScaleToString(operand_scale); | 585 return os << Bytecodes::OperandScaleToString(operand_scale); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 } else { | 684 } else { |
677 std::ostringstream s; | 685 std::ostringstream s; |
678 s << "r" << index(); | 686 s << "r" << index(); |
679 return s.str(); | 687 return s.str(); |
680 } | 688 } |
681 } | 689 } |
682 | 690 |
683 } // namespace interpreter | 691 } // namespace interpreter |
684 } // namespace internal | 692 } // namespace internal |
685 } // namespace v8 | 693 } // namespace v8 |
OLD | NEW |