--- old/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java 2020-08-31 08:10:40.186660693 -0700 +++ new/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClasses.java 2020-08-31 08:10:39.958652110 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2020, 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 @@ -53,7 +53,8 @@ .setXShareMode("dump") .setArchiveName(ReplaceCriticalClasses.class.getName() + ".jsa") .setUseVersion(false) - .addSuffix("-showversion"); + .addSuffix("-showversion") + .addSuffix("-Xlog:cds"); CDSTestUtils.run(opts).assertNormalExit(""); launchChildProcesses(getTests()); @@ -80,6 +81,8 @@ "-early -notshared java/lang/String", "-early -notshared java/lang/Cloneable", "-early -notshared java/io/Serializable", + "-early -notshared java/lang/Module", + "-early -notshared java/lang/ModuleLayer", // CDS should not be disabled -- these critical classes cannot be replaced because // JvmtiExport::early_class_hook_env() is false. @@ -87,13 +90,8 @@ "java/lang/String", "java/lang/Cloneable", "java/io/Serializable", - - /* Try to replace classes that are used by the archived subgraph graphs. - The following test cases are in ReplaceCriticalClassesForSubgraphs.java. - "-early -notshared -subgraph java/lang/module/ResolvedModule jdk.internal.module.ArchivedModuleGraph", - "-early -notshared -subgraph java/lang/Long java.lang.Long$LongCache", - "-subgraph java/lang/Long java.lang.Long$LongCache", - */ + "java/lang/Module", + "java/lang/ModuleLayer", // Replace classes that are loaded after JVMTI_PHASE_PRIMORDIAL. It's OK to replace // such @@ -116,12 +114,13 @@ static void launchChild(String args[]) throws Throwable { if (args.length < 1) { - throw new RuntimeException("Invalid test case. Should be <-early> <-subgraph> <-notshared> klassName subgraphKlass"); + throw new RuntimeException("Invalid test case. Should be <-early> <-subgraph> <-notshared> <-nowhitebox> klassName subgraphKlass"); } String klassName = null; String subgraphKlass = null; String early = ""; boolean subgraph = false; + boolean whitebox = true; String shared = "-shared"; for (int i=0; i