Use ASM for invoke-custom tests

Removes the dependency of binary blobs generated by the jack compiler.

Fixes the exception chain raised when a bootstrap method returns null.

Bug: 73807070
Test: art/test/run-test --host 952-invoke-custom
Change-Id: Iac615cdeec342b1b67f50bb1258768e199adff10
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index a8ab626..380a981 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -1073,7 +1073,7 @@
   Handle<mirror::Object> object(hs.NewHandle(result.GetL()));
   if (UNLIKELY(object.IsNull())) {
     // This will typically be for LambdaMetafactory which is not supported.
-    ThrowNullPointerException("Bootstrap method returned null");
+    ThrowClassCastException("Bootstrap method returned null");
     return nullptr;
   }
 
@@ -1085,11 +1085,10 @@
 
   Handle<mirror::CallSite> call_site =
       hs.NewHandle(ObjPtr<mirror::CallSite>::DownCast(ObjPtr<mirror::Object>(result.GetL())));
-
   // Check the call site target is not null as we're going to invoke it.
   Handle<mirror::MethodHandle> target = hs.NewHandle(call_site->GetTarget());
   if (UNLIKELY(target.IsNull())) {
-    ThrowNullPointerException("Target for call-site is null");
+    ThrowClassCastException("Bootstrap method did not return a callsite");
     return nullptr;
   }
 
diff --git a/test/714-invoke-custom-lambda-metafactory/expected.txt b/test/714-invoke-custom-lambda-metafactory/expected.txt
index 54b6c24..c98a4c2 100644
--- a/test/714-invoke-custom-lambda-metafactory/expected.txt
+++ b/test/714-invoke-custom-lambda-metafactory/expected.txt
@@ -1,5 +1,5 @@
 Exception in thread "main" java.lang.BootstrapMethodError: Exception from call site #0 bootstrap method
 	at Main.main(Main.java:25)
-Caused by: java.lang.NullPointerException: Bootstrap method returned null
+Caused by: java.lang.ClassCastException: Bootstrap method returned null
 	... 1 more
 exit status: 1
diff --git a/test/952-invoke-custom/build b/test/952-invoke-custom/build
old mode 100644
new mode 100755
index 2b0b2c1..2caca94
--- a/test/952-invoke-custom/build
+++ b/test/952-invoke-custom/build
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright 2016 The Android Open Source Project
+# Copyright 2018 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,4 +17,36 @@
 # make us exit on a failure
 set -e
 
-./default-build "$@" --experimental method-handles
+ASM_JAR="${ANDROID_BUILD_TOP}/prebuilts/misc/common/asm/asm-6.0.jar"
+INTERMEDIATE_CLASSES=classes-intermediate
+CLASSES=classes
+
+DEXER="${DX:-dx}"
+if [ "${USE_D8=false}" = "true" ]; then
+  DEXER="${ANDROID_HOST_OUT}/bin/d8-compat-dx"
+fi
+
+# Create directory for intermediate classes
+rm -rf "${INTERMEDIATE_CLASSES}"
+mkdir "${INTERMEDIATE_CLASSES}"
+
+# Generate intermediate classes that will allow transform to be applied to test classes
+JAVAC_ARGS="${JAVAC_ARGS} -source 1.8 -target 1.8 -cp ${ASM_JAR}"
+${JAVAC:-javac} ${JAVAC_ARGS} -d ${INTERMEDIATE_CLASSES} $(find src -name '*.java')
+
+# Create directory for transformed classes
+rm -rf "${CLASSES}"
+mkdir "${CLASSES}"
+
+# Run transform
+for class in ${INTERMEDIATE_CLASSES}/*.class ; do
+  transformed_class=${CLASSES}/$(basename ${class})
+  ${JAVA:-java} -cp "${ASM_JAR}:${INTERMEDIATE_CLASSES}" transformer.IndyTransformer ${class} ${transformed_class}
+done
+
+# Create DEX
+DX_FLAGS="${DX_FLAGS} --min-sdk-version=26 --debug --dump-width=1000"
+${DEXER} -JXmx256m --dex ${DX_FLAGS} --dump-to=${CLASSES}.lst --output=classes.dex ${CLASSES}
+
+# Zip DEX to file name expected by test runner
+zip ${TEST_NAME:-classes-dex}.jar classes.dex
diff --git a/test/952-invoke-custom/expected.txt b/test/952-invoke-custom/expected.txt
index bb87296..61793d1 100644
--- a/test/952-invoke-custom/expected.txt
+++ b/test/952-invoke-custom/expected.txt
@@ -1,13 +1,13 @@
 Caught exception from uninitialized call site
 Caught exception from uninitialized call site
 linkerMethod failure type 1
-Returning null instead of CallSite for add (int,int)int
+Returning null instead of CallSite for _add (int,int)int
 linkerMethod failure type 2
 Throwing InstantiationException in linkerMethod()
 linkerMethod failure type 3
 Throwing ArithmeticException in add()
 Failure Type + 0 (1013)
-Linking add (int,int)int
+Linking _add (int,int)int
 100
 -9000
 9000
diff --git a/test/952-invoke-custom/generator/TestInvokeCustomWithConcurrentThreads.java b/test/952-invoke-custom/generator/TestInvokeCustomWithConcurrentThreads.java
deleted file mode 100644
index 9c0645b..0000000
--- a/test/952-invoke-custom/generator/TestInvokeCustomWithConcurrentThreads.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import com.android.jack.annotations.CalledByInvokeCustom;
-import com.android.jack.annotations.Constant;
-import com.android.jack.annotations.LinkerMethodHandle;
-import com.android.jack.annotations.MethodHandleKind;
-
-import java.lang.invoke.CallSite;
-import java.lang.invoke.ConstantCallSite;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-
-import java.lang.Thread;
-import java.lang.ThreadLocal;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.CyclicBarrier;
-
-public class TestInvokeCustomWithConcurrentThreads extends Thread {
-  private static final int NUMBER_OF_THREADS = 16;
-
-  private static final AtomicInteger nextIndex = new AtomicInteger(0);
-
-  private static final ThreadLocal<Integer> threadIndex =
-      new ThreadLocal<Integer>() {
-        @Override
-        protected Integer initialValue() {
-          return nextIndex.getAndIncrement();
-        }
-      };
-
-  // Array of call sites instantiated, one per thread
-  private static final CallSite[] instantiated = new CallSite[NUMBER_OF_THREADS];
-
-  // Array of counters for how many times each instantiated call site is called
-  private static final AtomicInteger[] called = new AtomicInteger[NUMBER_OF_THREADS];
-
-  // Array of call site indicies of which call site a thread invoked
-  private static final AtomicInteger[] targetted = new AtomicInteger[NUMBER_OF_THREADS];
-
-  // Synchronization barrier all threads will wait on in the bootstrap method.
-  private static final CyclicBarrier barrier = new CyclicBarrier(NUMBER_OF_THREADS);
-
-  private TestInvokeCustomWithConcurrentThreads() {}
-
-  private static int getThreadIndex() {
-    return threadIndex.get().intValue();
-  }
-
-  public static int notUsed(int x) {
-    return x;
-  }
-
-  @Override
-  public void run() {
-    int x = setCalled(-1 /* argument dropped */);
-    notUsed(x);
-  }
-
-  @CalledByInvokeCustom(
-      invokeMethodHandle = @LinkerMethodHandle(kind = MethodHandleKind.INVOKE_STATIC,
-          enclosingType = TestInvokeCustomWithConcurrentThreads.class,
-          name = "linkerMethod",
-          argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class}),
-      name = "setCalled",
-      returnType = int.class,
-      argumentTypes = {int.class})
-  private static int setCalled(int index) {
-    called[index].getAndIncrement();
-    targetted[getThreadIndex()].set(index);
-    return 0;
-  }
-
-  @SuppressWarnings("unused")
-  private static CallSite linkerMethod(MethodHandles.Lookup caller,
-                                       String name,
-                                       MethodType methodType) throws Throwable {
-    int threadIndex = getThreadIndex();
-    MethodHandle mh =
-        caller.findStatic(TestInvokeCustomWithConcurrentThreads.class, name, methodType);
-    assertEquals(methodType, mh.type());
-    assertEquals(mh.type().parameterCount(), 1);
-    mh = MethodHandles.insertArguments(mh, 0, threadIndex);
-    mh = MethodHandles.dropArguments(mh, 0, int.class);
-    assertEquals(mh.type().parameterCount(), 1);
-    assertEquals(methodType, mh.type());
-
-    // Wait for all threads to be in this method.
-    // Multiple call sites should be created, but only one
-    // invoked.
-    barrier.await();
-
-    instantiated[getThreadIndex()] = new ConstantCallSite(mh);
-    return instantiated[getThreadIndex()];
-  }
-
-  public static void test() throws Throwable {
-    // Initialize counters for which call site gets invoked
-    for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-      called[i] = new AtomicInteger(0);
-      targetted[i] = new AtomicInteger(0);
-    }
-
-    // Run threads that each invoke-custom the call site
-    Thread [] threads = new Thread[NUMBER_OF_THREADS];
-    for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-      threads[i] = new TestInvokeCustomWithConcurrentThreads();
-      threads[i].start();
-    }
-
-    // Wait for all threads to complete
-    for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-      threads[i].join();
-    }
-
-    // Check one call site instance won
-    int winners = 0;
-    int votes = 0;
-    for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-      assertNotEquals(instantiated[i], null);
-      if (called[i].get() != 0) {
-        winners++;
-        votes += called[i].get();
-      }
-    }
-
-    System.out.println("Winners " + winners + " Votes " + votes);
-
-    // We assert this below but output details when there's an error as
-    // it's non-deterministic.
-    if (winners != 1) {
-      System.out.println("Threads did not the same call-sites:");
-      for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-        System.out.format(" Thread % 2d invoked call site instance #%02d\n",
-                          i, targetted[i].get());
-      }
-    }
-
-    // We assert this below but output details when there's an error as
-    // it's non-deterministic.
-    if (votes != NUMBER_OF_THREADS) {
-      System.out.println("Call-sites invocations :");
-      for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
-        System.out.format(" Call site instance #%02d was invoked % 2d times\n",
-                          i, called[i].get());
-      }
-    }
-
-    assertEquals(winners, 1);
-    assertEquals(votes, NUMBER_OF_THREADS);
-  }
-
-  public static void assertTrue(boolean value) {
-    if (!value) {
-      throw new AssertionError("assertTrue value: " + value);
-    }
-  }
-
-  public static void assertEquals(byte b1, byte b2) {
-    if (b1 == b2) { return; }
-    throw new AssertionError("assertEquals b1: " + b1 + ", b2: " + b2);
-  }
-
-  public static void assertEquals(char c1, char c2) {
-    if (c1 == c2) { return; }
-    throw new AssertionError("assertEquals c1: " + c1 + ", c2: " + c2);
-  }
-
-  public static void assertEquals(short s1, short s2) {
-    if (s1 == s2) { return; }
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-
-  public static void assertEquals(int i1, int i2) {
-    if (i1 == i2) { return; }
-    throw new AssertionError("assertEquals i1: " + i1 + ", i2: " + i2);
-  }
-
-  public static void assertEquals(long l1, long l2) {
-    if (l1 == l2) { return; }
-    throw new AssertionError("assertEquals l1: " + l1 + ", l2: " + l2);
-  }
-
-  public static void assertEquals(float f1, float f2) {
-    if (f1 == f2) { return; }
-    throw new AssertionError("assertEquals f1: " + f1 + ", f2: " + f2);
-  }
-
-  public static void assertEquals(double d1, double d2) {
-    if (d1 == d2) { return; }
-    throw new AssertionError("assertEquals d1: " + d1 + ", d2: " + d2);
-  }
-
-  public static void assertEquals(Object o, Object p) {
-    if (o == p) { return; }
-    if (o != null && p != null && o.equals(p)) { return; }
-    throw new AssertionError("assertEquals: o1: " + o + ", o2: " + p);
-  }
-
-  public static void assertNotEquals(Object o, Object p) {
-    if (o != p) { return; }
-    if (o != null && p != null && !o.equals(p)) { return; }
-    throw new AssertionError("assertNotEquals: o1: " + o + ", o2: " + p);
-  }
-
-  public static void assertEquals(String s1, String s2) {
-    if (s1 == s2) {
-      return;
-    }
-
-    if (s1 != null && s2 != null && s1.equals(s2)) {
-      return;
-    }
-
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-}
diff --git a/test/952-invoke-custom/generator/TestLinkerMethodMinimalArguments.java b/test/952-invoke-custom/generator/TestLinkerMethodMinimalArguments.java
deleted file mode 100644
index 93d96a9..0000000
--- a/test/952-invoke-custom/generator/TestLinkerMethodMinimalArguments.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import com.android.jack.annotations.CalledByInvokeCustom;
-import com.android.jack.annotations.Constant;
-import com.android.jack.annotations.LinkerMethodHandle;
-import com.android.jack.annotations.MethodHandleKind;
-
-import java.lang.invoke.CallSite;
-import java.lang.invoke.ConstantCallSite;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-
-public class TestLinkerMethodMinimalArguments {
-
-  private static int forceFailureType = 0;
-
-  private static int FAILURE_TYPE_NONE = 0;
-  private static int FAILURE_TYPE_LINKER_METHOD_RETURNS_NULL = 1;
-  private static int FAILURE_TYPE_LINKER_METHOD_THROWS = 2;
-  private static int FAILURE_TYPE_TARGET_METHOD_THROWS = 3;
-
-  @CalledByInvokeCustom(
-      invokeMethodHandle = @LinkerMethodHandle(
-          kind = MethodHandleKind.INVOKE_STATIC,
-          enclosingType = TestLinkerMethodMinimalArguments.class,
-          argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class},
-          name = "linkerMethod"),
-      name = "add",
-      returnType = int.class,
-      argumentTypes = {int.class, int.class})
-  private static int add(int a, int b) {
-    if (forceFailureType == FAILURE_TYPE_TARGET_METHOD_THROWS) {
-      System.out.println("Throwing ArithmeticException in add()");
-      throw new ArithmeticException("add");
-    }
-    return a + b;
-  }
-
-  @SuppressWarnings("unused")
-  private static CallSite linkerMethod(MethodHandles.Lookup caller, String name,
-                                       MethodType methodType) throws Throwable {
-    System.out.println("linkerMethod failure type " + forceFailureType);
-    MethodHandle mh_add =
-        caller.findStatic(TestLinkerMethodMinimalArguments.class, name, methodType);
-    if (forceFailureType == FAILURE_TYPE_LINKER_METHOD_RETURNS_NULL) {
-      System.out.println("Returning null instead of CallSite for " + name + " " + methodType);
-      return null;
-    } else if (forceFailureType == FAILURE_TYPE_LINKER_METHOD_THROWS) {
-      System.out.println("Throwing InstantiationException in linkerMethod()");
-      throw new InstantiationException("linkerMethod");
-    } else {
-      return new ConstantCallSite(mh_add);
-    }
-  }
-
-  public static void test(int failureType, int x, int y) throws Throwable {
-    assertTrue(failureType >= FAILURE_TYPE_NONE);
-    assertTrue(failureType <= FAILURE_TYPE_TARGET_METHOD_THROWS);
-    forceFailureType = failureType;
-    assertEquals(x + y, add(x, y));
-    System.out.println("Failure Type + " + failureType + " (" + x + y+ ")");
-  }
-
-  public static void assertTrue(boolean value) {
-    if (!value) {
-      throw new AssertionError("assertTrue value: " + value);
-    }
-  }
-
-  public static void assertEquals(byte b1, byte b2) {
-    if (b1 == b2) { return; }
-    throw new AssertionError("assertEquals b1: " + b1 + ", b2: " + b2);
-  }
-
-  public static void assertEquals(char c1, char c2) {
-    if (c1 == c2) { return; }
-    throw new AssertionError("assertEquals c1: " + c1 + ", c2: " + c2);
-  }
-
-  public static void assertEquals(short s1, short s2) {
-    if (s1 == s2) { return; }
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-
-  public static void assertEquals(int i1, int i2) {
-    if (i1 == i2) { return; }
-    throw new AssertionError("assertEquals i1: " + i1 + ", i2: " + i2);
-  }
-
-  public static void assertEquals(long l1, long l2) {
-    if (l1 == l2) { return; }
-    throw new AssertionError("assertEquals l1: " + l1 + ", l2: " + l2);
-  }
-
-  public static void assertEquals(float f1, float f2) {
-    if (f1 == f2) { return; }
-    throw new AssertionError("assertEquals f1: " + f1 + ", f2: " + f2);
-  }
-
-  public static void assertEquals(double d1, double d2) {
-    if (d1 == d2) { return; }
-    throw new AssertionError("assertEquals d1: " + d1 + ", d2: " + d2);
-  }
-
-  public static void assertEquals(Object o, Object p) {
-    if (o == p) { return; }
-    if (o != null && p != null && o.equals(p)) { return; }
-    throw new AssertionError("assertEquals: o1: " + o + ", o2: " + p);
-  }
-
-  public static void assertEquals(String s1, String s2) {
-    if (s1 == s2) {
-      return;
-    }
-
-    if (s1 != null && s2 != null && s1.equals(s2)) {
-      return;
-    }
-
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-}
diff --git a/test/952-invoke-custom/generator/TestLinkerMethodMultipleArgumentTypes.java b/test/952-invoke-custom/generator/TestLinkerMethodMultipleArgumentTypes.java
deleted file mode 100644
index 4e4d97e..0000000
--- a/test/952-invoke-custom/generator/TestLinkerMethodMultipleArgumentTypes.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2016 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import com.android.jack.annotations.CalledByInvokeCustom;
-import com.android.jack.annotations.Constant;
-import com.android.jack.annotations.LinkerMethodHandle;
-import com.android.jack.annotations.MethodHandleKind;
-
-import java.lang.invoke.CallSite;
-import java.lang.invoke.ConstantCallSite;
-import java.lang.invoke.MethodHandle;
-import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-
-public class TestLinkerMethodMultipleArgumentTypes {
-
-  private static int bootstrapRunCount = 0;
-
-  @CalledByInvokeCustom(
-      invokeMethodHandle = @LinkerMethodHandle(kind = MethodHandleKind.INVOKE_STATIC,
-          enclosingType = TestLinkerMethodMultipleArgumentTypes.class,
-          name = "linkerMethod",
-          argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class,
-                           boolean.class, byte.class, char.class, short.class, int.class,
-                           float.class, double.class, String.class, Class.class, long.class}),
-      methodHandleExtraArgs = {@Constant(booleanValue = true), @Constant(byteValue = 1),
-                         @Constant(charValue = 'a'), @Constant(shortValue = 1024),
-                         @Constant(intValue = 1), @Constant(floatValue = 11.1f),
-                         @Constant(doubleValue = 2.2), @Constant(stringValue = "Hello"),
-                         @Constant(classValue = TestLinkerMethodMultipleArgumentTypes.class),
-                         @Constant(longValue = 123456789L)},
-      name = "add",
-      returnType = int.class,
-      argumentTypes = {int.class, int.class})
-  private static int add(int a, int b) {
-    return a + b;
-  }
-
-  @SuppressWarnings("unused")
-  private static CallSite linkerMethod(MethodHandles.Lookup caller, String name,
-                                       MethodType methodType, boolean v1, byte v2, char v3,
-                                       short v4, int v5, float v6, double v7,
-                                       String v8, Class<?> v9, long v10) throws Throwable {
-    System.out.println("Linking " + name + " " + methodType);
-    assertTrue(v1);
-    assertEquals(1, v2);
-    assertEquals('a', v3);
-    assertEquals(1024, v4);
-    assertEquals(1, v5);
-    assertEquals(11.1f, v6);
-    assertEquals(2.2, v7);
-    assertEquals("Hello", v8);
-    assertEquals(TestLinkerMethodMultipleArgumentTypes.class, v9);
-    assertEquals(123456789L, v10);
-    MethodHandle mh_add =
-        caller.findStatic(TestLinkerMethodMultipleArgumentTypes.class, name, methodType);
-    return new ConstantCallSite(mh_add);
-  }
-
-  public int GetBootstrapRunCount() {
-    return bootstrapRunCount;
-  }
-
-  public static void test(int x, int y) throws Throwable {
-    assertEquals(x + y, add(x, y));
-    System.out.println(x + y);
-  }
-
-  public static void assertTrue(boolean value) {
-    if (!value) {
-      throw new AssertionError("assertTrue value: " + value);
-    }
-  }
-
-  public static void assertEquals(byte b1, byte b2) {
-    if (b1 == b2) { return; }
-    throw new AssertionError("assertEquals b1: " + b1 + ", b2: " + b2);
-  }
-
-  public static void assertEquals(char c1, char c2) {
-    if (c1 == c2) { return; }
-    throw new AssertionError("assertEquals c1: " + c1 + ", c2: " + c2);
-  }
-
-  public static void assertEquals(short s1, short s2) {
-    if (s1 == s2) { return; }
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-
-  public static void assertEquals(int i1, int i2) {
-    if (i1 == i2) { return; }
-    throw new AssertionError("assertEquals i1: " + i1 + ", i2: " + i2);
-  }
-
-  public static void assertEquals(long l1, long l2) {
-    if (l1 == l2) { return; }
-    throw new AssertionError("assertEquals l1: " + l1 + ", l2: " + l2);
-  }
-
-  public static void assertEquals(float f1, float f2) {
-    if (f1 == f2) { return; }
-    throw new AssertionError("assertEquals f1: " + f1 + ", f2: " + f2);
-  }
-
-  public static void assertEquals(double d1, double d2) {
-    if (d1 == d2) { return; }
-    throw new AssertionError("assertEquals d1: " + d1 + ", d2: " + d2);
-  }
-
-  public static void assertEquals(Object o, Object p) {
-    if (o == p) { return; }
-    if (o != null && p != null && o.equals(p)) { return; }
-    throw new AssertionError("assertEquals: o1: " + o + ", o2: " + p);
-  }
-
-  public static void assertEquals(String s1, String s2) {
-    if (s1 == s2) {
-      return;
-    }
-
-    if (s1 != null && s2 != null && s1.equals(s2)) {
-      return;
-    }
-
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-}
diff --git a/test/952-invoke-custom/generator/build-test.sh b/test/952-invoke-custom/generator/build-test.sh
deleted file mode 100755
index d1d8221..0000000
--- a/test/952-invoke-custom/generator/build-test.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Set up prog to be the path of this script, including following symlinks,
-# and set up progdir to be the fully-qualified pathname of its directory.
-prog="$0"
-args="$@"
-while [ -h "${prog}" ]; do
-  newProg=`/bin/ls -ld "${prog}"`
-  newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
-  if expr "x${newProg}" : 'x/' >/dev/null; then
-      prog="${newProg}"
-  else
-    progdir=`dirname "${prog}"`
-    prog="${progdir}/${newProg}"
-  fi
-done
-oldwd=`pwd`
-progdir=`dirname "${prog}"`
-cd "${progdir}"
-progdir=`pwd`
-prog="${progdir}"/`basename "${prog}"`
-test_dir="test-$$"
-if [ -z "$TMPDIR" ]; then
-  tmp_dir="/tmp/$USER/${test_dir}"
-else
-  tmp_dir="${TMPDIR}/${test_dir}"
-fi
-
-if [ "x$ANDROID_BUILD_TOP" = "x" ]; then
-  echo Build environment is not set-up.
-  exit -1
-fi
-
-# This only works internally for now (sorry folks!)
-jack_annotations_lib=/google/data/rw/teams/android-runtime/jack/jack-test-annotations-lib.jack
-if [ ! -f $jack_annotations_lib ]; then
-  echo Try 'prodaccess' to access android-runtime directory.
-  exit -1
-fi
-
-# Compile test into a base64 string that can be instantiated via
-# reflection on hosts without the jack-test-annotations-lib.jack file.
-mkdir $tmp_dir
-for input_file in $progdir/*.java; do
-  i=${input_file##*/Test}
-  i=${i%%.java}
-  src_file=$progdir/Test$i.java
-  jack_file=./src.jack
-  dex_file=./classes.dex
-  base_64_file=$tmp_dir/TestData$i.base64
-  output_file=$progdir/../src/TestData$i.java
-  # Compile source file to jack file.
-  jack -g -cp $ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jack:$ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jack:$jack_annotations_lib -D sched.runner=multi-threaded -D sched.runner.thread.kind=fixed -D sched.runner.thread.fixed.count=4 -D jack.java.source.version=1.7 -D jack.android.min-api-level=o-b2 --output-jack $jack_file $src_file
-  # Compile jack file to classes.dex.
-  jack -g -cp $ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jack:$ANDROID_BUILD_TOP/out/host/linux-x86/../common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jack -D sched.runner=multi-threaded -D sched.runner.thread.kind=fixed -D sched.runner.thread.fixed.count=4 -D jack.java.source.version=1.7 -D jack.android.min-api-level=o-b2 --import $jack_file --output-dex .
-  # Pack the classes.dex file into a base64 string.
-  base64 -w 72 $dex_file > $base_64_file
-  # Emit a managed source file containing the base64 string. The test can be
-  # run by loading this string as a dex file and invoking it via reflection.
-cat > $output_file <<HEADER
-/* Generated by ${prog##*/} from ${src_file##*/} */
-public class TestData$i {
-  public static final String BASE64_DEX_FILE =
-HEADER
-sed -e 's/^\(.*\)$/    "\1" +/' -e '$s/ +/;/' $base_64_file >> $output_file
-cat >> $output_file <<FOOTER
-}
-FOOTER
-  rm $dex_file $jack_file
-done
-
-rm -rf $tmp_dir
diff --git a/test/952-invoke-custom/info.txt b/test/952-invoke-custom/info.txt
index 2954e55..1dce686 100644
--- a/test/952-invoke-custom/info.txt
+++ b/test/952-invoke-custom/info.txt
@@ -1,9 +1 @@
-A test that is only available as a DEX binary.
-
-This tests execution of invoke-custom. There is no bytecode to emit
-invoke-custom directly. This test is generated using an internal only jack file.
-
-Internal developers MUST regenerate the test data files after editing
-the tests under generator/ using:
-
-$ generator/build-tests.sh
+Tests the invoke-custom bytecode.
diff --git a/test/952-invoke-custom/src-art/Main.java b/test/952-invoke-custom/src-art/Main.java
deleted file mode 100644
index 2abc312..0000000
--- a/test/952-invoke-custom/src-art/Main.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import dalvik.system.InMemoryDexClassLoader;
-
-import java.lang.invoke.CallSite;
-import java.lang.invoke.MethodType;
-import java.lang.invoke.MutableCallSite;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.util.Base64;
-
-// This test is a stop-gap until we have support for generating invoke-custom
-// in the Android tree.
-
-public class Main {
-
-  private static void TestUninitializedCallSite() throws Throwable {
-    CallSite callSite = new MutableCallSite(MethodType.methodType(int.class));
-    try {
-      callSite.getTarget().invoke();
-      fail();
-    } catch (IllegalStateException e) {
-      System.out.println("Caught exception from uninitialized call site");
-    }
-
-    callSite = new MutableCallSite(MethodType.methodType(String.class, int.class, char.class));
-    try {
-      callSite.getTarget().invoke(1535, 'd');
-      fail();
-    } catch (IllegalStateException e) {
-      System.out.println("Caught exception from uninitialized call site");
-    }
-  }
-
-  private static void TestLinkerMethodMultipleArgumentTypes() throws Throwable {
-    // This is a more comprehensive test of invoke-custom, the linker
-    // method takes additional arguments of types boolean, byte, char,
-    // short, int, float, double, String, Class, and long (in this order)
-    // The test asserts the values passed to the linker method match their
-    // expected values.
-    byte[] base64Data = TestDataLinkerMethodMultipleArgumentTypes.BASE64_DEX_FILE.getBytes();
-    Base64.Decoder decoder = Base64.getDecoder();
-    ByteBuffer dexBuffer = ByteBuffer.wrap(decoder.decode(base64Data));
-
-    InMemoryDexClassLoader classLoader =
-        new InMemoryDexClassLoader(dexBuffer,
-                                   ClassLoader.getSystemClassLoader());
-    Class<?> testClass =
-        classLoader.loadClass("TestLinkerMethodMultipleArgumentTypes");
-    Method testMethod = testClass.getDeclaredMethod("test", int.class, int.class);
-    // First invocation should link via the bootstrap method (outputs "Linking add" ...).
-    testMethod.invoke(null, 33, 67);
-    // Subsequent invocations use the cached value of the CallSite and do not require linking.
-    testMethod.invoke(null, -10000, +1000);
-    testMethod.invoke(null, -1000, +10000);
-  }
-
-  private static void TestLinkerMethodMinimalArguments() throws Throwable {
-    // This test checks various failures when running the linker
-    // method and during invocation of the method handle.
-    byte[] base64Data = TestDataLinkerMethodMinimalArguments.BASE64_DEX_FILE.getBytes();
-    Base64.Decoder decoder = Base64.getDecoder();
-    ByteBuffer dexBuffer = ByteBuffer.wrap(decoder.decode(base64Data));
-
-    InMemoryDexClassLoader classLoader =
-        new InMemoryDexClassLoader(dexBuffer,
-                                   ClassLoader.getSystemClassLoader());
-    Class<?> testClass =
-        classLoader.loadClass("TestLinkerMethodMinimalArguments");
-    Method testMethod = testClass.getDeclaredMethod("test", int.class, int.class, int.class);
-
-    try {
-      testMethod.invoke(null, 1 /* linker method return null */, 10, 10);
-    } catch (InvocationTargetException e) {
-      assertEquals(e.getCause().getClass().getName(), "java.lang.BootstrapMethodError");
-      assertEquals(
-          e.getCause().getCause().getClass().getName(), "java.lang.NullPointerException");
-    }
-
-    try {
-      testMethod.invoke(null, 2 /* linker method throw InstantiationException */, 10, 11);
-    } catch (InvocationTargetException e) {
-      assertEquals(e.getCause().getClass().getName(), "java.lang.BootstrapMethodError");
-      assertEquals(
-          e.getCause().getCause().getClass().getName(), "java.lang.InstantiationException");
-    }
-    try {
-      // Creating the CallSite works here, but fail invoking the method.
-      testMethod.invoke(null, 3 /* target throw NPE */, 10, 12);
-    } catch (InvocationTargetException e) {
-      assertEquals(e.getCause().getClass().getName(), "java.lang.ArithmeticException");
-    }
-
-    // This should succeed using already resolved CallSite.
-    testMethod.invoke(null, 0 /* no error */, 10, 13);
-  }
-
-  private static void TestInvokeCustomWithConcurrentThreads() throws Throwable {
-    // This is a concurrency test that attempts to run invoke-custom on the same
-    // call site.
-    byte[] base64Data = TestDataInvokeCustomWithConcurrentThreads.BASE64_DEX_FILE.getBytes();
-    Base64.Decoder decoder = Base64.getDecoder();
-    ByteBuffer dexBuffer = ByteBuffer.wrap(decoder.decode(base64Data));
-
-    InMemoryDexClassLoader classLoader =
-        new InMemoryDexClassLoader(dexBuffer,
-                                   ClassLoader.getSystemClassLoader());
-    Class<?> testClass =
-        classLoader.loadClass("TestInvokeCustomWithConcurrentThreads");
-    Method testMethod = testClass.getDeclaredMethod("test");
-    testMethod.invoke(null);
-  }
-
-  public static void assertEquals(Object o, Object p) {
-    if (o == p) { return; }
-    if (o != null && p != null && o.equals(p)) { return; }
-    throw new AssertionError("assertEquals: o1: " + o + ", o2: " + p);
-  }
-
-  public static void assertEquals(String s1, String s2) {
-    if (s1 == s2) {
-      return;
-    }
-
-    if (s1 != null && s2 != null && s1.equals(s2)) {
-      return;
-    }
-
-    throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
-  }
-
-  private static void fail() {
-    System.out.println("fail");
-    Thread.dumpStack();
-  }
-
-  public static void main(String[] args) throws Throwable {
-    TestUninitializedCallSite();
-    TestLinkerMethodMinimalArguments();
-    TestLinkerMethodMultipleArgumentTypes();
-    TestInvokeCustomWithConcurrentThreads();
-  }
-}
\ No newline at end of file
diff --git a/test/952-invoke-custom/src-art/TestDataInvokeCustomWithConcurrentThreads.java b/test/952-invoke-custom/src-art/TestDataInvokeCustomWithConcurrentThreads.java
deleted file mode 100644
index 076acd7..0000000
--- a/test/952-invoke-custom/src-art/TestDataInvokeCustomWithConcurrentThreads.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Generated by build-test.sh from TestInvokeCustomWithConcurrentThreads.java */
-public class TestDataInvokeCustomWithConcurrentThreads {
-  public static final String BASE64_DEX_FILE =
-    "ZGV4CjAzOABWCyocbwmvY62Y5O92LHrb3B/jTa9jHG0IHgAAcAAAAHhWNBIAAAAAAAAAACAd" +
-    "AACrAAAAcAAAACsAAAAcAwAAJQAAAMgDAAAKAAAAhAUAADkAAADUBQAAAgAAAKAHAAAgFgAA" +
-    "6AcAAMARAADzEQAAIxIAACwSAAA0EgAAPBIAAEQSAABMEgAAVBIAAFwSAABkEgAAbBIAAHMS" +
-    "AAB2EgAAgBIAAIgSAACMEgAAjxIAAJISAACsEgAArxIAALISAAC1EgAAuRIAAMgSAADLEgAA" +
-    "zhIAANISAADWEgAA2hIAAN4SAADiEgAA5hIAAOwSAADxEgAA9xIAACITAABLEwAATxMAAIQT" +
-    "AAC3EwAA6BMAAAwUAAAsFAAATxQAAG4UAACKFAAAoRQAAL0UAADQFAAA5RQAAPkUAAANFQAA" +
-    "KBUAADwVAABQFQAAaBUAAIEVAACYFQAAtRUAANoVAAD7FQAAJBYAAEYWAABlFgAAixYAALgW" +
-    "AADLFgAAzhYAANQWAAAAFwAAJhcAACkXAAAuFwAAMxcAADgXAAA9FwAAQRcAAEYXAABLFwAA" +
-    "TxcAAFQXAABZFwAAXRcAAGcXAABqFwAAbhcAAIIXAACXFwAArBcAAMoXAAD4FwAABRgAAA0Y" +
-    "AAAcGAAAKhgAAD0YAABQGAAAYxgAAHYYAACJGAAAnBgAAK8YAADDGAAA1BgAAOsYAAD3GAAA" +
-    "CxkAABIZAAAWGQAAGhkAACMZAAAnGQAAKxkAADMZAAA7GQAAPxkAAEMZAABSGQAAZhkAAHUZ" +
-    "AAB9GQAAgRkAAIUZAACRGQAAmRkAAJ4ZAACvGQAAvxkAAMIZAADGGQAAyhkAANEZAADfGQAA" +
-    "8BkAAP4ZAAAIGgAAHBoAACIaAAAoGgAALBoAADAaAAA+GgAAShoAAE4aAABUGgAAXxoAAGga" +
-    "AABrGgAAcBoAAHMaAACDGgAAjBoAAJgaAACdGgAAoRoAAKUaAACqGgAAtRoAALwaAADHGgAA" +
-    "zRoAANMaAADgGgAA6RoAAPMaAAD5GgAAABsAAAkbAAAQGwAAGRsAABAAAAARAAAAEwAAABQA" +
-    "AAAVAAAAGAAAACMAAAAkAAAAJgAAACcAAAAoAAAAKQAAACoAAAArAAAALAAAAC0AAAAuAAAA" +
-    "LwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA4AAAAOQAAADoAAAA7AAAAPAAAAD0A" +
-    "AAA+AAAAPwAAAEAAAABBAAAAQwAAAEcAAABUAAAAVgAAAFcAAABYAAAAWQAAAFoAAAAVAAAA" +
-    "BAAAAAAAAAAWAAAABAAAAPgQAAAhAAAAEAAAAAARAAAZAAAAEwAAAAAAAAAdAAAAEwAAAPgQ" +
-    "AAAZAAAAFAAAAAAAAAAZAAAAFQAAAAAAAAAaAAAAFgAAAAgRAAAbAAAAFgAAABARAAAcAAAA" +
-    "FgAAABgRAAAdAAAAFgAAAPgQAAAeAAAAFgAAACARAAAfAAAAFgAAACgRAAAfAAAAFgAAADAR" +
-    "AAAlAAAAFgAAADgRAAAiAAAAGwAAAEARAAAiAAAAHQAAAEwRAAAgAAAAHQAAAFgRAAAgAAAA" +
-    "HQAAAGQRAAAZAAAAIAAAAAAAAAAZAAAAIgAAAAAAAABHAAAAJAAAAAAAAABIAAAAJAAAAHAR" +
-    "AABJAAAAJAAAAHgRAABKAAAAJAAAAIARAABLAAAAJAAAAIgRAABMAAAAJAAAAPgQAABNAAAA" +
-    "JAAAAJARAABOAAAAJAAAAJgRAABPAAAAJAAAACgRAABQAAAAJAAAAKARAABPAAAAJAAAADAR" +
-    "AABQAAAAJAAAAKgRAABPAAAAJAAAALARAABRAAAAJAAAALgRAABSAAAAJAAAADgRAABVAAAA" +
-    "JQAAACgRAAAHAAQAQgAAAAcAIQBuAAAABwAqAHEAAAAHACkAhgAAAAcAIgCRAAAABwAqAJ8A" +
-    "AAAHABkAogAAAAoACgAXAAAAEwASAEQAAAAXABAAlAAAAAYAFQAOAAAABgADAIQAAAAGAAUA" +
-    "hAAAAAcAFAALAAAABwAVAA0AAAAHABUADgAAAAcAFgBeAAAABwAXAF4AAAAHABgAXgAAAAcA" +
-    "GQBeAAAABwAbAF4AAAAHABwAXgAAAAcAHgBeAAAABwAgAF4AAAAHACIAXgAAAAcAHgBnAAAA" +
-    "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" +
-    "dEludm9rZUN1c3RvbVdpdGhDb25jdXJyZW50VGhyZWFkcyQxOwAnTFRlc3RJbnZva2VDdXN0" +
-    "b21XaXRoQ29uY3VycmVudFRocmVhZHM7AAJMWgAzTGNvbS9hbmRyb2lkL2phY2svYW5ub3Rh" +
-    "dGlvbnMvQ2FsbGVkQnlJbnZva2VDdXN0b207ADFMY29tL2FuZHJvaWQvamFjay9hbm5vdGF0" +
-    "aW9ucy9MaW5rZXJNZXRob2RIYW5kbGU7AC9MY29tL2FuZHJvaWQvamFjay9hbm5vdGF0aW9u" +
-    "cy9NZXRob2RIYW5kbGVLaW5kOwAiTGRhbHZpay9hbm5vdGF0aW9uL0VuY2xvc2luZ0NsYXNz" +
-    "OwAeTGRhbHZpay9hbm5vdGF0aW9uL0lubmVyQ2xhc3M7ACFMZGFsdmlrL2Fubm90YXRpb24v" +
-    "TWVtYmVyQ2xhc3NlczsAHUxkYWx2aWsvYW5ub3RhdGlvbi9TaWduYXR1cmU7ABpMZGFsdmlr" +
-    "L2Fubm90YXRpb24vVGhyb3dzOwAVTGphdmEvaW8vUHJpbnRTdHJlYW07ABpMamF2YS9sYW5n" +
-    "L0Fzc2VydGlvbkVycm9yOwARTGphdmEvbGFuZy9DbGFzczsAE0xqYXZhL2xhbmcvSW50ZWdl" +
-    "cjsAEkxqYXZhL2xhbmcvT2JqZWN0OwASTGphdmEvbGFuZy9TdHJpbmc7ABlMamF2YS9sYW5n" +
-    "L1N0cmluZ0J1aWxkZXI7ABJMamF2YS9sYW5nL1N5c3RlbTsAEkxqYXZhL2xhbmcvVGhyZWFk" +
-    "OwAWTGphdmEvbGFuZy9UaHJlYWRMb2NhbAAXTGphdmEvbGFuZy9UaHJlYWRMb2NhbDsAFUxq" +
-    "YXZhL2xhbmcvVGhyb3dhYmxlOwAbTGphdmEvbGFuZy9pbnZva2UvQ2FsbFNpdGU7ACNMamF2" +
-    "YS9sYW5nL2ludm9rZS9Db25zdGFudENhbGxTaXRlOwAfTGphdmEvbGFuZy9pbnZva2UvTWV0" +
-    "aG9kSGFuZGxlOwAnTGphdmEvbGFuZy9pbnZva2UvTWV0aG9kSGFuZGxlcyRMb29rdXA7ACBM" +
-    "amF2YS9sYW5nL2ludm9rZS9NZXRob2RIYW5kbGVzOwAdTGphdmEvbGFuZy9pbnZva2UvTWV0" +
-    "aG9kVHlwZTsAJExqYXZhL3V0aWwvY29uY3VycmVudC9DeWNsaWNCYXJyaWVyOwArTGphdmEv" +
-    "dXRpbC9jb25jdXJyZW50L2F0b21pYy9BdG9taWNJbnRlZ2VyOwARTlVNQkVSX09GX1RIUkVB" +
-    "RFMAAVMABFRZUEUAKlRlc3RJbnZva2VDdXN0b21XaXRoQ29uY3VycmVudFRocmVhZHMuamF2" +
-    "YQAkVGhyZWFkcyBkaWQgbm90IHRoZSBzYW1lIGNhbGwtc2l0ZXM6AAFWAANWQkIAA1ZDQwAD" +
-    "VkREAANWRkYAAlZJAANWSUkAA1ZKSgACVkwAA1ZMTAADVlNTAAJWWgAIV2lubmVycyAAAVoA" +
-    "AlpMABJbTGphdmEvbGFuZy9DbGFzczsAE1tMamF2YS9sYW5nL09iamVjdDsAE1tMamF2YS9s" +
-    "YW5nL1RocmVhZDsAHFtMamF2YS9sYW5nL2ludm9rZS9DYWxsU2l0ZTsALFtMamF2YS91dGls" +
-    "L2NvbmN1cnJlbnQvYXRvbWljL0F0b21pY0ludGVnZXI7AAthY2Nlc3NGbGFncwAGYXBwZW5k" +
-    "AA1hcmd1bWVudFR5cGVzAAxhc3NlcnRFcXVhbHMAEWFzc2VydEVxdWFscyBiMTogABFhc3Nl" +
-    "cnRFcXVhbHMgYzE6IAARYXNzZXJ0RXF1YWxzIGQxOiAAEWFzc2VydEVxdWFscyBmMTogABFh" +
-    "c3NlcnRFcXVhbHMgaTE6IAARYXNzZXJ0RXF1YWxzIGwxOiAAEWFzc2VydEVxdWFscyBzMTog" +
-    "ABJhc3NlcnRFcXVhbHM6IG8xOiAAD2Fzc2VydE5vdEVxdWFscwAVYXNzZXJ0Tm90RXF1YWxz" +
-    "OiBvMTogAAphc3NlcnRUcnVlABJhc3NlcnRUcnVlIHZhbHVlOiAABWF3YWl0AAJiMQACYjIA" +
-    "B2JhcnJpZXIAAmMxAAJjMgAGY2FsbGVkAAZjYWxsZXIAAmQxAAJkMgANZHJvcEFyZ3VtZW50" +
-    "cwASZW1pdHRlcjogamFjay00LjI1AA1lbmNsb3NpbmdUeXBlAAZlcXVhbHMAAmYxAAJmMgAK" +
-    "ZmluZFN0YXRpYwAGZm9ybWF0AANnZXQAD2dldEFuZEluY3JlbWVudAAOZ2V0VGhyZWFkSW5k" +
-    "ZXgAAWkAAmkxAAJpMgAFaW5kZXgADGluaXRpYWxWYWx1ZQAPaW5zZXJ0QXJndW1lbnRzAAxp" +
-    "bnN0YW50aWF0ZWQACGludFZhbHVlABJpbnZva2VNZXRob2RIYW5kbGUABGpvaW4ABGtpbmQA" +
-    "AmwxAAJsMgAMbGlua2VyTWV0aG9kAAptZXRob2RUeXBlAAJtaAAEbmFtZQAJbmV4dEluZGV4" +
-    "AAdub3RVc2VkAAFvAANvdXQAAXAADnBhcmFtZXRlckNvdW50AAdwcmludGxuAApyZXR1cm5U" +
-    "eXBlAANydW4AAnMxAAJzMgADc2V0AAlzZXRDYWxsZWQABXN0YXJ0AAl0YXJnZXR0ZWQABHRl" +
-    "c3QABHRoaXMAC3RocmVhZEluZGV4AAd0aHJlYWRzAAh0b1N0cmluZwAEdHlwZQAFdmFsdWUA" +
-    "B3ZhbHVlT2YABXZvdGVzAAd3aW5uZXJzAAF4ACcABw4CWjsAKgAHDgAoAAcOACQAByyJWDVN" +
-    "TU0CaXcAOgAHDgCuAQJtbgcOPACzAQJwcQcOPADMAQJ0dQcOWgDHAQJ6ewcOWgC9AQKCAYMB" +
-    "Bw48AMIBAowBjQEHDloA0QEClAGWAQcOPLQA3QECmwGcAQcOLSClIAC4AQKbAZwBBw48ANcB" +
-    "ApQBlgEHDjzSAKgBAacBBw4tARoQAD0ABw4AXANzkQGPAQcsTAMBowEFaQMAkAEeeLTDpbR8" +
-    "W9IAQQGrAQcOAFMBhAEHDni0AHEAB1kBAQMAgQEFLZaTQS0DAaQBKTx4V0E8WEAeAwOqAQUe" +
-    "AwKpAQU8h6UtkUMBJBIthzx4ARQNOkMthzx4ARQNOkE8PABGAAcOWgMAqwEFPAACCwGmARgH" +
-    "AgwCWwQIkAEeAg4BpgEcBBc3FwwXMRcPAg0BpgEcARgGAg8BpgEcARgaAAgEXRwBGASIARwB" +
-    "HQkEXRwDGB4YFRggdxgHigEbB5ABF42QARedmAEYBAEEEAMWABedFQEAAAECAICABJgQAQSw" +
-    "EAHEINwQBwATAQAaARoBGgEaARoBGgEaA4gg+BABiIAEkBEBgoAE7BEBCYQSAQnkEgEJxBMB" +
-    "CagUAQmMFQEJ7BUBCdAWAQnIFwEJwBgBCaAZAQmcGgEK6BoBCpQbAQnoHAIK/BwBCbQdFAGU" +
-    "IQAAABMAAAAAAAAAAQAAAAAAAAABAAAAqwAAAHAAAAACAAAAKwAAABwDAAADAAAAJQAAAMgD" +
-    "AAAEAAAACgAAAIQFAAAFAAAAOQAAANQFAAAHAAAAAQAAAJwHAAAGAAAAAgAAAKAHAAAIAAAA" +
-    "AQAAAOAHAAADEAAABQAAAOgHAAABIAAAFwAAABgIAAAGIAAAAgAAALgQAAABEAAAFwAAAPgQ" +
-    "AAACIAAAqwAAAMARAAADIAAAFgAAABwbAAAEIAAABgAAAD0cAAAFIAAAAgAAAJkcAAAAIAAA" +
-    "AgAAAKMcAAAAEAAAAQAAACAdAAA=";
-}
diff --git a/test/952-invoke-custom/src-art/TestDataLinkerMethodMinimalArguments.java b/test/952-invoke-custom/src-art/TestDataLinkerMethodMinimalArguments.java
deleted file mode 100644
index 443a7af..0000000
--- a/test/952-invoke-custom/src-art/TestDataLinkerMethodMinimalArguments.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Generated by build-test.sh from TestLinkerMethodMinimalArguments.java */
-public class TestDataLinkerMethodMinimalArguments {
-  public static final String BASE64_DEX_FILE =
-    "ZGV4CjAzOADnZpVEc25JsNXLCW+vh64OuLf8RymAuINwFQAAcAAAAHhWNBIAAAAAAAAAAIgU" +
-    "AACBAAAAcAAAAB0AAAB0AgAAHAAAAOgCAAAHAAAAOAQAACIAAABwBAAAAQAAAIQFAADEDwAA" +
-    "rAUAAKAMAACjDAAApwwAAKoMAACyDAAAugwAAMIMAADKDAAA0gwAANoMAADiDAAA6gwAAPQM" +
-    "AAD8DAAA/wwAAAINAAAFDQAACA0AADENAABUDQAAZw0AAIoNAACbDQAAng0AAKMNAACyDQAA" +
-    "tQ0AALgNAAC8DQAAwA0AAMQNAADIDQAAzA0AANANAADWDQAA+g0AAP4NAAAzDgAAZg4AAJcO" +
-    "AACzDgAAyg4AAOsOAAAHDwAAGg8AAD4PAABSDwAAZg8AAIEPAACVDwAArA8AAMkPAADuDwAA" +
-    "DxAAADgQAABXEAAAgBAAAIMQAACqEAAA0RAAAAQRAAAHEQAADBEAABERAAAWEQAAGxEAACAR" +
-    "AAAmEQAAKxEAAC8RAAA0EQAAOREAAD0RAABAEQAARBEAAEcRAABMEQAAVBEAAGMRAABxEQAA" +
-    "hBEAAJcRAACqEQAAvREAANARAADjEQAA9hEAAAoSAAAWEgAAKhIAAC0SAAAxEgAANRIAADkS" +
-    "AAA9EgAARRIAAEkSAABNEgAAYRIAAHASAAB4EgAAfBIAAIASAACNEgAAmRIAAKsSAACvEgAA" +
-    "sxIAAMcSAADNEgAA0RIAANUSAADjEgAA/xIAAAsTAAATEwAAGRMAABwTAAAhEwAAJBMAAC0T" +
-    "AAA5EwAAPRMAAEETAABHEwAATRMAAFcTAABeEwAAYRMAAA0AAAAOAAAADwAAABAAAAAWAAAA" +
-    "GQAAACIAAAAkAAAAJQAAACYAAAAnAAAAKAAAACkAAAAqAAAAKwAAACwAAAAtAAAALgAAAC8A" +
-    "AAAwAAAAMQAAADIAAAAzAAAANAAAADUAAAA2AAAAOAAAADwAAABIAAAAFwAAAAQAAADsCwAA" +
-    "GgAAABEAAAAAAAAAGwAAABIAAAD0CwAAHAAAABIAAAD8CwAAHQAAABIAAAAEDAAAHgAAABIA" +
-    "AAAMDAAAHwAAABIAAAAUDAAAIAAAABIAAAAcDAAAIAAAABIAAAAkDAAAIwAAABIAAAAsDAAA" +
-    "IQAAABUAAAA0DAAAIQAAABcAAABADAAAPAAAABsAAAAAAAAAPQAAABsAAABMDAAAPgAAABsA" +
-    "AABUDAAAPwAAABsAAABcDAAAQAAAABsAAABkDAAAQQAAABsAAADsCwAAQgAAABsAAABsDAAA" +
-    "QwAAABsAAAB4DAAARAAAABsAAAAcDAAARQAAABsAAACADAAARAAAABsAAAAkDAAARQAAABsA" +
-    "AACIDAAARAAAABsAAACQDAAARgAAABsAAACYDAAARwAAABsAAAAsDAAASQAAABwAAAAcDAAA" +
-    "BgAEABEAAAAGAAQAEgAAAAYABAATAAAABgAEABQAAAAGAAQAaAAAAAkACQAYAAAAEwALAHUA" +
-    "AAAGAAwACwAAAAYADAAMAAAABgAAAEsAAAAGAA0ATgAAAAYADgBOAAAABgAPAE4AAAAGABAA" +
-    "TgAAAAYAEQBOAAAABgATAE4AAAAGABUATgAAAAYAFwBOAAAABgAZAE4AAAAGABoAVwAAAAYA" +
-    "CgBvAAAABgASAHsAAAALABYAdwAAAAwAFgAMAAAADQAUAAwAAAAPABYADAAAABAADAAMAAAA" +
-    "EAAbAGMAAAARABsAYwAAABIADAAMAAAAEgACAEwAAAASAAMATAAAABIABABMAAAAEgAFAEwA" +
-    "AAASAAYATAAAABIABwBMAAAAEgAIAEwAAAASAAkATAAAABIAAQB9AAAAFgAYAAwAAAAYAAsA" +
-    "ZwAAADIUAAAGAAAAAQAAABAAAAAAAAAAOQAAAMQLAAA5FAAAAAAAAAQAAAANAAAAAQAAAAIU" +
-    "AAABAAAAKhQAAAEAAAAAAAAAZBMAAA8AAAASAGcABABnAAIAEhBnAAAAEiBnAAEAEjBnAAMA" +
-    "DgAAAAEAAQABAAAAcBMAAAQAAABwEBMAAAAOAAQAAgACAAAAdRMAABoAAABgAAQAYAEDADMQ" +
-    "EwBiAAYAGwE6AAAAbiAPABAAIgAMABsBSwAAAHAgEAAQACcAkAACAw8ABQACAAIAAAB/EwAA" +
-    "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" +
-    "KQAGLCBiMjogAAYsIGMyOiAABiwgZDI6IAAGLCBmMjogAAYsIGkyOiAABiwgbDI6IAAGLCBv" +
-    "MjogAAYsIHMyOiAACDxjbGluaXQ+AAY8aW5pdD4AAUIAAUMAAUQAAUYAJ0ZBSUxVUkVfVFlQ" +
-    "RV9MSU5LRVJfTUVUSE9EX1JFVFVSTlNfTlVMTAAhRkFJTFVSRV9UWVBFX0xJTktFUl9NRVRI" +
-    "T0RfVEhST1dTABFGQUlMVVJFX1RZUEVfTk9ORQAhRkFJTFVSRV9UWVBFX1RBUkdFVF9NRVRI" +
-    "T0RfVEhST1dTAA9GYWlsdXJlIFR5cGUgKyAAAUkAA0lJSQANSU5WT0tFX1NUQVRJQwABSgAB" +
-    "TAACTEMAAkxEAAJMRgACTEkAAkxKAAJMTAAETExMTAAiTFRlc3RMaW5rZXJNZXRob2RNaW5p" +
-    "bWFsQXJndW1lbnRzOwACTFoAM0xjb20vYW5kcm9pZC9qYWNrL2Fubm90YXRpb25zL0NhbGxl" +
-    "ZEJ5SW52b2tlQ3VzdG9tOwAxTGNvbS9hbmRyb2lkL2phY2svYW5ub3RhdGlvbnMvTGlua2Vy" +
-    "TWV0aG9kSGFuZGxlOwAvTGNvbS9hbmRyb2lkL2phY2svYW5ub3RhdGlvbnMvTWV0aG9kSGFu" +
-    "ZGxlS2luZDsAGkxkYWx2aWsvYW5ub3RhdGlvbi9UaHJvd3M7ABVMamF2YS9pby9QcmludFN0" +
-    "cmVhbTsAH0xqYXZhL2xhbmcvQXJpdGhtZXRpY0V4Y2VwdGlvbjsAGkxqYXZhL2xhbmcvQXNz" +
-    "ZXJ0aW9uRXJyb3I7ABFMamF2YS9sYW5nL0NsYXNzOwAiTGphdmEvbGFuZy9JbnN0YW50aWF0" +
-    "aW9uRXhjZXB0aW9uOwASTGphdmEvbGFuZy9PYmplY3Q7ABJMamF2YS9sYW5nL1N0cmluZzsA" +
-    "GUxqYXZhL2xhbmcvU3RyaW5nQnVpbGRlcjsAEkxqYXZhL2xhbmcvU3lzdGVtOwAVTGphdmEv" +
-    "bGFuZy9UaHJvd2FibGU7ABtMamF2YS9sYW5nL2ludm9rZS9DYWxsU2l0ZTsAI0xqYXZhL2xh" +
-    "bmcvaW52b2tlL0NvbnN0YW50Q2FsbFNpdGU7AB9MamF2YS9sYW5nL2ludm9rZS9NZXRob2RI" +
-    "YW5kbGU7ACdMamF2YS9sYW5nL2ludm9rZS9NZXRob2RIYW5kbGVzJExvb2t1cDsAHUxqYXZh" +
-    "L2xhbmcvaW52b2tlL01ldGhvZFR5cGU7ACdSZXR1cm5pbmcgbnVsbCBpbnN0ZWFkIG9mIENh" +
-    "bGxTaXRlIGZvciAAAVMAJVRlc3RMaW5rZXJNZXRob2RNaW5pbWFsQXJndW1lbnRzLmphdmEA" +
-    "JVRocm93aW5nIEFyaXRobWV0aWNFeGNlcHRpb24gaW4gYWRkKCkAMVRocm93aW5nIEluc3Rh" +
-    "bnRpYXRpb25FeGNlcHRpb24gaW4gbGlua2VyTWV0aG9kKCkAAVYAA1ZCQgADVkNDAANWREQA" +
-    "A1ZGRgADVklJAARWSUlJAANWSkoAAlZMAANWTEwAA1ZTUwACVloAAVoAAlpMAAFhAANhZGQA" +
-    "BmFwcGVuZAANYXJndW1lbnRUeXBlcwAMYXNzZXJ0RXF1YWxzABFhc3NlcnRFcXVhbHMgYjE6" +
-    "IAARYXNzZXJ0RXF1YWxzIGMxOiAAEWFzc2VydEVxdWFscyBkMTogABFhc3NlcnRFcXVhbHMg" +
-    "ZjE6IAARYXNzZXJ0RXF1YWxzIGkxOiAAEWFzc2VydEVxdWFscyBsMTogABFhc3NlcnRFcXVh" +
-    "bHMgczE6IAASYXNzZXJ0RXF1YWxzOiBvMTogAAphc3NlcnRUcnVlABJhc3NlcnRUcnVlIHZh" +
-    "bHVlOiAAAWIAAmIxAAJiMgACYzEAAmMyAAZjYWxsZXIAAmQxAAJkMgASZW1pdHRlcjogamFj" +
-    "ay00LjI1AA1lbmNsb3NpbmdUeXBlAAZlcXVhbHMAAmYxAAJmMgALZmFpbHVyZVR5cGUACmZp" +
-    "bmRTdGF0aWMAEGZvcmNlRmFpbHVyZVR5cGUAAmkxAAJpMgASaW52b2tlTWV0aG9kSGFuZGxl" +
-    "AARraW5kAAJsMQACbDIADGxpbmtlck1ldGhvZAAabGlua2VyTWV0aG9kIGZhaWx1cmUgdHlw" +
-    "ZSAACm1ldGhvZFR5cGUABm1oX2FkZAAEbmFtZQABbwADb3V0AAFwAAdwcmludGxuAApyZXR1" +
-    "cm5UeXBlAAJzMQACczIABHRlc3QABHRoaXMACHRvU3RyaW5nAAV2YWx1ZQABeAABeQAeAAcd" +
-    "Li08PAJ5OwAcAAcOAC8CS1oHDmmHlwBWAltcBw48AFsCXV4HDjwAdAJgYQcOWgBvAmVmBw5a" +
-    "AGUCamsHDjwAagJubwcOWgB5AnV3Bw48tAB/Anp7Bw4tIKUgAGACensHDjwAUAF/Bw4tARoQ" +
-    "ADkDX3RyBw4BGxBpAwBzGGkBJA8taYeXAEgDZ4ABgQEHLId4LZYBLw8CeywtAAAHBE0cAhgE" +
-    "GARrHAEdCARNHAMYGBgRGBliGAZsGwVzF29zF0t4GAQCCgF+HAEYFAMWABdLFQAFAA8AAAoB" +
-    "CgEKAQoBCgCIgAS8CwGBgATsCwEKhAwBCcgMAQmoDQEJiA4BCewOAQnQDwEJsBABCZQRAQmM" +
-    "EgEJhBMBCeQTAQqwFAEJlBYAEwAAAAAAAAABAAAAAAAAAAEAAACBAAAAcAAAAAIAAAAdAAAA" +
-    "dAIAAAMAAAAcAAAA6AIAAAQAAAAHAAAAOAQAAAUAAAAiAAAAcAQAAAcAAAABAAAAgAUAAAYA" +
-    "AAABAAAAhAUAAAgAAAABAAAApAUAAAMQAAACAAAArAUAAAEgAAAPAAAAvAUAAAYgAAABAAAA" +
-    "xAsAAAEQAAAVAAAA7AsAAAIgAACBAAAAoAwAAAMgAAAPAAAAZBMAAAQgAAACAAAAAhQAAAUg" +
-    "AAABAAAAMhQAAAAgAAABAAAAORQAAAAQAAABAAAAiBQAAA==";
-}
diff --git a/test/952-invoke-custom/src-art/TestDataLinkerMethodMultipleArgumentTypes.java b/test/952-invoke-custom/src-art/TestDataLinkerMethodMultipleArgumentTypes.java
deleted file mode 100644
index b96e184..0000000
--- a/test/952-invoke-custom/src-art/TestDataLinkerMethodMultipleArgumentTypes.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Generated by build-test.sh from TestLinkerMethodMultipleArgumentTypes.java */
-public class TestDataLinkerMethodMultipleArgumentTypes {
-  public static final String BASE64_DEX_FILE =
-    "ZGV4CjAzOADmj8ccx56N3pWZ9IunuZvI0eWD+wmFmSnEFQAAcAAAAHhWNBIAAAAAAAAAANwU" +
-    "AACTAAAAcAAAAB0AAAC8AgAAHQAAADADAAADAAAAjAQAACIAAACkBAAAAQAAALgFAADkDwAA" +
-    "4AUAAEQMAABHDAAASgwAAFIMAABaDAAAYgwAAGoMAAByDAAAegwAAIIMAACKDAAAkgwAAJwM" +
-    "AACkDAAApwwAAKoMAACtDAAAsAwAAMYMAADNDAAA0AwAANUMAADkDAAA5wwAAOoMAADuDAAA" +
-    "8gwAAPYMAAD6DAAA/gwAAAINAAAIDQAAGA0AAEENAABFDQAAeg0AAKMNAADWDQAABw4AACYO" +
-    "AABCDgAATA4AAGMOAAB/DgAAkQ4AAKQOAAC6DgAAzg4AAOIOAAD9DgAAEQ8AACgPAABFDwAA" +
-    "ag8AAIsPAAC0DwAA0w8AANYPAAACEAAABRAAAAoQAAAPEAAAFBAAABkQAAAdEAAAIhAAACcQ" +
-    "AAArEAAAMBAAADUQAAA5EAAAPBAAAEUQAABJEAAATBAAAFEQAABZEAAAaBAAAHYQAACJEAAA" +
-    "nBAAAK8QAADCEAAA1RAAAOgQAAD7EAAADxEAABsRAAAvEQAAMhEAADYRAAA6EQAASBEAAFsR" +
-    "AABmEQAAahEAAG4RAAB2EQAAgREAAI0RAACREQAAlREAAKIRAAC2EQAAxREAAM0RAADREQAA" +
-    "1REAAOERAADtEQAA8REAAPURAAD/EQAAExIAABkSAAAdEgAAIRIAAC8SAAA6EgAAURIAAF0S" +
-    "AABlEgAAaxIAAG4SAABzEgAAdhIAAH8SAACLEgAAjxIAAJMSAACfEgAArBIAALISAAC4EgAA" +
-    "whIAAMYSAADLEgAAzxIAANMSAADXEgAA2xIAAN8SAADjEgAA5xIAAOsSAADyEgAA9RIAAA0A" +
-    "AAAOAAAADwAAABAAAAATAAAAFgAAACAAAAAiAAAAIwAAACQAAAAlAAAAJgAAACcAAAApAAAA" +
-    "KgAAACwAAAAuAAAALwAAADAAAAAxAAAAMgAAADMAAAA0AAAANQAAADYAAAA3AAAAOAAAADoA" +
-    "AABGAAAAEwAAAAQAAAAAAAAAFAAAAAQAAACICwAAFwAAABEAAAAAAAAAGAAAABIAAACQCwAA" +
-    "GQAAABIAAACYCwAAGgAAABIAAACgCwAAGwAAABIAAACoCwAAHAAAABIAAACwCwAAHQAAABIA" +
-    "AAC4CwAAHQAAABIAAADACwAAIQAAABIAAADICwAAHwAAABUAAADQCwAAHgAAABcAAADwCwAA" +
-    "OgAAABsAAAAAAAAAOwAAABsAAAD8CwAAPAAAABsAAAAEDAAAPQAAABsAAAAMDAAAPgAAABsA" +
-    "AAAUDAAAPwAAABsAAACoCwAAQAAAABsAAACICwAAQQAAABsAAAAcDAAAQgAAABsAAAC4CwAA" +
-    "QwAAABsAAAAkDAAAQgAAABsAAADACwAAQwAAABsAAAAsDAAAQgAAABsAAAA0DAAARAAAABsA" +
-    "AAA8DAAARQAAABsAAADICwAASAAAABwAAAC4CwAABgAEAFwAAAAKAAoAFQAAABMADQB7AAAA" +
-    "BgANAAsAAAAGAA0ADAAAAAYAAAARAAAABgABAEoAAAAGAA4ATQAAAAYADwBNAAAABgAQAE0A" +
-    "AAAGABEATQAAAAYAEwBNAAAABgAUAE0AAAAGABYATQAAAAYAGABNAAAABgAaAE0AAAAGABsA" +
-    "VgAAAAYACwB0AAAABgATAIMAAAANABIAfQAAAA0AFwB9AAAADgAVAAwAAAAQAA0ADAAAABAA" +
-    "HABoAAAAEQAcAGgAAAASAA0ADAAAABIAAwBLAAAAEgAEAEsAAAASAAUASwAAABIABgBLAAAA" +
-    "EgAHAEsAAAASAAgASwAAABIACQBLAAAAEgAKAEsAAAASAAIAhQAAABYAGQAMAAAAGAAMAGsA" +
-    "AABpFAAABgAAAAEAAAAQAAAAAAAAADkAAABgCwAAkhQAAAAAAAAEAAAADgAAAAEAAACpEwAA" +
-    "AgAAAEcUAABgFAAAAQAAAGAUAAABAAAAAAAAAPgSAAAEAAAAEgBnAAAADgABAAEAAQAAAP4S" +
-    "AAAEAAAAcBATAAAADgADAAIAAAAAAAMTAAADAAAAkAABAg8AAAAFAAIAAgAAAAoTAAAoAAAA" +
-    "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" +
-    "QwABRAABRgAUR2V0Qm9vdHN0cmFwUnVuQ291bnQABUhlbGxvAAFJAANJSUkADUlOVk9LRV9T" +
-    "VEFUSUMAAUoAAUwAAkxDAAJMRAACTEYAAkxJAAJMSgACTEwABExMTEwADkxMTExaQkNTSUZE" +
-    "TExKACdMVGVzdExpbmtlck1ldGhvZE11bHRpcGxlQXJndW1lbnRUeXBlczsAAkxaADNMY29t" +
-    "L2FuZHJvaWQvamFjay9hbm5vdGF0aW9ucy9DYWxsZWRCeUludm9rZUN1c3RvbTsAJ0xjb20v" +
-    "YW5kcm9pZC9qYWNrL2Fubm90YXRpb25zL0NvbnN0YW50OwAxTGNvbS9hbmRyb2lkL2phY2sv" +
-    "YW5ub3RhdGlvbnMvTGlua2VyTWV0aG9kSGFuZGxlOwAvTGNvbS9hbmRyb2lkL2phY2svYW5u" +
-    "b3RhdGlvbnMvTWV0aG9kSGFuZGxlS2luZDsAHUxkYWx2aWsvYW5ub3RhdGlvbi9TaWduYXR1" +
-    "cmU7ABpMZGFsdmlrL2Fubm90YXRpb24vVGhyb3dzOwAITGlua2luZyAAFUxqYXZhL2lvL1By" +
-    "aW50U3RyZWFtOwAaTGphdmEvbGFuZy9Bc3NlcnRpb25FcnJvcjsAEExqYXZhL2xhbmcvQ2xh" +
-    "c3MAEUxqYXZhL2xhbmcvQ2xhc3M7ABRMamF2YS9sYW5nL0NsYXNzPCo+OwASTGphdmEvbGFu" +
-    "Zy9PYmplY3Q7ABJMamF2YS9sYW5nL1N0cmluZzsAGUxqYXZhL2xhbmcvU3RyaW5nQnVpbGRl" +
-    "cjsAEkxqYXZhL2xhbmcvU3lzdGVtOwAVTGphdmEvbGFuZy9UaHJvd2FibGU7ABtMamF2YS9s" +
-    "YW5nL2ludm9rZS9DYWxsU2l0ZTsAI0xqYXZhL2xhbmcvaW52b2tlL0NvbnN0YW50Q2FsbFNp" +
-    "dGU7AB9MamF2YS9sYW5nL2ludm9rZS9NZXRob2RIYW5kbGU7ACdMamF2YS9sYW5nL2ludm9r" +
-    "ZS9NZXRob2RIYW5kbGVzJExvb2t1cDsAHUxqYXZhL2xhbmcvaW52b2tlL01ldGhvZFR5cGU7" +
-    "AAFTACpUZXN0TGlua2VyTWV0aG9kTXVsdGlwbGVBcmd1bWVudFR5cGVzLmphdmEAAVYAA1ZC" +
-    "QgADVkNDAANWREQAA1ZGRgACVkkAA1ZJSQADVkpKAAJWTAADVkxMAANWU1MAAlZaAAFaAAda" +
-    "QkNTSUZEAAJaTAABYQADYWRkAAZhcHBlbmQADWFyZ3VtZW50VHlwZXMADGFzc2VydEVxdWFs" +
-    "cwARYXNzZXJ0RXF1YWxzIGIxOiAAEWFzc2VydEVxdWFscyBjMTogABFhc3NlcnRFcXVhbHMg" +
-    "ZDE6IAARYXNzZXJ0RXF1YWxzIGYxOiAAEWFzc2VydEVxdWFscyBpMTogABFhc3NlcnRFcXVh" +
-    "bHMgbDE6IAARYXNzZXJ0RXF1YWxzIHMxOiAAEmFzc2VydEVxdWFsczogbzE6IAAKYXNzZXJ0" +
-    "VHJ1ZQASYXNzZXJ0VHJ1ZSB2YWx1ZTogAAFiAAJiMQACYjIADGJvb2xlYW5WYWx1ZQARYm9v" +
-    "dHN0cmFwUnVuQ291bnQACWJ5dGVWYWx1ZQACYzEAAmMyAAZjYWxsZXIACWNoYXJWYWx1ZQAK" +
-    "Y2xhc3NWYWx1ZQACZDEAAmQyAAtkb3VibGVWYWx1ZQASZW1pdHRlcjogamFjay00LjI1AA1l" +
-    "bmNsb3NpbmdUeXBlAAZlcXVhbHMAAmYxAAJmMgAKZmluZFN0YXRpYwAKZmxvYXRWYWx1ZQAC" +
-    "aTEAAmkyAAhpbnRWYWx1ZQASaW52b2tlTWV0aG9kSGFuZGxlAARraW5kAAJsMQACbDIADGxp" +
-    "bmtlck1ldGhvZAAJbG9uZ1ZhbHVlABVtZXRob2RIYW5kbGVFeHRyYUFyZ3MACm1ldGhvZFR5" +
-    "cGUABm1oX2FkZAAEbmFtZQABbwADb3V0AAFwAAdwcmludGxuAApyZXR1cm5UeXBlAAJzMQAC" +
-    "czIACnNob3J0VmFsdWUAC3N0cmluZ1ZhbHVlAAR0ZXN0AAR0aGlzAAh0b1N0cmluZwACdjEA" +
-    "A3YxMAACdjIAAnYzAAJ2NAACdjUAAnY2AAJ2NwACdjgAAnY5AAV2YWx1ZQABeAABeQAeAAcO" +
-    "OQAcAAcOADECSlkHDgBZAlpbBw48AF4CX2AHDjwAdwJkZQcOWgByAmprBw5aAGgCbm8HDjwA" +
-    "bQJzdAcOWgB8Ant9Bw48tACCAQKAAYEBBw4tIKUgAGMCgAGBAQcOPABTAZEBBw4tARoQADkN" +
-    "YXp4hwGJAYoBiwGMAY0BjgGPAQCIAQQTkAEQLgcOASQPPEtaWktppYd4iGkDAnkYAE4CkgGT" +
-    "AQcOlngASgAHDgAABwVMHAIYBBgEcBwBHQkETBwNGBgYERgZGBwYABgBGBoYBBgDGAIYERgP" +
-    "GAVnGAZxGwF5F3R2HAodCAFbHAE/HQgBXRwBAAEdCAFhHAEDYR0IAYEBHAEiAAQdCAFvHAEE" +
-    "AR0IAWwcAXCamTFBHQgBZRwB8ZqZmZmZmQFAHQgBggEcARcSHQgBYhwBGAYdCAF1HAFmFc1b" +
-    "B3kXSn4YBAILAZABHAkXARc2Fy8XNxdHFy8XKxcKFzMCDAGQARwBGBQNFgAXShUBBAEEAQRh" +
-    "JAAEBAFwmpkxQfGamZmZmZkBQBcSGAZmFc1bBwEADwEACgCIgAT8CwGBgASUDAIKrAwBCcQM" +
-    "AQmkDQEJhA4BCegOAQnMDwEJrBABCZARAQmIEgEJgBMBCeATAQqsFAEJlBYCAcgWEwAAAAAA" +
-    "AAABAAAAAAAAAAEAAACTAAAAcAAAAAIAAAAdAAAAvAIAAAMAAAAdAAAAMAMAAAQAAAADAAAA" +
-    "jAQAAAUAAAAiAAAApAQAAAcAAAABAAAAtAUAAAYAAAABAAAAuAUAAAgAAAABAAAA2AUAAAMQ" +
-    "AAADAAAA4AUAAAEgAAAQAAAA/AUAAAYgAAABAAAAYAsAAAEQAAAUAAAAiAsAAAIgAACTAAAA" +
-    "RAwAAAMgAAAQAAAA+BIAAAQgAAADAAAAqRMAAAUgAAABAAAAaRQAAAAgAAABAAAAkhQAAAAQ" +
-    "AAABAAAA3BQAAA==";
-}
diff --git a/test/952-invoke-custom/src/Main.java b/test/952-invoke-custom/src/Main.java
new file mode 100644
index 0000000..93bc8d3
--- /dev/null
+++ b/test/952-invoke-custom/src/Main.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.lang.invoke.CallSite;
+import java.lang.invoke.MethodType;
+import java.lang.invoke.MutableCallSite;
+import java.lang.reflect.InvocationTargetException;
+
+public class Main extends TestBase {
+
+    private static void TestUninitializedCallSite() throws Throwable {
+        CallSite callSite = new MutableCallSite(MethodType.methodType(int.class));
+        try {
+            callSite.getTarget().invoke();
+            fail();
+        } catch (IllegalStateException e) {
+            System.out.println("Caught exception from uninitialized call site");
+        }
+
+        callSite = new MutableCallSite(MethodType.methodType(String.class, int.class, char.class));
+        try {
+            callSite.getTarget().invoke(1535, 'd');
+            fail();
+        } catch (IllegalStateException e) {
+            System.out.println("Caught exception from uninitialized call site");
+        }
+    }
+
+    private static void TestLinkerMethodMultipleArgumentTypes() throws Throwable {
+        TestLinkerMethodMultipleArgumentTypes.test(33, 67);
+        TestLinkerMethodMultipleArgumentTypes.test(-10000, 1000);
+        TestLinkerMethodMultipleArgumentTypes.test(-1000, 10000);
+    }
+
+    private static void TestLinkerMethodMinimalArguments() throws Throwable {
+        try {
+            TestLinkerMethodMinimalArguments.test(
+                    TestLinkerMethodMinimalArguments.FAILURE_TYPE_LINKER_METHOD_RETURNS_NULL,
+                    10,
+                    10);
+            assertNotReached();
+        } catch (BootstrapMethodError e) {
+            assertEquals(e.getCause().getClass(), ClassCastException.class);
+        }
+
+        try {
+            TestLinkerMethodMinimalArguments.test(
+                    TestLinkerMethodMinimalArguments.FAILURE_TYPE_LINKER_METHOD_THROWS, 10, 11);
+            assertNotReached();
+        } catch (BootstrapMethodError e) {
+            assertEquals(e.getCause().getClass(), InstantiationException.class);
+        }
+
+        try {
+            TestLinkerMethodMinimalArguments.test(
+                    TestLinkerMethodMinimalArguments.FAILURE_TYPE_TARGET_METHOD_THROWS, 10, 12);
+            assertNotReached();
+        } catch (ArithmeticException e) {
+        }
+
+        TestLinkerMethodMinimalArguments.test(
+                TestLinkerMethodMinimalArguments.FAILURE_TYPE_NONE, 10, 13);
+    }
+
+    private static void TestInvokeCustomWithConcurrentThreads() throws Throwable {
+        // This is a concurrency test that attempts to run invoke-custom on the same
+        // call site.
+        TestInvokeCustomWithConcurrentThreads.test();
+    }
+
+    public static void main(String[] args) throws Throwable {
+        TestUninitializedCallSite();
+        TestLinkerMethodMinimalArguments();
+        TestLinkerMethodMultipleArgumentTypes();
+        TestInvokeCustomWithConcurrentThreads();
+    }
+}
diff --git a/test/952-invoke-custom/src/TestBase.java b/test/952-invoke-custom/src/TestBase.java
new file mode 100644
index 0000000..25ec9b6
--- /dev/null
+++ b/test/952-invoke-custom/src/TestBase.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Objects;
+
+abstract class TestBase {
+    static void assertTrue(boolean value) {
+        if (!value) {
+            throw new AssertionError("assertTrue value: " + value);
+        }
+    }
+
+    static void assertEquals(byte b1, byte b2) {
+        if (b1 == b2) {
+            return;
+        }
+        throw new AssertionError("assertEquals b1: " + b1 + ", b2: " + b2);
+    }
+
+    static void assertEquals(char c1, char c2) {
+        if (c1 == c2) {
+            return;
+        }
+        throw new AssertionError("assertEquals c1: " + c1 + ", c2: " + c2);
+    }
+
+    static void assertEquals(short s1, short s2) {
+        if (s1 == s2) {
+            return;
+        }
+        throw new AssertionError("assertEquals s1: " + s1 + ", s2: " + s2);
+    }
+
+    static void assertEquals(int i1, int i2) {
+        if (i1 == i2) {
+            return;
+        }
+        throw new AssertionError("assertEquals i1: " + i1 + ", i2: " + i2);
+    }
+
+    static void assertEquals(long l1, long l2) {
+        if (l1 == l2) {
+            return;
+        }
+        throw new AssertionError("assertEquals l1: " + l1 + ", l2: " + l2);
+    }
+
+    static void assertEquals(float f1, float f2) {
+        if (f1 == f2) {
+            return;
+        }
+        throw new AssertionError("assertEquals f1: " + f1 + ", f2: " + f2);
+    }
+
+    static void assertEquals(double d1, double d2) {
+        if (d1 == d2) {
+            return;
+        }
+        throw new AssertionError("assertEquals d1: " + d1 + ", d2: " + d2);
+    }
+
+    static void assertEquals(Object o, Object p) {
+        if (!Objects.equals(o, p)) {
+            throw new AssertionError("assertEquals: o1: " + o + ", o2: " + p);
+        }
+    }
+
+    static void assertNotEquals(Object o, Object p) {
+        if (Objects.equals(o, p)) {
+            throw new AssertionError("assertNotEquals: o1: " + o + ", o2: " + p);
+        }
+    }
+
+    static void assertNotReached() {
+        throw new AssertionError("Unreachable");
+    }
+
+    static void fail() {
+        System.out.println("fail");
+        Thread.dumpStack();
+    }
+}
diff --git a/test/952-invoke-custom/src/TestInvokeCustomWithConcurrentThreads.java b/test/952-invoke-custom/src/TestInvokeCustomWithConcurrentThreads.java
new file mode 100644
index 0000000..761d182
--- /dev/null
+++ b/test/952-invoke-custom/src/TestInvokeCustomWithConcurrentThreads.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import annotations.CalledByIndy;
+import annotations.LinkerMethodHandle;
+import annotations.MethodHandleKind;
+import java.lang.invoke.CallSite;
+import java.lang.invoke.ConstantCallSite;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicInteger;
+
+public class TestInvokeCustomWithConcurrentThreads extends TestBase implements Runnable {
+    private static final int NUMBER_OF_THREADS = 16;
+
+    private static final AtomicInteger nextIndex = new AtomicInteger(0);
+
+    private static final ThreadLocal<Integer> threadIndex =
+            new ThreadLocal<Integer>() {
+                @Override
+                protected Integer initialValue() {
+                    return nextIndex.getAndIncrement();
+                }
+            };
+
+    // Array of call sites instantiated, one per thread
+    private static final CallSite[] instantiated = new CallSite[NUMBER_OF_THREADS];
+
+    // Array of counters for how many times each instantiated call site is called
+    private static final AtomicInteger[] called = new AtomicInteger[NUMBER_OF_THREADS];
+
+    // Array of call site indicies of which call site a thread invoked
+    private static final AtomicInteger[] targetted = new AtomicInteger[NUMBER_OF_THREADS];
+
+    // Synchronization barrier all threads will wait on in the bootstrap method.
+    private static final CyclicBarrier barrier = new CyclicBarrier(NUMBER_OF_THREADS);
+
+    private TestInvokeCustomWithConcurrentThreads() {}
+
+    private static int getThreadIndex() {
+        return threadIndex.get().intValue();
+    }
+
+    public static int notUsed(int x) {
+        return x;
+    }
+
+    public void run() {
+        int x = setCalled(-1 /* argument dropped */);
+        notUsed(x);
+    }
+
+    @CalledByIndy(
+        invokeMethodHandle =
+                @LinkerMethodHandle(
+                    kind = MethodHandleKind.INVOKE_STATIC,
+                    enclosingType = TestInvokeCustomWithConcurrentThreads.class,
+                    name = "linkerMethod",
+                    argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class}
+                ),
+        name = "setCalled",
+        returnType = int.class,
+        argumentTypes = {int.class}
+    )
+    private static int setCalled(int index) {
+        called[index].getAndIncrement();
+        targetted[getThreadIndex()].set(index);
+        return 0;
+    }
+
+    @SuppressWarnings("unused")
+    private static CallSite linkerMethod(
+            MethodHandles.Lookup caller, String name, MethodType methodType) throws Throwable {
+        MethodHandle mh =
+                caller.findStatic(TestInvokeCustomWithConcurrentThreads.class, name, methodType);
+        assertEquals(methodType, mh.type());
+        assertEquals(mh.type().parameterCount(), 1);
+        mh = MethodHandles.insertArguments(mh, 0, getThreadIndex());
+        mh = MethodHandles.dropArguments(mh, 0, int.class);
+        assertEquals(mh.type().parameterCount(), 1);
+        assertEquals(methodType, mh.type());
+
+        // Wait for all threads to be in this method.
+        // Multiple call sites should be created, but only one
+        // invoked.
+        barrier.await();
+
+        instantiated[getThreadIndex()] = new ConstantCallSite(mh);
+        return instantiated[getThreadIndex()];
+    }
+
+    public static void test() throws Throwable {
+        // Initialize counters for which call site gets invoked
+        for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+            called[i] = new AtomicInteger(0);
+            targetted[i] = new AtomicInteger(0);
+        }
+
+        // Run threads that each invoke-custom the call site
+        Thread[] threads = new Thread[NUMBER_OF_THREADS];
+        for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+            threads[i] = new Thread(new TestInvokeCustomWithConcurrentThreads());
+            threads[i].start();
+        }
+
+        // Wait for all threads to complete
+        for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+            threads[i].join();
+        }
+
+        // Check one call site instance won
+        int winners = 0;
+        int votes = 0;
+        for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+            assertNotEquals(instantiated[i], null);
+            if (called[i].get() != 0) {
+                winners++;
+                votes += called[i].get();
+            }
+        }
+
+        System.out.println("Winners " + winners + " Votes " + votes);
+
+        // We assert this below but output details when there's an error as
+        // it's non-deterministic.
+        if (winners != 1) {
+            System.out.println("Threads did not the same call-sites:");
+            for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+                System.out.format(
+                        " Thread % 2d invoked call site instance #%02d\n", i, targetted[i].get());
+            }
+        }
+
+        // We assert this below but output details when there's an error as
+        // it's non-deterministic.
+        if (votes != NUMBER_OF_THREADS) {
+            System.out.println("Call-sites invocations :");
+            for (int i = 0; i < NUMBER_OF_THREADS; ++i) {
+                System.out.format(
+                        " Call site instance #%02d was invoked % 2d times\n", i, called[i].get());
+            }
+        }
+
+        assertEquals(winners, 1);
+        assertEquals(votes, NUMBER_OF_THREADS);
+    }
+}
diff --git a/test/952-invoke-custom/src/TestLinkerMethodMinimalArguments.java b/test/952-invoke-custom/src/TestLinkerMethodMinimalArguments.java
new file mode 100644
index 0000000..5310488
--- /dev/null
+++ b/test/952-invoke-custom/src/TestLinkerMethodMinimalArguments.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import annotations.CalledByIndy;
+import annotations.LinkerMethodHandle;
+import annotations.MethodHandleKind;
+import java.lang.invoke.CallSite;
+import java.lang.invoke.ConstantCallSite;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+public class TestLinkerMethodMinimalArguments extends TestBase {
+    private static int forceFailureType = 0;
+
+    static final int FAILURE_TYPE_NONE = 0;
+    static final int FAILURE_TYPE_LINKER_METHOD_RETURNS_NULL = 1;
+    static final int FAILURE_TYPE_LINKER_METHOD_THROWS = 2;
+    static final int FAILURE_TYPE_TARGET_METHOD_THROWS = 3;
+
+    @CalledByIndy(
+        invokeMethodHandle =
+                @LinkerMethodHandle(
+                    kind = MethodHandleKind.INVOKE_STATIC,
+                    enclosingType = TestLinkerMethodMinimalArguments.class,
+                    argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class},
+                    name = "linkerMethod"
+                ),
+        name = "_add",
+        returnType = int.class,
+        argumentTypes = {int.class, int.class}
+    )
+    private static int add(int a, int b) {
+        throw new UnsupportedOperationException("Should be invoking _add(a, b)");
+    }
+
+    @SuppressWarnings("unused")
+    static int _add(int a, int b) {
+        if (forceFailureType == FAILURE_TYPE_TARGET_METHOD_THROWS) {
+            System.out.println("Throwing ArithmeticException in add()");
+            throw new ArithmeticException("add");
+        }
+        return a + b;
+    }
+
+    @SuppressWarnings("unused")
+    private static CallSite linkerMethod(
+            MethodHandles.Lookup caller, String name, MethodType methodType) throws Throwable {
+        System.out.println("linkerMethod failure type " + forceFailureType);
+        MethodHandle mh_add =
+                caller.findStatic(TestLinkerMethodMinimalArguments.class, name, methodType);
+        switch (forceFailureType) {
+            case FAILURE_TYPE_LINKER_METHOD_RETURNS_NULL:
+                System.out.println(
+                        "Returning null instead of CallSite for " + name + " " + methodType);
+                return null;
+            case FAILURE_TYPE_LINKER_METHOD_THROWS:
+                System.out.println("Throwing InstantiationException in linkerMethod()");
+                throw new InstantiationException("linkerMethod");
+            default:
+                return new ConstantCallSite(mh_add);
+        }
+    }
+
+    public static void test(int failureType, int x, int y) throws Throwable {
+        assertTrue(failureType >= FAILURE_TYPE_NONE);
+        assertTrue(failureType <= FAILURE_TYPE_TARGET_METHOD_THROWS);
+        forceFailureType = failureType;
+        assertEquals(x + y, add(x, y));
+        System.out.println("Failure Type + " + failureType + " (" + x + y + ")");
+    }
+}
diff --git a/test/952-invoke-custom/src/TestLinkerMethodMultipleArgumentTypes.java b/test/952-invoke-custom/src/TestLinkerMethodMultipleArgumentTypes.java
new file mode 100644
index 0000000..6ae7abb
--- /dev/null
+++ b/test/952-invoke-custom/src/TestLinkerMethodMultipleArgumentTypes.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import annotations.CalledByIndy;
+import annotations.Constant;
+import annotations.LinkerMethodHandle;
+import annotations.MethodHandleKind;
+import java.lang.invoke.CallSite;
+import java.lang.invoke.ConstantCallSite;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+
+public class TestLinkerMethodMultipleArgumentTypes extends TestBase {
+
+    private static int bootstrapRunCount = 0;
+
+    @CalledByIndy(
+        invokeMethodHandle =
+                @LinkerMethodHandle(
+                    kind = MethodHandleKind.INVOKE_STATIC,
+                    enclosingType = TestLinkerMethodMultipleArgumentTypes.class,
+                    name = "linkerMethod",
+                    argumentTypes = {
+                        MethodHandles.Lookup.class,
+                        String.class,
+                        MethodType.class,
+                        int.class,
+                        int.class,
+                        int.class,
+                        int.class,
+                        int.class,
+                        float.class,
+                        double.class,
+                        String.class,
+                        Class.class,
+                        long.class
+                    }
+                ),
+        methodHandleExtraArgs = {
+            @Constant(intValue = -1),
+            @Constant(intValue = 1),
+            @Constant(intValue = (int) 'a'),
+            @Constant(intValue = 1024),
+            @Constant(intValue = 1),
+            @Constant(floatValue = 11.1f),
+            @Constant(doubleValue = 2.2),
+            @Constant(stringValue = "Hello"),
+            @Constant(classValue = TestLinkerMethodMultipleArgumentTypes.class),
+            @Constant(longValue = 123456789L)
+        },
+        name = "_add",
+        returnType = int.class,
+        argumentTypes = {int.class, int.class}
+    )
+    private static int add(int a, int b) {
+        throw new UnsupportedOperationException("Should be invoking _add(a, b)");
+    }
+
+    @SuppressWarnings("unused")
+    private static int _add(int a, int b) {
+        return a + b;
+    }
+
+    @SuppressWarnings("unused")
+    private static CallSite linkerMethod(
+            MethodHandles.Lookup caller,
+            String name,
+            MethodType methodType,
+            int v1,
+            int v2,
+            int v3,
+            int v4,
+            int v5,
+            float v6,
+            double v7,
+            String v8,
+            Class<?> v9,
+            long v10)
+            throws Throwable {
+        System.out.println("Linking " + name + " " + methodType);
+        assertEquals(-1, v1);
+        assertEquals(1, v2);
+        assertEquals('a', v3);
+        assertEquals(1024, v4);
+        assertEquals(1, v5);
+        assertEquals(11.1f, v6);
+        assertEquals(2.2, v7);
+        assertEquals("Hello", v8);
+        assertEquals(TestLinkerMethodMultipleArgumentTypes.class, v9);
+        assertEquals(123456789L, v10);
+        MethodHandle mh_add =
+                caller.findStatic(TestLinkerMethodMultipleArgumentTypes.class, name, methodType);
+        return new ConstantCallSite(mh_add);
+    }
+
+    public int GetBootstrapRunCount() {
+        return bootstrapRunCount;
+    }
+
+    public static void test(int x, int y) throws Throwable {
+        assertEquals(x + y, add(x, y));
+        System.out.println(x + y);
+    }
+}
diff --git a/test/952-invoke-custom/src/annotations/CalledByIndy.java b/test/952-invoke-custom/src/annotations/CalledByIndy.java
new file mode 100644
index 0000000..17b8259
--- /dev/null
+++ b/test/952-invoke-custom/src/annotations/CalledByIndy.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation can be set on method to specify that if this method is called then it must be
+ * called by an invokedynamic instruction.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface CalledByIndy {
+    LinkerMethodHandle[] invokeMethodHandle() default {};
+
+    LinkerFieldHandle[] fieldMethodHandle() default {};
+
+    String name();
+
+    Class<?> returnType() default void.class;
+
+    Class<?>[] argumentTypes() default {};
+
+    Constant[] methodHandleExtraArgs() default {};
+}
diff --git a/test/952-invoke-custom/src/annotations/Constant.java b/test/952-invoke-custom/src/annotations/Constant.java
new file mode 100644
index 0000000..7966a52
--- /dev/null
+++ b/test/952-invoke-custom/src/annotations/Constant.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** Describes an annotation that allows passing a constant extra argument to a linker method. */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Constant {
+    boolean[] booleanValue() default {};
+
+    byte[] byteValue() default {};
+
+    char[] charValue() default {};
+
+    short[] shortValue() default {};
+
+    int[] intValue() default {};
+
+    float[] floatValue() default {};
+
+    double[] doubleValue() default {};
+
+    long[] longValue() default {};
+
+    Class<?>[] classValue() default {};
+
+    String[] stringValue() default {};
+}
diff --git a/test/952-invoke-custom/src/annotations/LinkerFieldHandle.java b/test/952-invoke-custom/src/annotations/LinkerFieldHandle.java
new file mode 100644
index 0000000..a3efe24
--- /dev/null
+++ b/test/952-invoke-custom/src/annotations/LinkerFieldHandle.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.invoke.CallSite;
+
+/** Describe a linker method to a field. */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface LinkerFieldHandle {
+    MethodHandleKind kind();
+
+    Class<?> enclosingType();
+
+    String name();
+
+    Class<?> type() default CallSite.class;
+}
diff --git a/test/952-invoke-custom/src/annotations/LinkerMethodHandle.java b/test/952-invoke-custom/src/annotations/LinkerMethodHandle.java
new file mode 100644
index 0000000..e0e56c5
--- /dev/null
+++ b/test/952-invoke-custom/src/annotations/LinkerMethodHandle.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.invoke.CallSite;
+
+/** Describe a linker method to a method. */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface LinkerMethodHandle {
+    MethodHandleKind kind();
+
+    Class<?> enclosingType();
+
+    String name();
+
+    Class<?> returnType() default CallSite.class;
+
+    Class<?>[] argumentTypes() default {};
+}
diff --git a/test/952-invoke-custom/src/annotations/MethodHandleKind.java b/test/952-invoke-custom/src/annotations/MethodHandleKind.java
new file mode 100644
index 0000000..5847e2f
--- /dev/null
+++ b/test/952-invoke-custom/src/annotations/MethodHandleKind.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package annotations;
+
+/** MethodHandle invocations kinds supported by invokedynamic */
+public enum MethodHandleKind {
+    GET_FIELD,
+    GET_STATIC,
+    PUT_FIELD,
+    PUT_STATIC,
+    INVOKE_VIRTUAL,
+    INVOKE_STATIC,
+    INVOKE_SPECIAL,
+    INVOKE_CONSTRUCTOR,
+    INVOKE_INTERFACE
+}
diff --git a/test/952-invoke-custom/src/transformer/IndyTransformer.java b/test/952-invoke-custom/src/transformer/IndyTransformer.java
new file mode 100644
index 0000000..286c098
--- /dev/null
+++ b/test/952-invoke-custom/src/transformer/IndyTransformer.java
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package transformer;
+
+import annotations.CalledByIndy;
+import annotations.Constant;
+import annotations.LinkerFieldHandle;
+import annotations.LinkerMethodHandle;
+import annotations.MethodHandleKind;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import org.objectweb.asm.ClassReader;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Handle;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
+
+/**
+ * Class for inserting invoke-dynamic instructions in annotated Java class files.
+ *
+ * This class replaces static method invocations of annotated methods
+ * with invoke-dynamic instructions. Suppose a method is annotated as:
+ *
+ * @CalledByIndy(
+ *     invokeMethodHandle =
+ *         @LinkerMethodHandle(
+ *              kind = MethodHandleKind.INVOKE_STATIC,
+ *                  enclosingType = TestLinkerMethodMinimalArguments.class,
+ *                  argumentTypes = {MethodHandles.Lookup.class, String.class, MethodType.class},
+ *                  name = "linkerMethod"
+ *              ),
+ *     name = "magicAdd",
+ *     returnType = int.class,
+ *     argumentTypes = {int.class, int.class}
+ * )
+ * private int add(int x, int y) {
+ *    throw new UnsupportedOperationException(e);
+ * }
+ *
+ * private int magicAdd(int x, int y) {
+ *    return x + y;
+ * }
+ *
+ * Then invokestatic bytecodes targeting the add() method will be
+ * replaced invokedynamic instructions targetting the CallSite that is
+ * construction by the bootstrap method described by the @CalledByIndy
+ * annotation.
+ *
+ * In the example above, this results in add() being replaced by
+ * invocations of magicAdd().
+ */
+class IndyTransformer {
+
+    static class BootstrapBuilder extends ClassVisitor {
+
+        private final Map<String, CalledByIndy> callsiteMap;
+        private final Map<String, Handle> bsmMap = new HashMap<>();
+
+        public BootstrapBuilder(int api, Map<String, CalledByIndy> callsiteMap) {
+            this(api, null, callsiteMap);
+        }
+
+        public BootstrapBuilder(int api, ClassVisitor cv, Map<String, CalledByIndy> callsiteMap) {
+            super(api, cv);
+            this.callsiteMap = callsiteMap;
+        }
+
+        @Override
+        public MethodVisitor visitMethod(
+                int access, String name, String desc, String signature, String[] exceptions) {
+            MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions);
+            return new MethodVisitor(this.api, mv) {
+                @Override
+                public void visitMethodInsn(
+                        int opcode, String owner, String name, String desc, boolean itf) {
+                    if (opcode == org.objectweb.asm.Opcodes.INVOKESTATIC) {
+                        CalledByIndy callsite = callsiteMap.get(name);
+                        if (callsite != null) {
+                            insertIndy(callsite.name(), desc, callsite);
+                            return;
+                        }
+                    }
+                    mv.visitMethodInsn(opcode, owner, name, desc, itf);
+                }
+
+                private void insertIndy(String name, String desc, CalledByIndy callsite) {
+                    Handle bsm = buildBootstrapMethodHandle(callsite);
+                    Object[] bsmArgs = buildBootstrapArguments(callsite);
+                    mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+                }
+
+                private Handle buildBootstrapMethodHandle(CalledByIndy callsite) {
+                    MethodHandleKind kind;
+                    if (callsite.fieldMethodHandle().length != 0) {
+                        return buildBootstrapMethodHandleForField(callsite.fieldMethodHandle()[0]);
+                    } else if (callsite.invokeMethodHandle().length != 0) {
+                        return buildBootstrapMethodHandleForMethod(
+                                callsite.invokeMethodHandle()[0]);
+                    } else {
+                        throw new Error("Missing linker method handle in CalledByIndy annotation");
+                    }
+                }
+
+                private Handle buildBootstrapMethodHandleForField(LinkerFieldHandle fieldHandle) {
+                    int handleKind;
+                    switch (fieldHandle.kind()) {
+                        case GET_FIELD:
+                            handleKind = Opcodes.H_GETFIELD;
+                            break;
+                        case GET_STATIC:
+                            handleKind = Opcodes.H_GETSTATIC;
+                            break;
+                        case PUT_FIELD:
+                            handleKind = Opcodes.H_PUTFIELD;
+                            break;
+                        case PUT_STATIC:
+                            handleKind = Opcodes.H_PUTSTATIC;
+                            break;
+                        default:
+                            throw new Error("Unknown field invocation kind: " + fieldHandle.kind());
+                    }
+                    Class<?> resolverClass = fieldHandle.enclosingType();
+                    String resolverMethod = fieldHandle.name();
+                    Class<?> resolverReturnType = fieldHandle.type();
+
+                    // TODO: arguments types to invoke resolver with (default + extra args).
+                    throw new Error("WIP");
+                }
+
+                private Handle buildBootstrapMethodHandleForMethod(
+                        LinkerMethodHandle methodHandle) {
+                    int handleKind;
+                    switch (methodHandle.kind()) {
+                        case INVOKE_CONSTRUCTOR:
+                            handleKind = Opcodes.H_NEWINVOKESPECIAL;
+                            break;
+                        case INVOKE_INTERFACE:
+                            handleKind = Opcodes.H_INVOKEINTERFACE;
+                            break;
+                        case INVOKE_SPECIAL:
+                            handleKind = Opcodes.H_INVOKESPECIAL;
+                            break;
+                        case INVOKE_STATIC:
+                            handleKind = Opcodes.H_INVOKESTATIC;
+                            break;
+                        case INVOKE_VIRTUAL:
+                            handleKind = Opcodes.H_INVOKEVIRTUAL;
+                            break;
+                        default:
+                            throw new Error(
+                                    "Unknown method invocation kind: " + methodHandle.kind());
+                    }
+                    String className = Type.getInternalName(methodHandle.enclosingType());
+                    String methodName = methodHandle.name();
+                    String methodType =
+                            MethodType.methodType(
+                                            methodHandle.returnType(), methodHandle.argumentTypes())
+                                    .toMethodDescriptorString();
+                    return new Handle(
+                            handleKind, className, methodName, methodType, false /* itf */);
+                }
+
+                private Object decodeConstant(int index, Constant constant) {
+                    if (constant.booleanValue().length == 1) {
+                        return constant.booleanValue()[0];
+                    } else if (constant.byteValue().length == 1) {
+                        return constant.byteValue()[0];
+                    } else if (constant.charValue().length == 1) {
+                        return constant.charValue()[0];
+                    } else if (constant.shortValue().length == 1) {
+                        return constant.shortValue()[0];
+                    } else if (constant.intValue().length == 1) {
+                        return constant.intValue()[0];
+                    } else if (constant.longValue().length == 1) {
+                        return constant.longValue()[0];
+                    } else if (constant.floatValue().length == 1) {
+                        return constant.floatValue()[0];
+                    } else if (constant.doubleValue().length == 1) {
+                        return constant.doubleValue()[0];
+                    } else if (constant.stringValue().length == 1) {
+                        return constant.stringValue()[0];
+                    } else if (constant.classValue().length == 1) {
+                        return Type.getType(constant.classValue()[0]);
+                    } else {
+                        throw new Error("Bad constant at index " + index);
+                    }
+                }
+
+                private Object[] buildBootstrapArguments(CalledByIndy callsite) {
+                    Constant[] rawArgs = callsite.methodHandleExtraArgs();
+                    Object[] args = new Object[rawArgs.length];
+                    for (int i = 0; i < rawArgs.length; ++i) {
+                        args[i] = decodeConstant(i, rawArgs[i]);
+                    }
+                    return args;
+                }
+            };
+        }
+    }
+
+    private static void transform(Path inputClassPath, Path outputClassPath) throws Throwable {
+        URLClassLoader classLoader =
+                new URLClassLoader(
+                        new URL[] {inputClassPath.toUri().toURL()},
+                        ClassLoader.getSystemClassLoader());
+        String inputClassName = inputClassPath.getFileName().toString().replace(".class", "");
+        Class<?> inputClass = classLoader.loadClass(inputClassName);
+        Map<String, CalledByIndy> callsiteMap = new HashMap<>();
+
+        for (Method m : inputClass.getDeclaredMethods()) {
+            CalledByIndy calledByIndy = m.getAnnotation(CalledByIndy.class);
+            if (calledByIndy == null) {
+                continue;
+            }
+            if (calledByIndy.name() == null) {
+                throw new Error("CallByIndy annotation does not specify name");
+            }
+            final int PRIVATE_STATIC = Modifier.STATIC | Modifier.PRIVATE;
+            if ((m.getModifiers() & PRIVATE_STATIC) != PRIVATE_STATIC) {
+                throw new Error(
+                        "Method whose invocations should be replaced should be private and static");
+            }
+            callsiteMap.put(m.getName(), calledByIndy);
+        }
+        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
+        try (InputStream is = Files.newInputStream(inputClassPath)) {
+            ClassReader cr = new ClassReader(is);
+            cr.accept(new BootstrapBuilder(Opcodes.ASM6, cw, callsiteMap), 0);
+        }
+        try (OutputStream os = Files.newOutputStream(outputClassPath)) {
+            os.write(cw.toByteArray());
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        transform(Paths.get(args[0]), Paths.get(args[1]));
+    }
+}