Add AddToDexClassloader JVMTI extension functions

It is useful for some agents to be able to add new classes into an
already existing classloader. This could be used to, for example,
handle new lambdas added during 'edit-and-continue' debugging. This
extension should eliminate the need for agents to reach into
class-loader internals.

These functions are:

'com.android.art.classloader.add_to_dex_class_loader' which has a
signature of jvmtiError(jvmtiEnv* env, jobject classloader, const
char* segment) and will add the given 'segment' file to the
dalvik.system.BaseDexClassLoader 'loader'.

'com.android.art.classloader.add_to_dex_class_loader_in_memory' which
has a signature of jvmtiError(jvmtiEnv* env, jobject classloader,
const unsigned char* dex, jint dex_size) and will add the dexfile
buffer 'dex' to the given dalvik.system.BaseDexClassLoader.

ClassLoaders that do not extend dalvik.system.BaseDexClassLoader are
not supported.

Test: ./test.py --host
Bug: 132699522
Bug: 132914283

Change-Id: I3740af4b3b06b9fa64be8ad94238256b7a43536a
21 files changed