ART: Add arraycopy(byte) to unstarted runtime
The byte-array version is now in use in libcore.
Allows to compile-time initialize:
* java.security.cert.X509CertSelector
* sun.security.pkcs.PKCS9Attribute
* sun.security.provider.certpath.AdaptableX509CertSelector
* sun.security.x509.AccessDescription
* sun.security.x509.AlgorithmId
* sun.security.x509.ExtendedKeyUsageExtension
* sun.security.x509.NetscapeCertTypeExtension
* sun.security.x509.OIDMap
* sun.security.x509.PKIXExtensions
Bug: 27265238
(cherry picked from commit cc44581beacd61a633b02a1223d1bf6fea278f94)
Change-Id: If6b680a455809152c9bd7a679a8ab430936c46a1
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 81be959..2f22ac4 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -427,6 +427,8 @@
dst_pos, src, src_pos, length, true /* throw_exception */);
}
}
+ } else if (src_type->IsPrimitiveByte()) {
+ PrimitiveArrayCopy<uint8_t>(self, src_array, src_pos, dst_array, dst_pos, length);
} else if (src_type->IsPrimitiveChar()) {
PrimitiveArrayCopy<uint16_t>(self, src_array, src_pos, dst_array, dst_pos, length);
} else if (src_type->IsPrimitiveInt()) {
@@ -437,6 +439,12 @@
}
}
+void UnstartedRuntime::UnstartedSystemArraycopyByte(
+ Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
+ // Just forward.
+ UnstartedRuntime::UnstartedSystemArraycopy(self, shadow_frame, result, arg_offset);
+}
+
void UnstartedRuntime::UnstartedSystemArraycopyChar(
Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset) {
// Just forward.
diff --git a/runtime/interpreter/unstarted_runtime_list.h b/runtime/interpreter/unstarted_runtime_list.h
index d669b75..cb614a1 100644
--- a/runtime/interpreter/unstarted_runtime_list.h
+++ b/runtime/interpreter/unstarted_runtime_list.h
@@ -29,6 +29,7 @@
V(VmClassLoaderFindLoadedClass, "java.lang.Class java.lang.VMClassLoader.findLoadedClass(java.lang.ClassLoader, java.lang.String)") \
V(VoidLookupType, "java.lang.Class java.lang.Void.lookupType()") \
V(SystemArraycopy, "void java.lang.System.arraycopy(java.lang.Object, int, java.lang.Object, int, int)") \
+ V(SystemArraycopyByte, "void java.lang.System.arraycopy(byte[], int, byte[], int, int)") \
V(SystemArraycopyChar, "void java.lang.System.arraycopy(char[], int, char[], int, int)") \
V(SystemArraycopyInt, "void java.lang.System.arraycopy(int[], int, int[], int, int)") \
V(SystemGetSecurityManager, "java.lang.SecurityManager java.lang.System.getSecurityManager()") \