| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode) || | 257 return IsJumpImmediate(bytecode) || IsJumpConstant(bytecode) || |
| 258 IsJumpConstantWide(bytecode); | 258 IsJumpConstantWide(bytecode); |
| 259 } | 259 } |
| 260 | 260 |
| 261 | 261 |
| 262 // static | 262 // static |
| 263 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { | 263 bool Bytecodes::IsJumpOrReturn(Bytecode bytecode) { |
| 264 return bytecode == Bytecode::kReturn || IsJump(bytecode); | 264 return bytecode == Bytecode::kReturn || IsJump(bytecode); |
| 265 } | 265 } |
| 266 | 266 |
| 267 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { | 267 // static |
| 268 return (operand_type == OperandType::kMaybeReg8 || | 268 bool Bytecodes::IsIndexOperandType(OperandType operand_type) { |
| 269 operand_type == OperandType::kMaybeReg16); | 269 return operand_type == OperandType::kIdx8 || |
| 270 operand_type == OperandType::kIdx16; |
| 270 } | 271 } |
| 271 | 272 |
| 273 // static |
| 274 bool Bytecodes::IsImmediateOperandType(OperandType operand_type) { |
| 275 return operand_type == OperandType::kImm8; |
| 276 } |
| 277 |
| 278 // static |
| 272 bool Bytecodes::IsRegisterCountOperandType(OperandType operand_type) { | 279 bool Bytecodes::IsRegisterCountOperandType(OperandType operand_type) { |
| 273 return (operand_type == OperandType::kRegCount8 || | 280 return (operand_type == OperandType::kRegCount8 || |
| 274 operand_type == OperandType::kRegCount16); | 281 operand_type == OperandType::kRegCount16); |
| 275 } | 282 } |
| 276 | 283 |
| 277 // static | 284 // static |
| 285 bool Bytecodes::IsMaybeRegisterOperandType(OperandType operand_type) { |
| 286 return (operand_type == OperandType::kMaybeReg8 || |
| 287 operand_type == OperandType::kMaybeReg16); |
| 288 } |
| 289 |
| 290 // static |
| 278 bool Bytecodes::IsRegisterOperandType(OperandType operand_type) { | 291 bool Bytecodes::IsRegisterOperandType(OperandType operand_type) { |
| 279 switch (operand_type) { | 292 switch (operand_type) { |
| 280 #define CASE(Name, _) \ | 293 #define CASE(Name, _) \ |
| 281 case OperandType::k##Name: \ | 294 case OperandType::k##Name: \ |
| 282 return true; | 295 return true; |
| 283 REGISTER_OPERAND_TYPE_LIST(CASE) | 296 REGISTER_OPERAND_TYPE_LIST(CASE) |
| 284 #undef CASE | 297 #undef CASE |
| 285 #define CASE(Name, _) \ | 298 #define CASE(Name, _) \ |
| 286 case OperandType::k##Name: \ | 299 case OperandType::k##Name: \ |
| 287 break; | 300 break; |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } else { | 592 } else { |
| 580 std::ostringstream s; | 593 std::ostringstream s; |
| 581 s << "r" << index(); | 594 s << "r" << index(); |
| 582 return s.str(); | 595 return s.str(); |
| 583 } | 596 } |
| 584 } | 597 } |
| 585 | 598 |
| 586 } // namespace interpreter | 599 } // namespace interpreter |
| 587 } // namespace internal | 600 } // namespace internal |
| 588 } // namespace v8 | 601 } // namespace v8 |
| OLD | NEW |