summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-09-18 01:10:07 -0500
committerMoonchild <moonchild@palemoon.org>2023-09-20 03:34:06 +0200
commitd5cc24e91620a621217210b292a2ec53d6c01f42 (patch)
treeb51a7f1bb7df116190d49220de27641c8d715b2c
parent8eba271c5fed3e81b12db9c455073e1b21b4e7fe (diff)
downloaduxp-d5cc24e91620a621217210b292a2ec53d6c01f42.tar.gz
Issue #2308 & #1240 Follow-up - Fill in missing JSOP_INC/DEC cases for Doubles in Ion.
-rw-r--r--js/src/jit/SharedIC.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/js/src/jit/SharedIC.cpp b/js/src/jit/SharedIC.cpp
index 0afc7e12b5..d337534768 100644
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -1570,12 +1570,8 @@ ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
Label failure;
masm.ensureDouble(R0, FloatReg0, &failure);
- MOZ_ASSERT(op == JSOP_NEG || op == JSOP_BITNOT);
-
- if (op == JSOP_NEG) {
- masm.negateDouble(FloatReg0);
- masm.boxDouble(FloatReg0, R0);
- } else {
+ switch (op) {
+ case JSOP_BITNOT: {
// Truncate the double to an int32.
Register scratchReg = R1.scratchReg();
@@ -1593,6 +1589,24 @@ ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm)
masm.bind(&doneTruncate);
masm.not32(scratchReg);
masm.tagValue(JSVAL_TYPE_INT32, scratchReg, R0);
+ break;
+ }
+ case JSOP_NEG:
+ masm.negateDouble(FloatReg0);
+ masm.boxDouble(FloatReg0, R0);
+ break;
+ case JSOP_INC:
+ case JSOP_DEC:
+ masm.loadConstantDouble(1.0, ScratchDoubleReg);
+ if (op == JSOP_INC) {
+ masm.addDouble(ScratchDoubleReg, FloatReg0);
+ } else {
+ masm.subDouble(ScratchDoubleReg, FloatReg0);
+ }
+ masm.boxDouble(FloatReg0, R0);
+ break;
+ default:
+ MOZ_CRASH("Unexpected op");
}
EmitReturnFromIC(masm);