ObjPtr<>-ify String allocations, fix stale refs.
ObjPtr<>-ify String allocation functions and related code
and remove some unnecessary calls to ObjPtr<>::Ptr(). Fix
stale reference uses in reference_table_test and stub_test.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: I42927fb8b7240e5132188f73318b2ccb218748fd
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 663af81..5443ace 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -1346,7 +1346,7 @@
JDWP::JdwpError Dbg::CreateString(const std::string& str, JDWP::ObjectId* new_string_id) {
Thread* self = Thread::Current();
- mirror::String* new_string = mirror::String::AllocFromModifiedUtf8(self, str.c_str());
+ ObjPtr<mirror::String> new_string = mirror::String::AllocFromModifiedUtf8(self, str.c_str());
if (new_string == nullptr) {
DCHECK(self->IsExceptionPending());
self->ClearException();