Bug 1766225: Save volatile output register before calling post-write barrier. r=jandem

Differential Revision: https://phabricator.services.mozilla.com/D144549
This commit is contained in:
André Bargull 2022-04-25 16:34:03 +00:00
parent 9c9a7d440b
commit 4fba387fcc
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,12 @@
// |jit-test| --ion-offthread-compile=off; --ion-warmup-threshold=1; --ion-gvn=off
gczeal(4)
function a() {}
function b() {
a(Array.prototype.slice.call(arguments, 1, 3));
}
function c() {
b(1, 2);
}
for (i=0 ; i<200; ++i)
c()

View File

@ -11747,6 +11747,9 @@ void CodeGenerator::visitFrameArgumentsSlice(LFrameArgumentsSlice* lir) {
LiveRegisterSet volatileRegs = liveVolatileRegs(lir);
volatileRegs.takeUnchecked(temp);
if (output.volatile_()) {
volatileRegs.addUnchecked(output);
}
masm.PushRegsInMask(volatileRegs);
emitPostWriteBarrier(output);
@ -11916,6 +11919,9 @@ void CodeGenerator::visitInlineArgumentsSlice(LInlineArgumentsSlice* lir) {
LiveRegisterSet volatileRegs = liveVolatileRegs(lir);
volatileRegs.takeUnchecked(temp);
if (output.volatile_()) {
volatileRegs.addUnchecked(output);
}
masm.PushRegsInMask(volatileRegs);
emitPostWriteBarrier(output);