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/mirror/class.cc b/runtime/mirror/class.cc
index 239105f..74b22c4 100644
--- a/runtime/mirror/class.cc
+++ b/runtime/mirror/class.cc
@@ -252,8 +252,8 @@
// Class.getName: keywords for primitive types, regular "[I" form for primitive arrays (so "int"
// but "[I"), and arrays of reference types written between "L" and ";" but with dots rather than
// slashes (so "java.lang.String" but "[Ljava.lang.String;"). Madness.
-String* Class::ComputeName(Handle<Class> h_this) {
- String* name = h_this->GetName();
+ObjPtr<String> Class::ComputeName(Handle<Class> h_this) {
+ ObjPtr<String> name = h_this->GetName();
if (name != nullptr) {
return name;
}