Pass the right class loader when inlining.
Otherwise, method and type resolution can resolve to the wrong
things and as a side effect update the dex cache with wrong data.
bug:30403437
test:./art/test/run-test --host --jit --dev --no-prebuild 613
(cherry picked from commit 0a210d9b108c87c0e7c1d430a92ce6fc89790c95)
Change-Id: I8fdca96fccae079c8e99b8e86e7b6935acfce89d
diff --git a/test/613-inlining-dex-cache/src-ex/LoadedByAppClassLoader.java b/test/613-inlining-dex-cache/src-ex/LoadedByAppClassLoader.java
new file mode 100644
index 0000000..f4e0f10
--- /dev/null
+++ b/test/613-inlining-dex-cache/src-ex/LoadedByAppClassLoader.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+public class LoadedByAppClassLoader {
+ public static void letMeInlineYou() {
+ // We used to pass the wrong class loader when trying to inline 'Main.foo'.
+ Main.foo(null);
+ }
+}