Fix the line info storage for obfuscated methods

With R8 v3.1.4, the debug information gets removed from the dex
file. Therefore code that has been obfuscated needs to store the
program counter instead of the line number. This is done
similarly to I5ab54620b2bfba1059543696ff7310b8496b1893.

Fixes: 228000954
Test: m -j32 ahat ahat-tests && java -jar out/host/linux-x86/framework/ahat-tests.jar
Test: testrunner.py --host -t 638-no-line-number
Change-Id: I2714aec63288cccd979adc73022e172d9cc993df
diff --git a/runtime/gc/allocation_record.cc b/runtime/gc/allocation_record.cc
index ffd4d2b..7bcf375 100644
--- a/runtime/gc/allocation_record.cc
+++ b/runtime/gc/allocation_record.cc
@@ -32,7 +32,14 @@
 
 int32_t AllocRecordStackTraceElement::ComputeLineNumber() const {
   DCHECK(method_ != nullptr);
-  return method_->GetLineNumFromDexPC(dex_pc_);
+  int32_t line_number = method_->GetLineNumFromDexPC(dex_pc_);
+  if (line_number == -1 && !method_->IsProxyMethod()) {
+    // If we failed to map the dex pc to a line number, then most probably there is no debug info.
+    // Make the line_number same as the dex pc - it can be decoded later using a map file.
+    // See b/30183883 and b/228000954.
+    line_number = static_cast<int32_t>(dex_pc_);
+  }
+  return line_number;
 }
 
 const char* AllocRecord::GetClassDescriptor(std::string* storage) const {