Add Class.getPrimitiveClass().
Implement the native part in ART and remove the native parts
of the previously needed workaround for java.lang.Void.TYPE.
Companion libcore/ change:
https://android-review.googlesource.com/619326
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: Pixel 2 XL boots.
Bug: 73346078
Change-Id: Icfb201a1f08d8ff2a65c58f7c0ec25aa2296db29
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index b5deffb..b9a31e5 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -1134,6 +1134,10 @@
void VisitNativeRoots(Visitor& visitor, PointerSize pointer_size)
REQUIRES_SHARED(Locks::mutator_lock_);
+ // Get one of the primitive classes.
+ static ObjPtr<mirror::Class> GetPrimitiveClass(ObjPtr<mirror::String> name)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+
// When class is verified, set the kAccSkipAccessChecks flag on each method.
void SetSkipAccessChecksFlagOnAllMethods(PointerSize pointer_size)
REQUIRES_SHARED(Locks::mutator_lock_);