Bug 1638246 - [MIPS64] Fix register conflicts in branchValueIsNurseryCellImpl. r=tcampbell
authorZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Tue, 02 Jun 2020 00:55:06 +0000
changeset 533407 4366818635f260996b00deeeddf92346ab7b093e
parent 533406 bcf1957993d59ef5cd3c167817b4a9b0dce47515
child 533408 d50b633463526203bdaa67057ef4c8a245ce24c1
push id37471
push userabutkovits@mozilla.com
push dateTue, 02 Jun 2020 09:35:54 +0000
treeherdermozilla-central@9c1b2859111c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1638246
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1638246 - [MIPS64] Fix register conflicts in branchValueIsNurseryCellImpl. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D77640
js/src/jit/mips64/MacroAssembler-mips64.cpp
--- a/js/src/jit/mips64/MacroAssembler-mips64.cpp
+++ b/js/src/jit/mips64/MacroAssembler-mips64.cpp
@@ -2014,23 +2014,23 @@ void MacroAssembler::branchValueIsNurser
   branchValueIsNurseryCellImpl(cond, value, temp, label);
 }
 
 template <typename T>
 void MacroAssembler::branchValueIsNurseryCellImpl(Condition cond,
                                                   const T& value, Register temp,
                                                   Label* label) {
   MOZ_ASSERT(cond == Assembler::Equal || cond == Assembler::NotEqual);
-  // temp may be InvalidReg, use scratch2 instead.
-  SecondScratchRegisterScope scratch2(*this);
-
   Label done;
   branchTestGCThing(Assembler::NotEqual, value,
                     cond == Assembler::Equal ? &done : label);
 
+  // temp may be InvalidReg, use scratch2 instead.
+  SecondScratchRegisterScope scratch2(*this);
+
   unboxGCThingForGCBarrier(value, scratch2);
   orPtr(Imm32(gc::ChunkMask), scratch2);
   load32(Address(scratch2, gc::ChunkLocationOffsetFromLastByte), scratch2);
   branch32(cond, scratch2, Imm32(int32_t(gc::ChunkLocation::Nursery)), label);
 
   bind(&done);
 }