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 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 #undef CASE | 154 #undef CASE |
155 } | 155 } |
156 UNREACHABLE(); | 156 UNREACHABLE(); |
157 return OperandSize::kNone; | 157 return OperandSize::kNone; |
158 } | 158 } |
159 | 159 |
160 | 160 |
161 // static | 161 // static |
162 bool Bytecodes::IsJump(Bytecode bytecode) { | 162 bool Bytecodes::IsJump(Bytecode bytecode) { |
163 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpIfTrue || | 163 return bytecode == Bytecode::kJump || bytecode == Bytecode::kJumpIfTrue || |
164 bytecode == Bytecode::kJumpIfFalse; | 164 bytecode == Bytecode::kJumpIfFalse || |
| 165 bytecode == Bytecode::kJumpIfToBooleanTrue || |
| 166 bytecode == Bytecode::kJumpIfToBooleanFalse; |
165 } | 167 } |
166 | 168 |
167 | 169 |
168 // static | 170 // static |
169 bool Bytecodes::IsJumpConstant(Bytecode bytecode) { | 171 bool Bytecodes::IsJumpConstant(Bytecode bytecode) { |
170 return bytecode == Bytecode::kJumpConstant || | 172 return bytecode == Bytecode::kJumpConstant || |
171 bytecode == Bytecode::kJumpIfTrueConstant || | 173 bytecode == Bytecode::kJumpIfTrueConstant || |
172 bytecode == Bytecode::kJumpIfFalseConstant; | 174 bytecode == Bytecode::kJumpIfFalseConstant || |
| 175 bytecode == Bytecode::kJumpIfToBooleanTrueConstant || |
| 176 bytecode == Bytecode::kJumpIfToBooleanFalseConstant; |
173 } | 177 } |
174 | 178 |
175 | 179 |
176 // static | 180 // static |
177 uint16_t Bytecodes::ShortOperandFromBytes(const uint8_t* bytes) { | 181 uint16_t Bytecodes::ShortOperandFromBytes(const uint8_t* bytes) { |
178 return *reinterpret_cast<const uint16_t*>(bytes); | 182 return *reinterpret_cast<const uint16_t*>(bytes); |
179 } | 183 } |
180 | 184 |
181 | 185 |
182 // static | 186 // static |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } | 329 uint8_t Register::ToOperand() const { return static_cast<uint8_t>(-index_); } |
326 | 330 |
327 | 331 |
328 Register Register::FromOperand(uint8_t operand) { | 332 Register Register::FromOperand(uint8_t operand) { |
329 return Register(-static_cast<int8_t>(operand)); | 333 return Register(-static_cast<int8_t>(operand)); |
330 } | 334 } |
331 | 335 |
332 } // namespace interpreter | 336 } // namespace interpreter |
333 } // namespace internal | 337 } // namespace internal |
334 } // namespace v8 | 338 } // namespace v8 |
OLD | NEW |