--- old/src/hotspot/share/prims/whitebox.cpp 2019-01-23 14:43:23.000000000 -0800 +++ new/src/hotspot/share/prims/whitebox.cpp 2019-01-23 14:43:22.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -93,6 +93,9 @@ #include "services/memTracker.hpp" #include "utilities/nativeCallStack.hpp" #endif // INCLUDE_NMT +#if INCLUDE_AOT +#include "aot/aotLoader.hpp" +#endif // INCLUDE_AOT #ifdef LINUX #include "osContainer_linux.hpp" @@ -2118,6 +2121,14 @@ return (jint) SystemDictionary::pd_cache_table()->removed_entries_count(); WB_END +WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o)) + jint result = 0; +#if INCLUDE_AOT + result = (jint) AOTLoader::libraries_count(); +#endif + return result; +WB_END + #define CC (char*) static JNINativeMethod methods[] = { @@ -2350,6 +2361,7 @@ {CC"disableElfSectionCache", CC"()V", (void*)&WB_DisableElfSectionCache }, {CC"resolvedMethodRemovedCount", CC"()I", (void*)&WB_ResolvedMethodRemovedCount }, {CC"protectionDomainRemovedCount", CC"()I", (void*)&WB_ProtectionDomainRemovedCount }, + {CC"aotLibrariesCount", CC"()I", (void*)&WB_AotLibrariesCount }, }; --- old/test/hotspot/jtreg/TEST.ROOT 2019-01-23 14:43:26.000000000 -0800 +++ new/test/hotspot/jtreg/TEST.ROOT 2019-01-23 14:43:25.000000000 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -59,6 +59,7 @@ vm.rtm.cpu \ vm.rtm.compiler \ vm.aot \ + vm.aot.enabled \ vm.cds \ vm.cds.custom.loaders \ vm.cds.archived.java.heap \ --- old/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java 2019-01-23 14:43:29.000000000 -0800 +++ new/test/hotspot/jtreg/compiler/intrinsics/bigInteger/TestMulAdd.java 2019-01-23 14:43:29.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ * @test * @bug 8081778 * @summary Add C2 x86 intrinsic for BigInteger::mulAdd() method + * @comment the test disables intrinsics, so can't be run w/ AOT'ed java.base + * @requires !vm.aot.enabled * * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch * -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic --- old/test/jtreg-ext/requires/VMProps.java 2019-01-23 14:43:31.000000000 -0800 +++ new/test/jtreg-ext/requires/VMProps.java 2019-01-23 14:43:31.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,7 @@ map.put("vm.rtm.cpu", vmRTMCPU()); map.put("vm.rtm.compiler", vmRTMCompiler()); map.put("vm.aot", vmAOT()); + map.put("vm.aot.enabled", vmAotEnabled()); // vm.cds is true if the VM is compiled with cds support. map.put("vm.cds", vmCDS()); map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders()); @@ -266,6 +267,7 @@ vmOptFinalFlag(map, "ClassUnloading"); vmOptFinalFlag(map, "UseCompressedOops"); vmOptFinalFlag(map, "EnableJVMCI"); + vmOptFinalFlag(map, "EliminateAllocations"); } /** @@ -334,6 +336,13 @@ return "" + Files.exists(jaotc); } + /* + * @return true if there is at least one loaded AOT'ed library. + */ + protected String vmAotEnabled() { + return "" + (WB.aotLibrariesCount() > 0); + } + /** * Check for CDS support. * --- old/test/lib/sun/hotspot/WhiteBox.java 2019-01-23 14:43:33.000000000 -0800 +++ new/test/lib/sun/hotspot/WhiteBox.java 2019-01-23 14:43:33.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,4 +549,7 @@ // Protection Domain Table public native int protectionDomainRemovedCount(); + + // Number of loaded AOT libraries + public native int aotLibrariesCount(); }