Remove JIT native debug info on failed commits.
This could happen if single-implementation assumptions are invalid,
and would result in temporary double entries in JIT debug info.
Test: ./art/test.py -b -r --host --gcstress --jit --32 -t 068
Change-Id: I765c9310b6cc4fa440e4121780f8b9053388bd3d
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 9978a6f..0344fc5 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1295,6 +1295,8 @@
/* has_should_deoptimize_flag= */ false,
cha_single_implementation_list)) {
code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
+ MutexLock mu(self, *Locks::jit_lock_);
+ RemoveNativeDebugInfoForJit(ArrayRef<const void*>(reinterpret_cast<const void**>(&code), 1));
return false;
}
@@ -1403,6 +1405,8 @@
codegen->GetGraph()->HasShouldDeoptimizeFlag(),
codegen->GetGraph()->GetCHASingleImplementationList())) {
code_cache->Free(self, region, reserved_code.data(), reserved_data.data());
+ MutexLock mu(self, *Locks::jit_lock_);
+ RemoveNativeDebugInfoForJit(ArrayRef<const void*>(reinterpret_cast<const void**>(&code), 1));
return false;
}