mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Optimize away Mov instructions when the source is the destination
This commit is contained in:
parent
192cae17ee
commit
5707076b9e
Notes:
github-actions[bot]
2025-03-28 11:22:15 +00:00
Author: https://github.com/ananas-dev
Commit: 5707076b9e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4134
2 changed files with 66 additions and 53 deletions
|
@ -127,6 +127,18 @@ public:
|
|||
emit_with_extra_slots<OpType, Value>(extra_operand_slots, forward<Args>(args)...);
|
||||
}
|
||||
|
||||
void emit_mov(ScopedOperand const& dst, ScopedOperand const& src)
|
||||
{
|
||||
// Optimize away when the source is the destination
|
||||
if (dst != src)
|
||||
emit<Op::Mov>(dst, src);
|
||||
}
|
||||
|
||||
void emit_mov(Operand const& dst, Operand const& src)
|
||||
{
|
||||
emit<Op::Mov>(dst, src);
|
||||
}
|
||||
|
||||
void emit_jump_if(ScopedOperand const& condition, Label true_target, Label false_target);
|
||||
|
||||
struct ReferenceOperands {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue