mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #1894 - Part 4: Implement IonMonkey support for nullish coalescing
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1566141
This commit is contained in:
parent
f282a4c05f
commit
5812721809
12 changed files with 123 additions and 16 deletions
|
|
@ -1252,6 +1252,25 @@ BaselineCompiler::emit_JSOP_IFNE()
|
|||
return emitTest(true);
|
||||
}
|
||||
|
||||
bool
|
||||
BaselineCompiler::emit_JSOP_COALESCE() {
|
||||
// COALESCE leaves the original value on the stack.
|
||||
frame.syncStack(0);
|
||||
|
||||
masm.loadValue(frame.addressOfStackValue(frame.peek(-1)), R0);
|
||||
|
||||
Label undefinedOrNull;
|
||||
|
||||
masm.branchTestUndefined(Assembler::Equal, R0, &undefinedOrNull);
|
||||
masm.branchTestNull(Assembler::Equal, R0, &undefinedOrNull);
|
||||
|
||||
jsbytecode* target = pc + GET_JUMP_OFFSET(pc);
|
||||
masm.jump(labelOf(target));
|
||||
|
||||
masm.bind(&undefinedOrNull);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
BaselineCompiler::emitAndOr(bool branchIfTrue)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue