Fix 036-finalizer for JIT-at-first-use gcstress.
The array allocation in the OptimizingCompiler::JitCompile()
can trigger a GC, so calling a method and holding only onto
a WeakReference<> may actually cause the referred object to
be collected. Work around this in the 036-finalizer test by
avoiding the method call when we expect that object to stay
alive.
Strangely, the Heap::CheckGcStressMode() causes the GC for
x86-64 but not for x86 in this test based on the backtrace
comparisons. So the 32-bit test was actually passing.
Test: testrunner.py --host -t 036-finalizer \
--jit --runtime-option=-Xjitthreshold=0
Bug: 62611253
Bug: 76454261
Change-Id: I10eb73beec18c66e4f7f1d125aa9e5db340a9d49
1 file changed