| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( | 964 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( |
| 963 BytecodeLabel* label) { | 965 BytecodeLabel* label) { |
| 964 return OutputJump(Bytecode::kJumpIfUndefined, label); | 966 return OutputJump(Bytecode::kJumpIfUndefined, label); |
| 965 } | 967 } |
| 966 | 968 |
| 967 BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck() { | 969 BytecodeArrayBuilder& BytecodeArrayBuilder::StackCheck() { |
| 968 Output(Bytecode::kStackCheck); | 970 Output(Bytecode::kStackCheck); |
| 969 return *this; | 971 return *this; |
| 970 } | 972 } |
| 971 | 973 |
| 974 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfHole(BytecodeLabel* label) { |
| 975 return OutputJump(Bytecode::kJumpIfHole, label); |
| 976 } |
| 977 |
| 978 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole( |
| 979 BytecodeLabel* label) { |
| 980 return OutputJump(Bytecode::kJumpIfNotHole, label); |
| 981 } |
| 982 |
| 972 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { | 983 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { |
| 973 Output(Bytecode::kThrow); | 984 Output(Bytecode::kThrow); |
| 974 exit_seen_in_block_ = true; | 985 exit_seen_in_block_ = true; |
| 975 return *this; | 986 return *this; |
| 976 } | 987 } |
| 977 | 988 |
| 978 | 989 |
| 979 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 990 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
| 980 Output(Bytecode::kReThrow); | 991 Output(Bytecode::kReThrow); |
| 981 exit_seen_in_block_ = true; | 992 exit_seen_in_block_ = true; |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 } | 1694 } |
| 1684 | 1695 |
| 1685 // static | 1696 // static |
| 1686 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { | 1697 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { |
| 1687 return value.is_short_operand(); | 1698 return value.is_short_operand(); |
| 1688 } | 1699 } |
| 1689 | 1700 |
| 1690 } // namespace interpreter | 1701 } // namespace interpreter |
| 1691 } // namespace internal | 1702 } // namespace internal |
| 1692 } // namespace v8 | 1703 } // namespace v8 |
| OLD | NEW |