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/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace interpreter { | 9 namespace interpreter { |
10 | 10 |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 } | 800 } |
801 } | 801 } |
802 | 802 |
803 | 803 |
804 // static | 804 // static |
805 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { | 805 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { |
806 switch (jump_bytecode) { | 806 switch (jump_bytecode) { |
807 case Bytecode::kJump: | 807 case Bytecode::kJump: |
808 case Bytecode::kJumpIfNull: | 808 case Bytecode::kJumpIfNull: |
809 case Bytecode::kJumpIfUndefined: | 809 case Bytecode::kJumpIfUndefined: |
| 810 case Bytecode::kJumpIfHole: |
| 811 case Bytecode::kJumpIfNotHole: |
810 return jump_bytecode; | 812 return jump_bytecode; |
811 case Bytecode::kJumpIfTrue: | 813 case Bytecode::kJumpIfTrue: |
812 return Bytecode::kJumpIfToBooleanTrue; | 814 return Bytecode::kJumpIfToBooleanTrue; |
813 case Bytecode::kJumpIfFalse: | 815 case Bytecode::kJumpIfFalse: |
814 return Bytecode::kJumpIfToBooleanFalse; | 816 return Bytecode::kJumpIfToBooleanFalse; |
815 default: | 817 default: |
816 UNREACHABLE(); | 818 UNREACHABLE(); |
817 } | 819 } |
818 return static_cast<Bytecode>(-1); | 820 return static_cast<Bytecode>(-1); |
819 } | 821 } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( | 967 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( |
966 BytecodeLabel* label) { | 968 BytecodeLabel* label) { |
967 return OutputJump(Bytecode::kJumpIfUndefined, label); | 969 return OutputJump(Bytecode::kJumpIfUndefined, label); |
968 } | 970 } |
969 | 971 |
970 BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck() { | 972 BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck() { |
971 Output(Bytecode::kStackCheck); | 973 Output(Bytecode::kStackCheck); |
972 return *this; | 974 return *this; |
973 } | 975 } |
974 | 976 |
| 977 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfHole(BytecodeLabel* label) { |
| 978 return OutputJump(Bytecode::kJumpIfHole, label); |
| 979 } |
| 980 |
| 981 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole( |
| 982 BytecodeLabel* label) { |
| 983 return OutputJump(Bytecode::kJumpIfNotHole, label); |
| 984 } |
| 985 |
975 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { | 986 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { |
976 Output(Bytecode::kThrow); | 987 Output(Bytecode::kThrow); |
977 exit_seen_in_block_ = true; | 988 exit_seen_in_block_ = true; |
978 return *this; | 989 return *this; |
979 } | 990 } |
980 | 991 |
981 | 992 |
982 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 993 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
983 Output(Bytecode::kReThrow); | 994 Output(Bytecode::kReThrow); |
984 exit_seen_in_block_ = true; | 995 exit_seen_in_block_ = true; |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1686 } | 1697 } |
1687 | 1698 |
1688 // static | 1699 // static |
1689 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { | 1700 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { |
1690 return value.is_short_operand(); | 1701 return value.is_short_operand(); |
1691 } | 1702 } |
1692 | 1703 |
1693 } // namespace interpreter | 1704 } // namespace interpreter |
1694 } // namespace internal | 1705 } // namespace internal |
1695 } // namespace v8 | 1706 } // namespace v8 |
OLD | NEW |