mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Add bytecode instructions for modulo and exponentiation
This commit is contained in:
parent
6af9d87258
commit
55f0791b13
Notes:
sideshowbarker
2024-07-18 12:41:22 +09:00
Author: https://github.com/gunnarbeutner
Commit: 55f0791b13
Pull-request: https://github.com/SerenityOS/serenity/pull/7882
4 changed files with 66 additions and 0 deletions
|
@ -55,6 +55,12 @@ Optional<Bytecode::Register> BinaryExpression::generate_bytecode(Bytecode::Gener
|
|||
case BinaryOp::Division:
|
||||
generator.emit<Bytecode::Op::Div>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::Modulo:
|
||||
generator.emit<Bytecode::Op::Mod>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::Exponentiation:
|
||||
generator.emit<Bytecode::Op::Exp>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
case BinaryOp::LessThan:
|
||||
generator.emit<Bytecode::Op::LessThan>(dst_reg, *lhs_reg, *rhs_reg);
|
||||
return dst_reg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue