| 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 } | 796 } |
| 797 } | 797 } |
| 798 | 798 |
| 799 | 799 |
| 800 // static | 800 // static |
| 801 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { | 801 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { |
| 802 switch (jump_bytecode) { | 802 switch (jump_bytecode) { |
| 803 case Bytecode::kJump: | 803 case Bytecode::kJump: |
| 804 case Bytecode::kJumpIfNull: | 804 case Bytecode::kJumpIfNull: |
| 805 case Bytecode::kJumpIfUndefined: | 805 case Bytecode::kJumpIfUndefined: |
| 806 case Bytecode::kJumpIfHole: |
| 807 case Bytecode::kJumpIfNotHole: |
| 806 return jump_bytecode; | 808 return jump_bytecode; |
| 807 case Bytecode::kJumpIfTrue: | 809 case Bytecode::kJumpIfTrue: |
| 808 return Bytecode::kJumpIfToBooleanTrue; | 810 return Bytecode::kJumpIfToBooleanTrue; |
| 809 case Bytecode::kJumpIfFalse: | 811 case Bytecode::kJumpIfFalse: |
| 810 return Bytecode::kJumpIfToBooleanFalse; | 812 return Bytecode::kJumpIfToBooleanFalse; |
| 811 default: | 813 default: |
| 812 UNREACHABLE(); | 814 UNREACHABLE(); |
| 813 } | 815 } |
| 814 return static_cast<Bytecode>(-1); | 816 return static_cast<Bytecode>(-1); |
| 815 } | 817 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { | 955 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { |
| 954 return OutputJump(Bytecode::kJumpIfNull, label); | 956 return OutputJump(Bytecode::kJumpIfNull, label); |
| 955 } | 957 } |
| 956 | 958 |
| 957 | 959 |
| 958 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( | 960 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( |
| 959 BytecodeLabel* label) { | 961 BytecodeLabel* label) { |
| 960 return OutputJump(Bytecode::kJumpIfUndefined, label); | 962 return OutputJump(Bytecode::kJumpIfUndefined, label); |
| 961 } | 963 } |
| 962 | 964 |
| 965 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfHole(BytecodeLabel* label) { |
| 966 return OutputJump(Bytecode::kJumpIfHole, label); |
| 967 } |
| 968 |
| 969 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole( |
| 970 BytecodeLabel* label) { |
| 971 return OutputJump(Bytecode::kJumpIfNotHole, label); |
| 972 } |
| 963 | 973 |
| 964 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { | 974 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { |
| 965 Output(Bytecode::kThrow); | 975 Output(Bytecode::kThrow); |
| 966 exit_seen_in_block_ = true; | 976 exit_seen_in_block_ = true; |
| 967 return *this; | 977 return *this; |
| 968 } | 978 } |
| 969 | 979 |
| 970 | 980 |
| 971 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 981 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
| 972 Output(Bytecode::kReThrow); | 982 Output(Bytecode::kReThrow); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1659 } | 1669 } |
| 1660 | 1670 |
| 1661 // static | 1671 // static |
| 1662 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { | 1672 bool BytecodeArrayBuilder::FitsInReg16OperandUntranslated(Register value) { |
| 1663 return value.is_short_operand(); | 1673 return value.is_short_operand(); |
| 1664 } | 1674 } |
| 1665 | 1675 |
| 1666 } // namespace interpreter | 1676 } // namespace interpreter |
| 1667 } // namespace internal | 1677 } // namespace internal |
| 1668 } // namespace v8 | 1678 } // namespace v8 |
| OLD | NEW |