| 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 } | 788 } |
| 789 } | 789 } |
| 790 | 790 |
| 791 | 791 |
| 792 // static | 792 // static |
| 793 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { | 793 Bytecode BytecodeArrayBuilder::GetJumpWithToBoolean(Bytecode jump_bytecode) { |
| 794 switch (jump_bytecode) { | 794 switch (jump_bytecode) { |
| 795 case Bytecode::kJump: | 795 case Bytecode::kJump: |
| 796 case Bytecode::kJumpIfNull: | 796 case Bytecode::kJumpIfNull: |
| 797 case Bytecode::kJumpIfUndefined: | 797 case Bytecode::kJumpIfUndefined: |
| 798 case Bytecode::kJumpIfHole: |
| 799 case Bytecode::kJumpIfNotHole: |
| 798 return jump_bytecode; | 800 return jump_bytecode; |
| 799 case Bytecode::kJumpIfTrue: | 801 case Bytecode::kJumpIfTrue: |
| 800 return Bytecode::kJumpIfToBooleanTrue; | 802 return Bytecode::kJumpIfToBooleanTrue; |
| 801 case Bytecode::kJumpIfFalse: | 803 case Bytecode::kJumpIfFalse: |
| 802 return Bytecode::kJumpIfToBooleanFalse; | 804 return Bytecode::kJumpIfToBooleanFalse; |
| 803 default: | 805 default: |
| 804 UNREACHABLE(); | 806 UNREACHABLE(); |
| 805 } | 807 } |
| 806 return static_cast<Bytecode>(-1); | 808 return static_cast<Bytecode>(-1); |
| 807 } | 809 } |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { | 947 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNull(BytecodeLabel* label) { |
| 946 return OutputJump(Bytecode::kJumpIfNull, label); | 948 return OutputJump(Bytecode::kJumpIfNull, label); |
| 947 } | 949 } |
| 948 | 950 |
| 949 | 951 |
| 950 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( | 952 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfUndefined( |
| 951 BytecodeLabel* label) { | 953 BytecodeLabel* label) { |
| 952 return OutputJump(Bytecode::kJumpIfUndefined, label); | 954 return OutputJump(Bytecode::kJumpIfUndefined, label); |
| 953 } | 955 } |
| 954 | 956 |
| 957 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfHole(BytecodeLabel* label) { |
| 958 return OutputJump(Bytecode::kJumpIfHole, label); |
| 959 } |
| 960 |
| 961 BytecodeArrayBuilder& BytecodeArrayBuilder::JumpIfNotHole( |
| 962 BytecodeLabel* label) { |
| 963 return OutputJump(Bytecode::kJumpIfNotHole, label); |
| 964 } |
| 955 | 965 |
| 956 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { | 966 BytecodeArrayBuilder& BytecodeArrayBuilder::Throw() { |
| 957 Output(Bytecode::kThrow); | 967 Output(Bytecode::kThrow); |
| 958 exit_seen_in_block_ = true; | 968 exit_seen_in_block_ = true; |
| 959 return *this; | 969 return *this; |
| 960 } | 970 } |
| 961 | 971 |
| 962 | 972 |
| 963 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { | 973 BytecodeArrayBuilder& BytecodeArrayBuilder::ReThrow() { |
| 964 Output(Bytecode::kReThrow); | 974 Output(Bytecode::kReThrow); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 | 1695 |
| 1686 | 1696 |
| 1687 // static | 1697 // static |
| 1688 bool BytecodeArrayBuilder::FitsInReg16Operand(Register value) { | 1698 bool BytecodeArrayBuilder::FitsInReg16Operand(Register value) { |
| 1689 return kMinInt16 <= value.index() && value.index() <= kMaxInt16; | 1699 return kMinInt16 <= value.index() && value.index() <= kMaxInt16; |
| 1690 } | 1700 } |
| 1691 | 1701 |
| 1692 } // namespace interpreter | 1702 } // namespace interpreter |
| 1693 } // namespace internal | 1703 } // namespace internal |
| 1694 } // namespace v8 | 1704 } // namespace v8 |
| OLD | NEW |