1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:35:08 +00:00

LibJS: Add bytecode ops for <<, >> and >>>

This commit is contained in:
Luke 2021-06-07 20:14:12 +01:00 committed by Andreas Kling
parent 6681415f58
commit 1e10965e61
4 changed files with 100 additions and 1 deletions

View file

@ -99,6 +99,15 @@ Optional<Bytecode::Register> BinaryExpression::generate_bytecode(Bytecode::Gener
case BinaryOp::BitwiseXor:
generator.emit<Bytecode::Op::BitwiseXor>(dst_reg, *lhs_reg, *rhs_reg);
return dst_reg;
case BinaryOp::LeftShift:
generator.emit<Bytecode::Op::LeftShift>(dst_reg, *lhs_reg, *rhs_reg);
return dst_reg;
case BinaryOp::RightShift:
generator.emit<Bytecode::Op::RightShift>(dst_reg, *lhs_reg, *rhs_reg);
return dst_reg;
case BinaryOp::UnsignedRightShift:
generator.emit<Bytecode::Op::UnsignedRightShift>(dst_reg, *lhs_reg, *rhs_reg);
return dst_reg;
default:
TODO();
}