summaryrefslogtreecommitdiff
path: root/js/src/jit/BaselineCompiler.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-05-21 16:38:37 +0000
committerMoonchild <moonchild@palemoon.org>2022-05-21 16:38:37 +0000
commit2694995e52a0bd767acac74f2306767d0a3720c9 (patch)
treed2a1198ccd0b8eab1b0b589b6900845aa3b87d5b /js/src/jit/BaselineCompiler.cpp
parentf532bbd7af98d2cb543bf86b93b0e0e9fa1e9b2a (diff)
parent00c51f75fa4845f348708a796d552ca281f8210a (diff)
downloaduxp-2694995e52a0bd767acac74f2306767d0a3720c9.tar.gz
Merge branch 'master' into 12101210
Diffstat (limited to 'js/src/jit/BaselineCompiler.cpp')
-rw-r--r--js/src/jit/BaselineCompiler.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
index fd85ec00ed..53254718c0 100644
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -1253,6 +1253,25 @@ BaselineCompiler::emit_JSOP_IFNE()
}
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)
{
bool knownBoolean = frame.peek(-1)->isKnownBoolean();