From 499b8f89e1c7cb096eca17740d238d40d63f9e85 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 15 Mar 2018 22:29:24 +0000 Subject: Fix a few issues with 616-cha-unloading. - Disable test on RI - Disable test on trace - Don't try N times for getting the allocation we want, do it until we get it. We shouldn't get in an infinite loop. If we do the harness will kill the test. Test: 616-cha-unloading bug: 73143991 (cherry picked from commit a3cd12412475049c51ff16369d8044cae2438d54) Change-Id: I8d37dbcde472b19f63c7c692acea9e7d90f17d25 --- test/616-cha-unloading/src-art/Main.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/616-cha-unloading/src-art/Main.java') diff --git a/test/616-cha-unloading/src-art/Main.java b/test/616-cha-unloading/src-art/Main.java index b633a0c22e..effa315e25 100644 --- a/test/616-cha-unloading/src-art/Main.java +++ b/test/616-cha-unloading/src-art/Main.java @@ -53,12 +53,12 @@ public class Main { WeakReference loader = result.cl; long methodPtr = result.methodPtr; // Check that the classloader is indeed unloaded. - System.out.println(loader.get()); + if (loader.get() != null) { + throw new Error("Expected class loader to be unloaded"); + } - // Reuse the linear alloc so old pointers so it becomes invalid. - boolean ret = tryReuseArenaOfMethod(methodPtr, 10); - // Check that we indeed reused it. - System.out.println(ret); + // Reuse the linear alloc used by the unloaded class loader. + reuseArenaOfMethod(methodPtr); // Try to JIT-compile under dangerous conditions. ensureJitCompiled(Main.class, "targetMethodForJit"); @@ -117,5 +117,5 @@ public class Main { private static native void ensureJitCompiled(Class itf, String method_name); private static native long getArtMethod(Object javaMethod); - private static native boolean tryReuseArenaOfMethod(long artMethod, int tries_count); + private static native void reuseArenaOfMethod(long artMethod); } -- cgit v1.2.3-59-g8ed1b