diff --git a/test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java b/test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java index 62860336df0f9..5ddfb7459f171 100644 --- a/test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java +++ b/test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java @@ -63,7 +63,7 @@ public static void main(String[] args) { run(AbstractInterface.class); // Implementation limitation: CHA is not performed by C1 during inlining through MH linkers. - if (!sun.hotspot.code.Compiler.isC1Enabled()) { + if (!jdk.test.whitebox.code.Compiler.isC1Enabled()) { run(AbstractClass.TestMH.class, AbstractClass.class); run(AbstractInterface.TestMH.class, AbstractInterface.class); } diff --git a/test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java b/test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java index 72a657eda6478..d3bdb1ede0dda 100644 --- a/test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java +++ b/test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java @@ -63,7 +63,7 @@ public static void main(String[] args) { run(InheritedDefault.class); // Implementation limitation: CHA is not performed by C1 during inlining through MH linkers. - if (!sun.hotspot.code.Compiler.isC1Enabled()) { + if (!jdk.test.whitebox.code.Compiler.isC1Enabled()) { run(DefaultRoot.TestMH.class, DefaultRoot.class); run(InheritedDefault.TestMH.class, InheritedDefault.class); } diff --git a/test/hotspot/jtreg/compiler/cha/Utils.java b/test/hotspot/jtreg/compiler/cha/Utils.java index 19d1f3d43750b..1bdee572a9d58 100644 --- a/test/hotspot/jtreg/compiler/cha/Utils.java +++ b/test/hotspot/jtreg/compiler/cha/Utils.java @@ -27,7 +27,7 @@ import jdk.internal.org.objectweb.asm.MethodVisitor; import jdk.internal.vm.annotation.DontInline; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.io.IOException; import java.lang.annotation.Retention; diff --git a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java index 163f3333ec8c7..5862cc4f97c6d 100644 --- a/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java +++ b/test/hotspot/jtreg/compiler/codecache/OverflowCodeCacheTest.java @@ -48,8 +48,8 @@ import jdk.test.lib.Asserts; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; -import sun.hotspot.code.CodeBlob; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.CodeBlob; import java.lang.management.MemoryPoolMXBean; import java.lang.reflect.Method; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java index 49fa9b013ef20..2a810abdd48df 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java @@ -40,7 +40,7 @@ import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; public class TestSegmentedCodeCacheOption { private static final String INT_MODE = "-Xint"; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java index 56816e8b81ac2..2a95586026d3a 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/CodeCacheFreeSpaceRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -28,7 +28,7 @@ import jdk.test.lib.process.ExitCode; import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; /** * Test case runner aimed to verify that NonNMethodCodeHeapSize smaller than diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java index a8186fce029e5..e7c68e71ab306 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/GenericCodeHeapSizeRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -26,7 +26,7 @@ import compiler.codecache.cli.common.CodeCacheCLITestCase; import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; /** * Test case runner aimed to verify that all four options related to code cache diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java index bde7beb68bf9b..e5507efcee3f7 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/JVMStartupRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -28,7 +28,7 @@ import jdk.test.lib.process.ExitCode; import jdk.test.lib.Utils; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.Random; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java index 52cf28a196b35..7ae62407ece7b 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java @@ -40,7 +40,7 @@ import compiler.codecache.cli.common.CodeCacheCLITestBase; import compiler.codecache.cli.common.CodeCacheCLITestCase; import jdk.test.lib.Platform; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java index 91736ca1442de..eca5c70e0917b 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java @@ -24,7 +24,7 @@ import jdk.test.lib.Platform; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.Collections; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheInfoFormatter.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheInfoFormatter.java index 9349272dfc752..a8cdc6f6b6cbf 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheInfoFormatter.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheInfoFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -22,7 +22,7 @@ */ package compiler.codecache.cli.common; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.Arrays; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java index d5e2f16c81f47..f5243aaa4935f 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -23,7 +23,7 @@ package compiler.codecache.cli.common; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.ArrayList; import java.util.Collections; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java index 43d4e387852ff..8898aefe1ff3f 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/PrintCodeCacheRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -28,7 +28,7 @@ import compiler.codecache.cli.common.CodeCacheOptions; import jdk.test.lib.process.ExitCode; import jdk.test.lib.cli.CommandLineOptionTest; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.EnumSet; import java.util.stream.Collectors; diff --git a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java index 63c5c82daaa46..223d683fc2414 100644 --- a/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java +++ b/test/hotspot/jtreg/compiler/codecache/cli/printcodecache/TestPrintCodeCacheOption.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -38,7 +38,7 @@ import compiler.codecache.cli.common.CodeCacheCLITestBase; import compiler.codecache.cli.common.CodeCacheCLITestCase; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java index 3a5be33a48f05..5bc10071b4ddf 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/BeanTypeTest.java @@ -43,7 +43,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryType; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/CodeCacheUtils.java b/test/hotspot/jtreg/compiler/codecache/jmx/CodeCacheUtils.java index 791f319ab3f24..340021bb99317 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/CodeCacheUtils.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/CodeCacheUtils.java @@ -26,8 +26,8 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Utils; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; -import sun.hotspot.code.CodeBlob; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.CodeBlob; import javax.management.Notification; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java index 519a0bc04c841..d379296d5613c 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/CodeHeapBeanPresenceTest.java @@ -43,7 +43,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java index d435ed49fa81c..873b04944245b 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/GetUsageTest.java @@ -45,7 +45,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; import java.util.HashMap; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java index 8df0bb179782f..a2343c236946d 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/InitialAndMaxUsageTest.java @@ -45,7 +45,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; import java.util.ArrayList; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java index b6e8061862506..b482cd4e55931 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ManagerNamesTest.java @@ -43,7 +43,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java index 8d32a4abf6543..b91b7fa228d38 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/MemoryPoolsPresenceTest.java @@ -43,7 +43,7 @@ package compiler.codecache.jmx; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.ManagementFactory; import java.lang.management.MemoryManagerMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java index 37cd0932f8dd0..b808a6619041b 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PeakUsageTest.java @@ -43,7 +43,7 @@ package compiler.codecache.jmx; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java index 126ae6e9f9bac..07a5ec94c8776 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/PoolsIndependenceTest.java @@ -44,7 +44,7 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import javax.management.ListenerNotFoundException; import javax.management.Notification; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java index 137264bc03850..a71a01a555c33 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/ThresholdNotificationsTest.java @@ -44,7 +44,7 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import javax.management.ListenerNotFoundException; import javax.management.Notification; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java index e268fe349a74f..1dae00b0035a0 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdExceededTest.java @@ -45,7 +45,7 @@ package compiler.codecache.jmx; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java index 3dde63e02fe3e..cb3f2c9036431 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdIncreasedTest.java @@ -44,7 +44,7 @@ package compiler.codecache.jmx; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java index 7d908e9eb118d..1c13c89884bc3 100644 --- a/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java +++ b/test/hotspot/jtreg/compiler/codecache/jmx/UsageThresholdNotExceededTest.java @@ -45,7 +45,7 @@ package compiler.codecache.jmx; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; diff --git a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java index 98962f42f63e6..72e605397d0e7 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/RandomAllocationTest.java @@ -45,7 +45,7 @@ package compiler.codecache.stress; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.ArrayList; import java.util.Random; diff --git a/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java b/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java index e0b67824ca9f1..c66c2a22f1456 100644 --- a/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java +++ b/test/hotspot/jtreg/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java @@ -43,7 +43,7 @@ package compiler.codecache.stress; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.ArrayList; diff --git a/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java b/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java index a326376965abe..36ee43a7732a0 100644 --- a/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java +++ b/test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java @@ -148,7 +148,7 @@ package compiler.codegen.aes; import compiler.whitebox.CompilerWhiteBoxTest; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import jtreg.SkippedException; public class TestAESMain { diff --git a/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java index 9d65fae65dde9..46d09b4242538 100644 --- a/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java +++ b/test/hotspot/jtreg/compiler/codegen/aes/TestCipherBlockChainingEncrypt.java @@ -47,7 +47,7 @@ import javax.crypto.spec.PBEKeySpec; import compiler.whitebox.CompilerWhiteBoxTest; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import jdk.test.lib.Utils; import jtreg.SkippedException; diff --git a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java index b1bf6c0eb0107..5d2651c328541 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java +++ b/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java @@ -51,7 +51,7 @@ import java.util.Arrays; import compiler.whitebox.CompilerWhiteBoxTest; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import jtreg.SkippedException; import jdk.test.lib.Utils; diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java index da69189e6e540..3cf9cba5bd975 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnI.java @@ -38,7 +38,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestAndnI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java index 1001f0b085f09..08f6e641fc2c5 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestAndnL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestAndnL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java index 817e74144b260..9b8b4f0ac8976 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiI.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsiI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java index deed02306f17d..e5e17b6e973a0 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsiL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsiL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java index f743606dd7c33..522f089b2f35a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskI.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsmskI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java index a24dfc45dd362..a5227a073f378 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsmskL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsmskL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java index c08e35f489a05..ccb02e347b083 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrI.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsrI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java index 3f460244a16af..2dc79926f01e0 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBlsrL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBlsrL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBzhiI2L.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBzhiI2L.java index 467d9c6f41b1b..18d822cecbc34 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBzhiI2L.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestBzhiI2L.java @@ -38,7 +38,7 @@ package compiler.intrinsics.bmi; import jdk.test.lib.Platform; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestBzhiI2L { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java index 92412084ce694..2b9abffb2e2e4 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntI.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestLzcntI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java index 6963f9adc4ac9..317d527d482f5 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestLzcntL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestLzcntL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java index 6a0daafa1870d..8e2598cda7255 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntI.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestTzcntI { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java index 2bb545ed39e57..dd3a4542c3201 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/TestTzcntL.java @@ -40,7 +40,7 @@ package compiler.intrinsics.bmi; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestTzcntL { diff --git a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java index a9c8e398b18dc..743e371d5c204 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java +++ b/test/hotspot/jtreg/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -27,8 +27,8 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Platform; import jdk.test.lib.Utils; -import sun.hotspot.code.NMethod; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.code.NMethod; +import jdk.test.whitebox.cpuinfo.CPUInfo; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodType; diff --git a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java index 2b4115a99d4e2..8ee5397b3435a 100644 --- a/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java +++ b/test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java @@ -49,7 +49,7 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.io.IOException; import java.lang.invoke.MethodHandle; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java index e239ba417368f..8f41f6f0eef07 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -55,7 +55,7 @@ import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Executable; import java.lang.reflect.Method; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/CompileCodeTestCase.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/CompileCodeTestCase.java index c1768130bfbdb..a880218b53b88 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/CompileCodeTestCase.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/CompileCodeTestCase.java @@ -32,7 +32,7 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCI; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Constructor; import java.lang.reflect.Executable; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 37bfd6c5816f9..caea10cbc1a7b 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -52,7 +52,7 @@ import jdk.test.lib.Utils; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.util.List; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index 73d1587020a90..7cd1aedffa034 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -50,7 +50,7 @@ import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; import jdk.vm.ci.hotspot.CompilerToVMHelper; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java index ed36fdf56cf19..866c576b19320 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -53,7 +53,7 @@ import jdk.test.lib.Utils; import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Executable; import java.util.ArrayList; diff --git a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java index 636cafe7da9d6..a3778a5872194 100644 --- a/test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -58,7 +58,7 @@ import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.util.List; diff --git a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java index 5f8d9f1912123..1a6d5cb3dc723 100644 --- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java +++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64DefaultFlags.java @@ -42,7 +42,7 @@ import java.util.List; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; public class TestOnSpinWaitAArch64DefaultFlags { private static boolean isCPUModelNeoverseN1(String cpuModel) { diff --git a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java index 623b6cc097a85..09fc32ae62402 100644 --- a/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java +++ b/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java @@ -52,7 +52,7 @@ import static jdk.test.lib.Asserts.assertEQ; import static jdk.test.lib.Asserts.assertNE; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class UnsafeGetStableArrayElement { @Stable static final boolean[] STABLE_BOOLEAN_ARRAY = new boolean[16]; diff --git a/test/hotspot/jtreg/compiler/whitebox/AllocationCodeBlobTest.java b/test/hotspot/jtreg/compiler/whitebox/AllocationCodeBlobTest.java index a903d85e0ab72..26e322b43304d 100644 --- a/test/hotspot/jtreg/compiler/whitebox/AllocationCodeBlobTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/AllocationCodeBlobTest.java @@ -45,7 +45,7 @@ import jdk.test.lib.Asserts; import jdk.test.lib.InfiniteLoop; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.lang.management.MemoryPoolMXBean; import java.util.ArrayList; diff --git a/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java b/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java index c077b37b35fda..407aac7868e70 100644 --- a/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/CompilerWhiteBoxTest.java @@ -25,7 +25,7 @@ import jdk.test.lib.Platform; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Executable; import java.util.Objects; diff --git a/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java b/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java index 4b0c1bfd65ad6..0a3691eb4dfbc 100644 --- a/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/DeoptimizeFramesTest.java @@ -49,7 +49,7 @@ package compiler.whitebox; import jdk.test.lib.Asserts; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; import java.lang.reflect.Executable; import java.util.concurrent.Callable; diff --git a/test/hotspot/jtreg/compiler/whitebox/ForceNMethodSweepTest.java b/test/hotspot/jtreg/compiler/whitebox/ForceNMethodSweepTest.java index c695e2d24ca35..8f61367b07d93 100644 --- a/test/hotspot/jtreg/compiler/whitebox/ForceNMethodSweepTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/ForceNMethodSweepTest.java @@ -44,7 +44,7 @@ package compiler.whitebox; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java b/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java index 819f1e5f15f5b..250cdfb4fa3de 100644 --- a/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/GetCodeHeapEntriesTest.java @@ -42,8 +42,8 @@ import jdk.test.lib.Asserts; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; -import sun.hotspot.code.CodeBlob; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.CodeBlob; import java.util.Arrays; import java.util.EnumSet; diff --git a/test/hotspot/jtreg/compiler/whitebox/GetNMethodTest.java b/test/hotspot/jtreg/compiler/whitebox/GetNMethodTest.java index a7180394e53e3..297b068e166ca 100644 --- a/test/hotspot/jtreg/compiler/whitebox/GetNMethodTest.java +++ b/test/hotspot/jtreg/compiler/whitebox/GetNMethodTest.java @@ -42,8 +42,8 @@ package compiler.whitebox; import jdk.test.lib.Asserts; -import sun.hotspot.code.BlobType; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.NMethod; public class GetNMethodTest extends CompilerWhiteBoxTest { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/gc/TestConcurrentGCBreakpoints.java b/test/hotspot/jtreg/gc/TestConcurrentGCBreakpoints.java index cda3653e672f5..64d6a6ebaea45 100644 --- a/test/hotspot/jtreg/gc/TestConcurrentGCBreakpoints.java +++ b/test/hotspot/jtreg/gc/TestConcurrentGCBreakpoints.java @@ -36,7 +36,7 @@ */ import jdk.test.whitebox.WhiteBox; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestConcurrentGCBreakpoints { diff --git a/test/hotspot/jtreg/gc/TestJNIWeak/TestJNIWeak.java b/test/hotspot/jtreg/gc/TestJNIWeak/TestJNIWeak.java index f72b517aaec35..98329b1152d25 100644 --- a/test/hotspot/jtreg/gc/TestJNIWeak/TestJNIWeak.java +++ b/test/hotspot/jtreg/gc/TestJNIWeak/TestJNIWeak.java @@ -43,7 +43,7 @@ * gc.TestJNIWeak.TestJNIWeak */ -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; import jdk.test.whitebox.WhiteBox; import jtreg.SkippedException; import java.lang.ref.Reference; diff --git a/test/hotspot/jtreg/gc/TestSmallHeap.java b/test/hotspot/jtreg/gc/TestSmallHeap.java index e0dd9e0d429a4..f4d44862ed6d8 100644 --- a/test/hotspot/jtreg/gc/TestSmallHeap.java +++ b/test/hotspot/jtreg/gc/TestSmallHeap.java @@ -63,7 +63,7 @@ import jtreg.SkippedException; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestSmallHeap { diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java b/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java index aaa97804a4b2b..be8c6494b54c5 100644 --- a/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java +++ b/test/hotspot/jtreg/gc/arguments/TestParallelGCThreads.java @@ -41,7 +41,7 @@ import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestParallelGCThreads { diff --git a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java b/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java index 151cdd9f51e72..b936e87c3708c 100644 --- a/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java +++ b/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java @@ -39,7 +39,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestParallelRefProc { diff --git a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java index 7130fcbb744dc..80f1828c0dd28 100644 --- a/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/test/hotspot/jtreg/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -37,7 +37,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestDynamicNumberOfGCThreads { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java b/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java index a29d38b3ce4d6..a20721a9e5629 100644 --- a/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java +++ b/test/hotspot/jtreg/gc/ergonomics/TestInitialGCThreadLogging.java @@ -37,7 +37,7 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestInitialGCThreadLogging { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java index 11b9eb3acd965..403c8446de9db 100644 --- a/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java +++ b/test/hotspot/jtreg/gc/g1/TestGCLogMessages.java @@ -41,7 +41,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class TestGCLogMessages { diff --git a/test/hotspot/jtreg/gc/g1/TestVerificationInConcurrentCycle.java b/test/hotspot/jtreg/gc/g1/TestVerificationInConcurrentCycle.java index fbeae430a7301..4c8ba4fef19b7 100644 --- a/test/hotspot/jtreg/gc/g1/TestVerificationInConcurrentCycle.java +++ b/test/hotspot/jtreg/gc/g1/TestVerificationInConcurrentCycle.java @@ -28,8 +28,8 @@ * @requires vm.gc.G1 * @summary Basic testing of various GC pause verification during the G1 concurrent cycle. * @library /test/lib - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm * -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI @@ -40,8 +40,8 @@ * gc.g1.TestVerificationInConcurrentCycle */ -import sun.hotspot.WhiteBox; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.WhiteBox; +import jdk.test.whitebox.gc.GC; public class TestVerificationInConcurrentCycle { diff --git a/test/hotspot/jtreg/gc/logging/TestGCId.java b/test/hotspot/jtreg/gc/logging/TestGCId.java index 19c22b54d32e5..f720bfac7ab6c 100644 --- a/test/hotspot/jtreg/gc/logging/TestGCId.java +++ b/test/hotspot/jtreg/gc/logging/TestGCId.java @@ -38,7 +38,7 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestGCId { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java index c8da8358fbfa3..bf4d58232a840 100644 --- a/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java +++ b/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java @@ -38,9 +38,9 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class UseCompressedOops { diff --git a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java index 76db8443043ee..ee1b10903a92f 100644 --- a/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java +++ b/test/hotspot/jtreg/runtime/MemberName/MemberNameLeak.java @@ -43,8 +43,8 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.Compiler; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.code.Compiler; +import jdk.test.whitebox.gc.GC; import jdk.test.lib.classloader.ClassWithManyMethodsClassLoader; public class MemberNameLeak { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java index 89eade28014ab..baf59d02fed48 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java @@ -45,7 +45,7 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import jdk.test.whitebox.WhiteBox; public class CommandLineFlagCombo { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java b/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java index cd56e43413d6f..46ea9d4f68476 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, 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 @@ -131,19 +131,15 @@ static void update(String jarFile, String dir) throws Exception { } // Add commonly used inner classes that are often omitted by mistake. Currently - // we support only jdk/test/whitebox/WhiteBox$WhiteBoxPermission and - // sun/hotspot/WhiteBox$WhiteBoxPermission. See JDK-8199290 + // we support only jdk/test/whitebox/WhiteBox$WhiteBoxPermission. + // See JDK-8199290 private static String[] addInnerClasses(String[] classes, int startIdx) { boolean seenNewWb = false; boolean seenNewWbInner = false; - boolean seenOldWb = false; - boolean seenOldWbInner = false; // This method is different than ClassFileInstaller.addInnerClasses which // uses "." as the package delimiter :-( final String newWb = "jdk/test/whitebox/WhiteBox"; final String newWbInner = newWb + "$WhiteBoxPermission"; - final String oldWb = "sun/hotspot/WhiteBox"; - final String oldWbInner = oldWb + "$WhiteBoxPermission"; ArrayList list = new ArrayList<>(); @@ -153,17 +149,11 @@ private static String[] addInnerClasses(String[] classes, int startIdx) { switch (cls) { case newWb: seenNewWb = true; break; case newWbInner: seenNewWbInner = true; break; - case oldWb: seenOldWb = true; break; - case oldWbInner: seenOldWbInner = true; break; } } if (seenNewWb && !seenNewWbInner) { list.add(newWbInner); } - if (seenOldWb && !seenOldWbInner) { - list.add(oldWbInner); - } - String[] array = new String[list.size()]; list.toArray(array); return array; diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/CDSStreamTestDriver.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/CDSStreamTestDriver.java index 1c8c2084f7c56..bbc7f317835aa 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/CDSStreamTestDriver.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/CDSStreamTestDriver.java @@ -38,7 +38,7 @@ import org.testng.annotations.Test; import java.io.File; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; @Test public class CDSStreamTestDriver extends DynamicArchiveTestBase { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java index 052df21cddefc..095f4bb83491c 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/MainModuleOnly.java @@ -43,7 +43,7 @@ import jdk.test.lib.cds.CDSTestUtils; import jtreg.SkippedException; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class MainModuleOnly extends DynamicArchiveTestBase { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java index 4e9c38e5d748f..83a4d73fdcead 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/jigsaw/modulepath/MainModuleOnly.java @@ -44,7 +44,7 @@ import jdk.test.lib.Platform; import jtreg.SkippedException; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class MainModuleOnly { diff --git a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java index 0fcb5c205c935..8d3d75d9c084b 100644 --- a/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java @@ -71,8 +71,8 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; -import sun.hotspot.code.Compiler; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.code.Compiler; +import jdk.test.whitebox.gc.GC; public class IncompatibleOptions { static final String COOPS_DUMP_WARNING = diff --git a/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java b/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java index 1f06dc83ca5d8..10eb3a14ddbd4 100644 --- a/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java +++ b/test/hotspot/jtreg/runtime/stringtable/StringTableCleaningTest.java @@ -50,7 +50,7 @@ import java.util.regex.Pattern; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class StringTableCleaningTest { public static void main(String[] args) throws Exception { diff --git a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java index 6e25699487b7e..44f31a50b3505 100644 --- a/test/hotspot/jtreg/serviceability/sa/TestUniverse.java +++ b/test/hotspot/jtreg/serviceability/sa/TestUniverse.java @@ -21,7 +21,7 @@ * questions. */ -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ import java.util.HashMap; import jdk.test.lib.apps.LingeredApp; import jtreg.SkippedException; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; /** * @test diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java index ab265125f0854..bf7256652f2c2 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java @@ -61,9 +61,9 @@ * TestDriver */ -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; public class TestDriver { public static void main(String[] args) throws Exception { diff --git a/test/jdk/com/sun/jdi/EATests.java b/test/jdk/com/sun/jdi/EATests.java index 998e5066fb10f..a0dea0e8352ce 100644 --- a/test/jdk/com/sun/jdi/EATests.java +++ b/test/jdk/com/sun/jdi/EATests.java @@ -123,7 +123,7 @@ import jdk.test.lib.Asserts; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.gc.GC; +import jdk.test.whitebox.gc.GC; // diff --git a/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java b/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java index 80836e76239e8..98b01a3428d4e 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java +++ b/test/jdk/java/lang/management/MemoryMXBean/CollectionUsageThreshold.java @@ -48,7 +48,7 @@ import static java.lang.management.MemoryNotificationInfo.*;; import static java.lang.management.ManagementFactory.*; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class CollectionUsageThreshold { private static final MemoryMXBean mm = getMemoryMXBean(); diff --git a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java index 490b862e0db9f..7d14da1f4c7ea 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java +++ b/test/jdk/java/lang/management/MemoryMXBean/LowMemoryTest.java @@ -49,7 +49,7 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class LowMemoryTest { private static final MemoryMXBean mm = ManagementFactory.getMemoryMXBean(); diff --git a/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java b/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java index 5a9afcbed93e4..776ae63dc34bd 100644 --- a/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java +++ b/test/jdk/java/lang/management/MemoryMXBean/ResetPeakMemoryUsage.java @@ -47,7 +47,7 @@ import java.lang.ref.WeakReference; import java.util.*; -import sun.hotspot.code.Compiler; +import jdk.test.whitebox.code.Compiler; public class ResetPeakMemoryUsage { private static MemoryMXBean mbean = ManagementFactory.getMemoryMXBean(); diff --git a/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java b/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java index 6eca03c274dc0..71ed542dcd85c 100644 --- a/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java +++ b/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java @@ -31,7 +31,7 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; +import jdk.test.whitebox.code.BlobType; /** * @test TestCodeCacheFull diff --git a/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java b/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java index 93b66b066118f..c2a6977de668b 100644 --- a/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java +++ b/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java @@ -35,8 +35,8 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.BlobType; -import sun.hotspot.code.CodeBlob; +import jdk.test.whitebox.code.BlobType; +import jdk.test.whitebox.code.CodeBlob; /** * Test for events: vm/code_sweeper/sweep vm/code_cache/full vm/compiler/failure diff --git a/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java b/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java index ade3941152692..329f2714b9a8e 100644 --- a/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java +++ b/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java @@ -51,7 +51,7 @@ import jdk.jfr.internal.JVM; import jdk.test.lib.Platform; import jdk.test.whitebox.WhiteBox; -import sun.hotspot.code.NMethod; +import jdk.test.whitebox.code.NMethod; public class TestJFRIntrinsic { private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); diff --git a/test/lib-test/jdk/test/whitebox/OldWhiteBox.java b/test/lib-test/jdk/test/whitebox/OldWhiteBox.java deleted file mode 100644 index 41af4698e9843..0000000000000 --- a/test/lib-test/jdk/test/whitebox/OldWhiteBox.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test id=without-inner-class - * @summary verify that sun.hotspot.WhiteBox class still can be used - * @library /test/lib - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI OldWhiteBox - */ - -/* - * @test id=with-inner-class - * @summary verify that sun.hotspot.WhiteBox class still can be used - * @library /test/lib - * @build sun.hotspot.WhiteBox - * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI OldWhiteBox - */ - -import sun.hotspot.WhiteBox; - -public class OldWhiteBox { - public static void main(String[] args) { - @SuppressWarnings("deprecation") - WhiteBox wb = WhiteBox.getWhiteBox(); - if (wb.getHeapOopSize() < 0) { - throw new Error("wb.getHeapOopSize() < 0"); - } - } -} diff --git a/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java index 69f753f5a84e7..d6dbcb1de8526 100644 --- a/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java +++ b/test/lib/jdk/test/lib/cli/predicate/CPUSpecificPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -24,7 +24,7 @@ package jdk.test.lib.cli.predicate; import jdk.test.lib.Platform; -import sun.hotspot.cpuinfo.CPUInfo; +import jdk.test.whitebox.cpuinfo.CPUInfo; import java.util.function.BooleanSupplier; diff --git a/test/lib/jdk/test/lib/helpers/ClassFileInstaller.java b/test/lib/jdk/test/lib/helpers/ClassFileInstaller.java index a186afb839149..d344344601d9c 100644 --- a/test/lib/jdk/test/lib/helpers/ClassFileInstaller.java +++ b/test/lib/jdk/test/lib/helpers/ClassFileInstaller.java @@ -100,17 +100,13 @@ public static void main(String... args) throws Exception { } // Add commonly used inner classes that are often omitted by mistake. Currently - // we support only jdk.test.whitebox.WhiteBox$WhiteBoxPermission and - // jdk/test/whitebox/WhiteBox$WhiteBoxPermission. See JDK-8199290 + // we support only jdk.test.whitebox.WhiteBox$WhiteBoxPermission. + // See JDK-8199290 private static String[] addInnerClasses(String[] classes, int startIdx) { boolean seenNewWb = false; boolean seenNewWbInner = false; - boolean seenOldWb = false; - boolean seenOldWbInner = false; final String newWb = "jdk.test.whitebox.WhiteBox"; final String newWbInner = newWb + "$WhiteBoxPermission"; - final String oldWb = "sun.hotspot.WhiteBox"; - final String oldWbInner = oldWb + "$WhiteBoxPermission"; ArrayList list = new ArrayList<>(); @@ -120,17 +116,11 @@ private static String[] addInnerClasses(String[] classes, int startIdx) { switch (cls) { case newWb: seenNewWb = true; break; case newWbInner: seenNewWbInner = true; break; - case oldWb: seenOldWb = true; break; - case oldWbInner: seenOldWbInner = true; break; } } if (seenNewWb && !seenNewWbInner) { list.add(newWbInner); } - if (seenOldWb && !seenOldWbInner) { - list.add(oldWbInner); - } - String[] array = new String[list.size()]; list.toArray(array); return array; diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java deleted file mode 100644 index 718c9685f4f68..0000000000000 --- a/test/lib/sun/hotspot/WhiteBox.java +++ /dev/null @@ -1,698 +0,0 @@ -/* - * Copyright (c) 2012, 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot; - -import java.lang.management.MemoryUsage; -import java.lang.reflect.Executable; -import java.util.Arrays; -import java.util.List; -import java.util.function.BiFunction; -import java.util.function.Function; -import java.security.BasicPermission; -import java.util.Objects; - -import jdk.test.whitebox.parser.DiagnosticCommand; - -@Deprecated -public class WhiteBox { - @SuppressWarnings("serial") - public static class WhiteBoxPermission extends BasicPermission { - public WhiteBoxPermission(String s) { - super(s); - } - } - - private WhiteBox() {} - private static final WhiteBox instance = new WhiteBox(); - private static native void registerNatives(); - - /** - * Returns the singleton WhiteBox instance. - * - * The returned WhiteBox object should be carefully guarded - * by the caller, since it can be used to read and write data - * at arbitrary memory addresses. It must never be passed to - * untrusted code. - */ - public synchronized static WhiteBox getWhiteBox() { - @SuppressWarnings("removal") - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - throw new SecurityException("can't use old whitebox with SecurityManager, please switch to jdk.test.whitebox.WhiteBox"); - } - return instance; - } - - static { - registerNatives(); - } - - // Get the maximum heap size supporting COOPs - public native long getCompressedOopsMaxHeapSize(); - // Arguments - public native void printHeapSizes(); - - // Memory - private native long getObjectAddress0(Object o); - public long getObjectAddress(Object o) { - Objects.requireNonNull(o); - return getObjectAddress0(o); - } - - public native int getHeapOopSize(); - public native int getVMPageSize(); - public native long getVMAllocationGranularity(); - public native long getVMLargePageSize(); - public native long getHeapSpaceAlignment(); - public native long getHeapAlignment(); - - private native boolean isObjectInOldGen0(Object o); - public boolean isObjectInOldGen(Object o) { - Objects.requireNonNull(o); - return isObjectInOldGen0(o); - } - - private native long getObjectSize0(Object o); - public long getObjectSize(Object o) { - Objects.requireNonNull(o); - return getObjectSize0(o); - } - - // Runtime - // Make sure class name is in the correct format - public int countAliveClasses(String name) { - return countAliveClasses0(name.replace('.', '/')); - } - private native int countAliveClasses0(String name); - - public boolean isClassAlive(String name) { - return countAliveClasses(name) != 0; - } - - public native int getSymbolRefcount(String name); - - public native boolean deflateIdleMonitors(); - - private native boolean isMonitorInflated0(Object obj); - public boolean isMonitorInflated(Object obj) { - Objects.requireNonNull(obj); - return isMonitorInflated0(obj); - } - - public native void forceSafepoint(); - - private native long getConstantPool0(Class aClass); - public long getConstantPool(Class aClass) { - Objects.requireNonNull(aClass); - return getConstantPool0(aClass); - } - - private native int getConstantPoolCacheIndexTag0(); - public int getConstantPoolCacheIndexTag() { - return getConstantPoolCacheIndexTag0(); - } - - private native int getConstantPoolCacheLength0(Class aClass); - public int getConstantPoolCacheLength(Class aClass) { - Objects.requireNonNull(aClass); - return getConstantPoolCacheLength0(aClass); - } - - private native int remapInstructionOperandFromCPCache0(Class aClass, int index); - public int remapInstructionOperandFromCPCache(Class aClass, int index) { - Objects.requireNonNull(aClass); - return remapInstructionOperandFromCPCache0(aClass, index); - } - - private native int encodeConstantPoolIndyIndex0(int index); - public int encodeConstantPoolIndyIndex(int index) { - return encodeConstantPoolIndyIndex0(index); - } - - // JVMTI - private native void addToBootstrapClassLoaderSearch0(String segment); - public void addToBootstrapClassLoaderSearch(String segment){ - Objects.requireNonNull(segment); - addToBootstrapClassLoaderSearch0(segment); - } - - private native void addToSystemClassLoaderSearch0(String segment); - public void addToSystemClassLoaderSearch(String segment) { - Objects.requireNonNull(segment); - addToSystemClassLoaderSearch0(segment); - } - - // G1 - public native boolean g1InConcurrentMark(); - public native boolean g1HasRegionsToUncommit(); - private native boolean g1IsHumongous0(Object o); - public boolean g1IsHumongous(Object o) { - Objects.requireNonNull(o); - return g1IsHumongous0(o); - } - - private native boolean g1BelongsToHumongousRegion0(long adr); - public boolean g1BelongsToHumongousRegion(long adr) { - if (adr == 0) { - throw new IllegalArgumentException("adr argument should not be null"); - } - return g1BelongsToHumongousRegion0(adr); - } - - - private native boolean g1BelongsToFreeRegion0(long adr); - public boolean g1BelongsToFreeRegion(long adr) { - if (adr == 0) { - throw new IllegalArgumentException("adr argument should not be null"); - } - return g1BelongsToFreeRegion0(adr); - } - - public native long g1NumMaxRegions(); - public native long g1NumFreeRegions(); - public native int g1RegionSize(); - public native MemoryUsage g1AuxiliaryMemoryUsage(); - private native Object[] parseCommandLine0(String commandline, char delim, DiagnosticCommand[] args); - public Object[] parseCommandLine(String commandline, char delim, DiagnosticCommand[] args) { - Objects.requireNonNull(args); - return parseCommandLine0(commandline, delim, args); - } - - public native int g1ActiveMemoryNodeCount(); - public native int[] g1MemoryNodeIds(); - - // Parallel GC - public native long psVirtualSpaceAlignment(); - public native long psHeapGenerationAlignment(); - - /** - * Enumerates old regions with liveness less than specified and produces some statistics - * @param liveness percent of region's liveness (live_objects / total_region_size * 100). - * @return long[3] array where long[0] - total count of old regions - * long[1] - total memory of old regions - * long[2] - lowest estimation of total memory of old regions to be freed (non-full - * regions are not included) - */ - public native long[] g1GetMixedGCInfo(int liveness); - - // NMT - public native long NMTMalloc(long size); - public native void NMTFree(long mem); - public native long NMTReserveMemory(long size); - public native long NMTAttemptReserveMemoryAt(long addr, long size); - public native void NMTCommitMemory(long addr, long size); - public native void NMTUncommitMemory(long addr, long size); - public native void NMTReleaseMemory(long addr, long size); - public native long NMTMallocWithPseudoStack(long size, int index); - public native long NMTMallocWithPseudoStackAndType(long size, int index, int type); - public native int NMTGetHashSize(); - public native long NMTNewArena(long initSize); - public native void NMTFreeArena(long arena); - public native void NMTArenaMalloc(long arena, long size); - - // Compiler - public native boolean isC2OrJVMCIIncluded(); - public native boolean isJVMCISupportedByGC(); - - public native int matchesMethod(Executable method, String pattern); - public native int matchesInline(Executable method, String pattern); - public native boolean shouldPrintAssembly(Executable method, int comp_level); - public native int deoptimizeFrames(boolean makeNotEntrant); - public native boolean isFrameDeoptimized(int depth); - public native void deoptimizeAll(); - - public boolean isMethodCompiled(Executable method) { - return isMethodCompiled(method, false /*not osr*/); - } - private native boolean isMethodCompiled0(Executable method, boolean isOsr); - public boolean isMethodCompiled(Executable method, boolean isOsr){ - Objects.requireNonNull(method); - return isMethodCompiled0(method, isOsr); - } - public boolean isMethodCompilable(Executable method) { - return isMethodCompilable(method, -1 /*any*/); - } - public boolean isMethodCompilable(Executable method, int compLevel) { - return isMethodCompilable(method, compLevel, false /*not osr*/); - } - private native boolean isMethodCompilable0(Executable method, int compLevel, boolean isOsr); - public boolean isMethodCompilable(Executable method, int compLevel, boolean isOsr) { - Objects.requireNonNull(method); - return isMethodCompilable0(method, compLevel, isOsr); - } - private native boolean isMethodQueuedForCompilation0(Executable method); - public boolean isMethodQueuedForCompilation(Executable method) { - Objects.requireNonNull(method); - return isMethodQueuedForCompilation0(method); - } - // Determine if the compiler corresponding to the compilation level 'compLevel' - // and to the compilation context 'compilation_context' provides an intrinsic - // for the method 'method'. An intrinsic is available for method 'method' if: - // - the intrinsic is enabled (by using the appropriate command-line flag) and - // - the platform on which the VM is running provides the instructions necessary - // for the compiler to generate the intrinsic code. - // - // The compilation context is related to using the DisableIntrinsic flag on a - // per-method level, see hotspot/src/share/vm/compiler/abstractCompiler.hpp - // for more details. - public boolean isIntrinsicAvailable(Executable method, - Executable compilationContext, - int compLevel) { - Objects.requireNonNull(method); - return isIntrinsicAvailable0(method, compilationContext, compLevel); - } - // If usage of the DisableIntrinsic flag is not expected (or the usage can be ignored), - // use the below method that does not require the compilation context as argument. - public boolean isIntrinsicAvailable(Executable method, int compLevel) { - return isIntrinsicAvailable(method, null, compLevel); - } - private native boolean isIntrinsicAvailable0(Executable method, - Executable compilationContext, - int compLevel); - public int deoptimizeMethod(Executable method) { - return deoptimizeMethod(method, false /*not osr*/); - } - private native int deoptimizeMethod0(Executable method, boolean isOsr); - public int deoptimizeMethod(Executable method, boolean isOsr) { - Objects.requireNonNull(method); - return deoptimizeMethod0(method, isOsr); - } - public void makeMethodNotCompilable(Executable method) { - makeMethodNotCompilable(method, -1 /*any*/); - } - public void makeMethodNotCompilable(Executable method, int compLevel) { - makeMethodNotCompilable(method, compLevel, false /*not osr*/); - } - private native void makeMethodNotCompilable0(Executable method, int compLevel, boolean isOsr); - public void makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr) { - Objects.requireNonNull(method); - makeMethodNotCompilable0(method, compLevel, isOsr); - } - public int getMethodCompilationLevel(Executable method) { - return getMethodCompilationLevel(method, false /*not osr*/); - } - private native int getMethodCompilationLevel0(Executable method, boolean isOsr); - public int getMethodCompilationLevel(Executable method, boolean isOsr) { - Objects.requireNonNull(method); - return getMethodCompilationLevel0(method, isOsr); - } - public int getMethodDecompileCount(Executable method) { - Objects.requireNonNull(method); - return getMethodDecompileCount0(method); - } - private native int getMethodDecompileCount0(Executable method); - // Get the total trap count of a method. If the trap count for a specific reason - // did overflow, this includes the overflow trap count of the method. - public int getMethodTrapCount(Executable method) { - Objects.requireNonNull(method); - return getMethodTrapCount0(method, null); - } - // Get the trap count of a method for a specific reason. If the trap count for - // that reason did overflow, this includes the overflow trap count of the method. - public int getMethodTrapCount(Executable method, String reason) { - Objects.requireNonNull(method); - return getMethodTrapCount0(method, reason); - } - private native int getMethodTrapCount0(Executable method, String reason); - // Get the total deopt count. - public int getDeoptCount() { - return getDeoptCount0(null, null); - } - // Get the deopt count for a specific reason and a specific action. If either - // one of 'reason' or 'action' is null, the method returns the sum of all - // deoptimizations with the specific 'action' or 'reason' respectively. - // If both arguments are null, the method returns the total deopt count. - public int getDeoptCount(String reason, String action) { - return getDeoptCount0(reason, action); - } - private native int getDeoptCount0(String reason, String action); - private native boolean testSetDontInlineMethod0(Executable method, boolean value); - public boolean testSetDontInlineMethod(Executable method, boolean value) { - Objects.requireNonNull(method); - return testSetDontInlineMethod0(method, value); - } - public int getCompileQueuesSize() { - return getCompileQueueSize(-1 /*any*/); - } - public native int getCompileQueueSize(int compLevel); - private native boolean testSetForceInlineMethod0(Executable method, boolean value); - public boolean testSetForceInlineMethod(Executable method, boolean value) { - Objects.requireNonNull(method); - return testSetForceInlineMethod0(method, value); - } - public boolean enqueueMethodForCompilation(Executable method, int compLevel) { - return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/); - } - private native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci); - public boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) { - Objects.requireNonNull(method); - return enqueueMethodForCompilation0(method, compLevel, entry_bci); - } - private native boolean enqueueInitializerForCompilation0(Class aClass, int compLevel); - public boolean enqueueInitializerForCompilation(Class aClass, int compLevel) { - Objects.requireNonNull(aClass); - return enqueueInitializerForCompilation0(aClass, compLevel); - } - private native void clearMethodState0(Executable method); - public native void markMethodProfiled(Executable method); - public void clearMethodState(Executable method) { - Objects.requireNonNull(method); - clearMethodState0(method); - } - public native void lockCompilation(); - public native void unlockCompilation(); - private native int getMethodEntryBci0(Executable method); - public int getMethodEntryBci(Executable method) { - Objects.requireNonNull(method); - return getMethodEntryBci0(method); - } - private native Object[] getNMethod0(Executable method, boolean isOsr); - public Object[] getNMethod(Executable method, boolean isOsr) { - Objects.requireNonNull(method); - return getNMethod0(method, isOsr); - } - public native long allocateCodeBlob(int size, int type); - public long allocateCodeBlob(long size, int type) { - int intSize = (int) size; - if ((long) intSize != size || size < 0) { - throw new IllegalArgumentException( - "size argument has illegal value " + size); - } - return allocateCodeBlob( intSize, type); - } - public native void freeCodeBlob(long addr); - public native void forceNMethodSweep(); - public native Object[] getCodeHeapEntries(int type); - public native int getCompilationActivityMode(); - private native long getMethodData0(Executable method); - public long getMethodData(Executable method) { - Objects.requireNonNull(method); - return getMethodData0(method); - } - public native Object[] getCodeBlob(long addr); - - private native void clearInlineCaches0(boolean preserve_static_stubs); - public void clearInlineCaches() { - clearInlineCaches0(false); - } - public void clearInlineCaches(boolean preserve_static_stubs) { - clearInlineCaches0(preserve_static_stubs); - } - - // Intered strings - public native boolean isInStringTable(String str); - - // Memory - public native void readReservedMemory(); - public native long allocateMetaspace(ClassLoader classLoader, long size); - public native long incMetaspaceCapacityUntilGC(long increment); - public native long metaspaceCapacityUntilGC(); - public native long metaspaceSharedRegionAlignment(); - - // Metaspace Arena Tests - public native long createMetaspaceTestContext(long commit_limit, long reserve_limit); - public native void destroyMetaspaceTestContext(long context); - public native void purgeMetaspaceTestContext(long context); - public native void printMetaspaceTestContext(long context); - public native long getTotalCommittedWordsInMetaspaceTestContext(long context); - public native long getTotalUsedWordsInMetaspaceTestContext(long context); - public native long createArenaInTestContext(long context, boolean is_micro); - public native void destroyMetaspaceTestArena(long arena); - public native long allocateFromMetaspaceTestArena(long arena, long word_size); - public native void deallocateToMetaspaceTestArena(long arena, long p, long word_size); - - public native long maxMetaspaceAllocationSize(); - - // Don't use these methods directly - // Use sun.hotspot.gc.GC class instead. - public native boolean isGCSupported(int name); - public native boolean isGCSupportedByJVMCICompiler(int name); - public native boolean isGCSelected(int name); - public native boolean isGCSelectedErgonomically(); - - // Force Young GC - public native void youngGC(); - - // Force Full GC - public native void fullGC(); - - // Returns true if the current GC supports concurrent collection control. - public native boolean supportsConcurrentGCBreakpoints(); - - private void checkConcurrentGCBreakpointsSupported() { - if (!supportsConcurrentGCBreakpoints()) { - throw new UnsupportedOperationException("Concurrent GC breakpoints not supported"); - } - } - - private native void concurrentGCAcquireControl0(); - private native void concurrentGCReleaseControl0(); - private native void concurrentGCRunToIdle0(); - private native boolean concurrentGCRunTo0(String breakpoint); - - private static boolean concurrentGCIsControlled = false; - private void checkConcurrentGCIsControlled() { - if (!concurrentGCIsControlled) { - throw new IllegalStateException("Not controlling concurrent GC"); - } - } - - // All collectors supporting concurrent GC breakpoints are expected - // to provide at least the following breakpoints. - public final String AFTER_MARKING_STARTED = "AFTER MARKING STARTED"; - public final String BEFORE_MARKING_COMPLETED = "BEFORE MARKING COMPLETED"; - - // Collectors supporting concurrent GC breakpoints that do reference - // processing concurrently should provide the following breakpoint. - public final String AFTER_CONCURRENT_REFERENCE_PROCESSING_STARTED = - "AFTER CONCURRENT REFERENCE PROCESSING STARTED"; - - // G1 specific GC breakpoints. - public final String G1_AFTER_REBUILD_STARTED = "AFTER REBUILD STARTED"; - public final String G1_BEFORE_REBUILD_COMPLETED = "BEFORE REBUILD COMPLETED"; - public final String G1_AFTER_CLEANUP_STARTED = "AFTER CLEANUP STARTED"; - public final String G1_BEFORE_CLEANUP_COMPLETED = "BEFORE CLEANUP COMPLETED"; - - public void concurrentGCAcquireControl() { - checkConcurrentGCBreakpointsSupported(); - if (concurrentGCIsControlled) { - throw new IllegalStateException("Already controlling concurrent GC"); - } - concurrentGCAcquireControl0(); - concurrentGCIsControlled = true; - } - - public void concurrentGCReleaseControl() { - checkConcurrentGCBreakpointsSupported(); - concurrentGCReleaseControl0(); - concurrentGCIsControlled = false; - } - - // Keep concurrent GC idle. Release from breakpoint. - public void concurrentGCRunToIdle() { - checkConcurrentGCBreakpointsSupported(); - checkConcurrentGCIsControlled(); - concurrentGCRunToIdle0(); - } - - // Allow concurrent GC to run to breakpoint. - // Throws IllegalStateException if reached end of cycle first. - public void concurrentGCRunTo(String breakpoint) { - concurrentGCRunTo(breakpoint, true); - } - - // Allow concurrent GC to run to breakpoint. - // Returns true if reached breakpoint. If reached end of cycle first, - // then throws IllegalStateException if errorIfFail is true, returning - // false otherwise. - public boolean concurrentGCRunTo(String breakpoint, boolean errorIfFail) { - checkConcurrentGCBreakpointsSupported(); - checkConcurrentGCIsControlled(); - if (breakpoint == null) { - throw new NullPointerException("null breakpoint"); - } else if (concurrentGCRunTo0(breakpoint)) { - return true; - } else if (errorIfFail) { - throw new IllegalStateException("Missed requested breakpoint \"" + breakpoint + "\""); - } else { - return false; - } - } - - // Method tries to start concurrent mark cycle. - // It returns false if CM Thread is always in concurrent cycle. - public native boolean g1StartConcMarkCycle(); - - // Tests on ReservedSpace/VirtualSpace classes - public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations); - public native void readFromNoaccessArea(); - public native long getThreadStackSize(); - public native long getThreadRemainingStackSize(); - - // CPU features - public native String getCPUFeatures(); - - // VM flags - public native boolean isConstantVMFlag(String name); - public native boolean isLockedVMFlag(String name); - public native void setBooleanVMFlag(String name, boolean value); - public native void setIntVMFlag(String name, long value); - public native void setUintVMFlag(String name, long value); - public native void setIntxVMFlag(String name, long value); - public native void setUintxVMFlag(String name, long value); - public native void setUint64VMFlag(String name, long value); - public native void setSizeTVMFlag(String name, long value); - public native void setStringVMFlag(String name, String value); - public native void setDoubleVMFlag(String name, double value); - public native Boolean getBooleanVMFlag(String name); - public native Long getIntVMFlag(String name); - public native Long getUintVMFlag(String name); - public native Long getIntxVMFlag(String name); - public native Long getUintxVMFlag(String name); - public native Long getUint64VMFlag(String name); - public native Long getSizeTVMFlag(String name); - public native String getStringVMFlag(String name); - public native Double getDoubleVMFlag(String name); - private final List> flagsGetters = Arrays.asList( - this::getBooleanVMFlag, this::getIntVMFlag, this::getUintVMFlag, - this::getIntxVMFlag, this::getUintxVMFlag, this::getUint64VMFlag, - this::getSizeTVMFlag, this::getStringVMFlag, this::getDoubleVMFlag); - - public Object getVMFlag(String name) { - return flagsGetters.stream() - .map(f -> f.apply(name)) - .filter(x -> x != null) - .findAny() - .orElse(null); - } - - // Jigsaw - public native void DefineModule(Object module, boolean is_open, String version, - String location, Object[] packages); - public native void AddModuleExports(Object from_module, String pkg, Object to_module); - public native void AddReadsModule(Object from_module, Object source_module); - public native void AddModuleExportsToAllUnnamed(Object module, String pkg); - public native void AddModuleExportsToAll(Object module, String pkg); - - public native int getCDSOffsetForName0(String name); - public int getCDSOffsetForName(String name) throws Exception { - int offset = getCDSOffsetForName0(name); - if (offset == -1) { - throw new RuntimeException(name + " not found"); - } - return offset; - } - public native int getCDSConstantForName0(String name); - public int getCDSConstantForName(String name) throws Exception { - int constant = getCDSConstantForName0(name); - if (constant == -1) { - throw new RuntimeException(name + " not found"); - } - return constant; - } - public native Boolean getMethodBooleanOption(Executable method, String name); - public native Long getMethodIntxOption(Executable method, String name); - public native Long getMethodUintxOption(Executable method, String name); - public native Double getMethodDoubleOption(Executable method, String name); - public native String getMethodStringOption(Executable method, String name); - private final List> methodOptionGetters - = Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption, - this::getMethodUintxOption, this::getMethodDoubleOption, - this::getMethodStringOption); - - public Object getMethodOption(Executable method, String name) { - return methodOptionGetters.stream() - .map(f -> f.apply(method, name)) - .filter(x -> x != null) - .findAny() - .orElse(null); - } - - // Sharing & archiving - public native int getCDSGenericHeaderMinVersion(); - public native int getCurrentCDSVersion(); - public native String getDefaultArchivePath(); - public native boolean cdsMemoryMappingFailed(); - public native boolean isSharingEnabled(); - public native boolean isShared(Object o); - public native boolean isSharedClass(Class c); - public native boolean areSharedStringsMapped(); - public native boolean isSharedInternedString(String s); - public native boolean isCDSIncluded(); - public native boolean isJFRIncluded(); - public native boolean isDTraceIncluded(); - public native boolean canWriteJavaHeapArchive(); - public native Object getResolvedReferences(Class c); - public native void linkClass(Class c); - public native boolean areOpenArchiveHeapObjectsMapped(); - - // Compiler Directive - public native int addCompilerDirective(String compDirect); - public native void removeCompilerDirective(int count); - - // Handshakes - public native int handshakeWalkStack(Thread t, boolean all_threads); - public native boolean handshakeReadMonitors(Thread t); - public native void asyncHandshakeWalkStack(Thread t); - - public native void lockAndBlock(boolean suspender); - - // Returns true on linux if library has the noexecstack flag set. - public native boolean checkLibSpecifiesNoexecstack(String libfilename); - - // Container testing - public native boolean isContainerized(); - public native int validateCgroup(String procCgroups, - String procSelfCgroup, - String procSelfMountinfo); - public native void printOsInfo(); - - // Decoder - public native void disableElfSectionCache(); - - // Resolved Method Table - public native long resolvedMethodItemsCount(); - - // Protection Domain Table - public native int protectionDomainRemovedCount(); - - public native int getKlassMetadataSize(Class c); - - // ThreadSMR GC safety check for threadObj - public native void checkThreadObjOfTerminatingThread(Thread target); - - // libc name - public native String getLibcName(); - - // Walk stack frames of current thread - public native void verifyFrames(boolean log, boolean updateRegisterMap); - - public native boolean isJVMTIIncluded(); - - public native void waitUnsafe(int time_ms); - - public native void lockCritical(); - - public native void unlockCritical(); -} diff --git a/test/lib/sun/hotspot/code/BlobType.java b/test/lib/sun/hotspot/code/BlobType.java deleted file mode 100644 index 9522052e7b154..0000000000000 --- a/test/lib/sun/hotspot/code/BlobType.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2014, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.code; - -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryPoolMXBean; -import java.util.EnumSet; - -import jdk.test.whitebox.WhiteBox; - -public enum BlobType { - // Execution level 1 and 4 (non-profiled) nmethods (including native nmethods) - MethodNonProfiled(0, "CodeHeap 'non-profiled nmethods'", "NonProfiledCodeHeapSize") { - @Override - public boolean allowTypeWhenOverflow(BlobType type) { - return super.allowTypeWhenOverflow(type) - || type == BlobType.MethodProfiled; - } - }, - // Execution level 2 and 3 (profiled) nmethods - MethodProfiled(1, "CodeHeap 'profiled nmethods'", "ProfiledCodeHeapSize") { - @Override - public boolean allowTypeWhenOverflow(BlobType type) { - return super.allowTypeWhenOverflow(type) - || type == BlobType.MethodNonProfiled; - } - }, - // Non-nmethods like Buffers, Adapters and Runtime Stubs - NonNMethod(2, "CodeHeap 'non-nmethods'", "NonNMethodCodeHeapSize") { - @Override - public boolean allowTypeWhenOverflow(BlobType type) { - return super.allowTypeWhenOverflow(type) - || type == BlobType.MethodNonProfiled - || type == BlobType.MethodProfiled; - } - }, - // All types (No code cache segmentation) - All(3, "CodeCache", "ReservedCodeCacheSize"); - - public final int id; - public final String sizeOptionName; - public final String beanName; - - private BlobType(int id, String beanName, String sizeOptionName) { - this.id = id; - this.beanName = beanName; - this.sizeOptionName = sizeOptionName; - } - - public MemoryPoolMXBean getMemoryPool() { - for (MemoryPoolMXBean bean : ManagementFactory.getMemoryPoolMXBeans()) { - String name = bean.getName(); - if (beanName.equals(name)) { - return bean; - } - } - return null; - } - - public boolean allowTypeWhenOverflow(BlobType type) { - return type == this; - } - - public static EnumSet getAvailable() { - WhiteBox whiteBox = WhiteBox.getWhiteBox(); - if (!whiteBox.getBooleanVMFlag("SegmentedCodeCache")) { - // only All for non segmented world - return EnumSet.of(All); - } - if (System.getProperty("java.vm.info").startsWith("interpreted ")) { - // only NonNMethod for -Xint - return EnumSet.of(NonNMethod); - } - - EnumSet result = EnumSet.complementOf(EnumSet.of(All)); - if (!whiteBox.getBooleanVMFlag("TieredCompilation") - || whiteBox.getIntxVMFlag("TieredStopAtLevel") <= 1) { - // there is no MethodProfiled in non tiered world or pure C1 - result.remove(MethodProfiled); - } - return result; - } - - public long getSize() { - return WhiteBox.getWhiteBox().getUintxVMFlag(sizeOptionName); - } -} diff --git a/test/lib/sun/hotspot/code/CodeBlob.java b/test/lib/sun/hotspot/code/CodeBlob.java deleted file mode 100644 index f9eb874091fc1..0000000000000 --- a/test/lib/sun/hotspot/code/CodeBlob.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2014, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.code; - -import jdk.test.whitebox.WhiteBox; - -@Deprecated -public class CodeBlob { - private static final WhiteBox WB = WhiteBox.getWhiteBox(); - public static CodeBlob[] getCodeBlobs(BlobType type) { - Object[] obj = WB.getCodeHeapEntries(type.id); - if (obj == null) { - return null; - } - CodeBlob[] result = new CodeBlob[obj.length]; - for (int i = 0, n = result.length; i < n; ++i) { - result[i] = new CodeBlob((Object[]) obj[i]); - } - return result; - } - public static CodeBlob getCodeBlob(long addr) { - Object[] obj = WB.getCodeBlob(addr); - if (obj == null) { - return null; - } - return new CodeBlob(obj); - } - protected CodeBlob(Object[] obj) { - assert obj.length == 4; - name = (String) obj[0]; - size = (Integer) obj[1]; - int blob_type_index = (Integer) obj[2]; - code_blob_type = BlobType.values()[blob_type_index]; - assert code_blob_type.id == (Integer) obj[2]; - address = (Long) obj[3]; - } - public final String name; - public final int size; - public final BlobType code_blob_type; - public final long address; - @Override - public String toString() { - return "CodeBlob{" - + "name=" + name - + ", size=" + size - + ", code_blob_type=" + code_blob_type - + ", address=" + address - + '}'; - } -} diff --git a/test/lib/sun/hotspot/code/Compiler.java b/test/lib/sun/hotspot/code/Compiler.java deleted file mode 100644 index 68a9dcd010964..0000000000000 --- a/test/lib/sun/hotspot/code/Compiler.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2018, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.code; - -import java.lang.reflect.Executable; -import jdk.test.whitebox.WhiteBox; - -/** - * API to obtain information about enabled JIT compilers - * retrieved from the VM with the WhiteBox API. - */ -public class Compiler { - - private static final WhiteBox WB = WhiteBox.getWhiteBox(); - - /** - * Check if C2 or JVMCI were included in the VM build - * - * @return true if either C2 or JVMCI were included in the VM build. - */ - public static boolean isC2OrJVMCIIncluded() { - return WB.isC2OrJVMCIIncluded(); - } - - /** - * Check if JVMCI is enabled. - * - * @return true if JVMCI is enabled - */ - public static boolean isJVMCIEnabled() { - Boolean enableJvmci = WB.getBooleanVMFlag("EnableJVMCI"); - if (enableJvmci == null || !enableJvmci) { - return false; - } - - return true; - } - - /** - * Check if Graal is used as JIT compiler. - * - * Graal is enabled if following conditions are true: - * - we are not in Interpreter mode - * - UseJVMCICompiler flag is true - * - jvmci.Compiler variable is equal to 'graal' - * - TieredCompilation is not used or TieredStopAtLevel is greater than 3 - * No need to check client mode because it set UseJVMCICompiler to false. - * - * @return true if Graal is used as JIT compiler. - */ - public static boolean isGraalEnabled() { - Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler"); - if (useCompiler == null || !useCompiler) { - return false; - } - Boolean useJvmciComp = WB.getBooleanVMFlag("UseJVMCICompiler"); - if (useJvmciComp == null || !useJvmciComp) { - return false; - } - - Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); - Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel"); - // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used - if (tieredCompilation != null && tieredCompilation && - compLevel != null && compLevel <= 3) { - return false; - } - return true; - } - - /** - * Check if C2 is used as JIT compiler. - * - * C2 is enabled if following conditions are true: - * - we are not in Interpreter mode - * - we are in Server compilation mode - * - TieredCompilation is not used or TieredStopAtLevel is greater than 3 - * - Graal is not used - * - * @return true if C2 is used as JIT compiler. - */ - public static boolean isC2Enabled() { - Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler"); - if (useCompiler == null || !useCompiler) { - return false; - } - Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter"); - if (serverMode == null || !serverMode) { - return false; - } - - Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); - Long compLevel = WB.getIntxVMFlag("TieredStopAtLevel"); - // if TieredCompilation is enabled and compilation level is <= 3 then no Graal is used - if (tieredCompilation != null && tieredCompilation && - compLevel != null && compLevel <= 3) { - return false; - } - - if (isGraalEnabled()) { - return false; - } - - return true; - } - - /* - * Check if C1 is used as JIT compiler. - * - * C1 is enabled if following conditions are true: - * - we are not in Interpreter mode - * - we are not in Server compilation mode - * - TieredCompilation is used in Server mode - * - * @return true if C1 is used as JIT compiler. - */ - public static boolean isC1Enabled() { - Boolean useCompiler = WB.getBooleanVMFlag("UseCompiler"); - if (useCompiler == null || !useCompiler) { - return false; - } - Boolean serverMode = WB.getBooleanVMFlag("ProfileInterpreter"); - if (serverMode == null || !serverMode) { - return true; // Client mode - } - - Boolean tieredCompilation = WB.getBooleanVMFlag("TieredCompilation"); - // C1 is not used in server mode if TieredCompilation is off. - if (tieredCompilation != null && !tieredCompilation) { - return false; - } - return true; - } - - /* - * Determine if the compiler corresponding to the compilation level 'compLevel' - * provides an intrinsic for 'class'.'method'. - */ - public static boolean isIntrinsicAvailable(int compLevel, String klass, String method, Class... parameterTypes) { - Executable intrinsicMethod; - try { - intrinsicMethod = Class.forName(klass).getDeclaredMethod(method, parameterTypes); - } catch (NoSuchMethodException e) { - throw new RuntimeException("Test bug, '" + method + "' method unavailable. " + e); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Test bug, '" + klass + "' class unavailable. " + e); - } - return WB.isIntrinsicAvailable(intrinsicMethod, compLevel); - } -} diff --git a/test/lib/sun/hotspot/code/NMethod.java b/test/lib/sun/hotspot/code/NMethod.java deleted file mode 100644 index 0fad7075a0c1c..0000000000000 --- a/test/lib/sun/hotspot/code/NMethod.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.code; - -import java.lang.reflect.Executable; -import jdk.test.whitebox.WhiteBox; - -@Deprecated -public class NMethod extends CodeBlob { - private static final WhiteBox wb = WhiteBox.getWhiteBox(); - public static NMethod get(Executable method, boolean isOsr) { - Object[] obj = wb.getNMethod(method, isOsr); - return obj == null ? null : new NMethod(obj); - } - private NMethod(Object[] obj) { - super((Object[])obj[0]); - assert obj.length == 5; - comp_level = (Integer) obj[1]; - insts = (byte[]) obj[2]; - compile_id = (Integer) obj[3]; - entry_point = (Long) obj[4]; - } - public final byte[] insts; - public final int comp_level; - public final int compile_id; - public final long entry_point; - - @Override - public String toString() { - return "NMethod{" - + super.toString() - + ", insts=" + insts - + ", comp_level=" + comp_level - + ", compile_id=" + compile_id - + ", entry_point=" + entry_point - + '}'; - } -} diff --git a/test/lib/sun/hotspot/cpuinfo/CPUInfo.java b/test/lib/sun/hotspot/cpuinfo/CPUInfo.java deleted file mode 100644 index 4ba87d5bde8a9..0000000000000 --- a/test/lib/sun/hotspot/cpuinfo/CPUInfo.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2014, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.cpuinfo; - -import java.util.List; -import java.util.Arrays; -import java.util.Collections; -import java.util.regex.Pattern; -import java.util.regex.Matcher; - -import jdk.test.whitebox.WhiteBox; - -/** - * Information about CPU on test box. - * - * CPUInfo uses WhiteBox to gather information, - * so WhiteBox class should be added to bootclasspath - * and option -XX:+WhiteBoxAPI should be explicitly - * specified on command line. - */ -@Deprecated -public class CPUInfo { - - private static final List features; - private static final String additionalCPUInfo; - - static { - WhiteBox wb = WhiteBox.getWhiteBox(); - - Pattern additionalCPUInfoRE = - Pattern.compile("([^(]*\\([^)]*\\)[^,]*),\\s*"); - - String cpuFeaturesString = wb.getCPUFeatures(); - Matcher matcher = additionalCPUInfoRE.matcher(cpuFeaturesString); - if (matcher.find()) { - additionalCPUInfo = matcher.group(1); - } else { - additionalCPUInfo = ""; - } - String splittedFeatures[] = matcher.replaceAll("").split("(, )| "); - - features = Collections.unmodifiableList(Arrays. - asList(splittedFeatures)); - } - - /** - * Get additional information about CPU. - * For example, on X86 in will be family/model/stepping - * and number of cores. - * - * @return additional CPU info - */ - public static String getAdditionalCPUInfo() { - return additionalCPUInfo; - } - - /** - * Get all known features supported by CPU. - * - * @return unmodifiable list with names of all known features - * supported by CPU. - */ - public static List getFeatures() { - return features; - } - - /** - * Check if some feature is supported by CPU. - * - * @param feature Name of feature to be tested. - * @return true if tested feature is supported by CPU. - */ - public static boolean hasFeature(String feature) { - return features.contains(feature.toLowerCase()); - } -} diff --git a/test/lib/sun/hotspot/gc/GC.java b/test/lib/sun/hotspot/gc/GC.java deleted file mode 100644 index 20a36c3252928..0000000000000 --- a/test/lib/sun/hotspot/gc/GC.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2016, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.hotspot.gc; - -import jdk.test.whitebox.WhiteBox; - -/** - * API to obtain information about selected and supported Garbage Collectors - * retrieved from the VM with the WhiteBox API. - */ -public enum GC { - /* - * Enum values must match CollectedHeap::Name - */ - Serial(1), - Parallel(2), - G1(3), - Epsilon(4), - Z(5), - Shenandoah(6); - - private static final WhiteBox WB = WhiteBox.getWhiteBox(); - - private final int name; - - private GC(int name) { - this.name = name; - } - - /** - * @return true if this GC is supported by the VM, i.e., it is built into the VM. - */ - public boolean isSupported() { - return WB.isGCSupported(name); - } - - /** - * @return true if this GC is supported by the JVMCI compiler - */ - public boolean isSupportedByJVMCICompiler() { - return WB.isGCSupportedByJVMCICompiler(name); - } - - /** - * @return true if this GC is currently selected/used - */ - public boolean isSelected() { - return WB.isGCSelected(name); - } - - /** - * @return true if GC was selected ergonomically, as opposed - * to being explicitly specified on the command line - */ - public static boolean isSelectedErgonomically() { - return WB.isGCSelectedErgonomically(); - } - - /** - * @return the selected GC. - */ - public static GC selected() { - for (GC gc : values()) { - if (gc.isSelected()) { - return gc; - } - } - throw new IllegalStateException("No selected GC found"); - } -}