2017-11-27 20:21:34 -08:00
|
|
|
/*
|
8284161: Implementation of Virtual Threads (Preview)
Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
2022-05-07 08:06:16 +00:00
|
|
|
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
2017-11-27 20:21:34 -08:00
|
|
|
* 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
|
2019-03-19 14:22:47 -04:00
|
|
|
* @summary Run /serviceability/jvmti/RedefineClasses/RedefineRunningMethods in AppCDS mode to
|
2017-11-27 20:21:34 -08:00
|
|
|
* make sure class redefinition works with CDS.
|
2017-12-04 08:59:47 -08:00
|
|
|
* @requires vm.cds
|
2022-06-02 09:02:37 +00:00
|
|
|
* @requires vm.continuations
|
2020-09-23 21:11:31 +00:00
|
|
|
* @requires vm.jvmti
|
2019-07-29 10:34:20 -04:00
|
|
|
* @library /test/lib /test/hotspot/jtreg/serviceability/jvmti/RedefineClasses /test/hotspot/jtreg/runtime/cds/appcds
|
2018-10-02 14:32:33 -07:00
|
|
|
* @run driver RedefineClassHelper
|
2022-07-08 15:55:14 +00:00
|
|
|
* @build jdk.test.whitebox.WhiteBox
|
8284161: Implementation of Virtual Threads (Preview)
Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
2022-05-07 08:06:16 +00:00
|
|
|
* @compile --enable-preview -source ${jdk.version} RedefineRunningMethods_SharedHelper.java
|
2018-10-02 14:32:33 -07:00
|
|
|
* @run driver RedefineRunningMethods_Shared
|
2017-11-27 20:21:34 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
import jdk.test.lib.process.OutputAnalyzer;
|
2021-03-12 23:13:16 +00:00
|
|
|
import jdk.test.lib.helpers.ClassFileInstaller;
|
2017-11-27 20:21:34 -08:00
|
|
|
|
|
|
|
public class RedefineRunningMethods_Shared {
|
|
|
|
public static String shared_classes[] = {
|
|
|
|
"RedefineRunningMethods_Shared",
|
|
|
|
"RedefineRunningMethods_SharedHelper",
|
|
|
|
"RedefineRunningMethods",
|
2018-06-23 01:32:41 -04:00
|
|
|
"RedefineRunningMethods_B",
|
2017-11-27 20:21:34 -08:00
|
|
|
"RedefineClassHelper",
|
|
|
|
"jdk/test/lib/compiler/InMemoryJavaCompiler",
|
|
|
|
"jdk/test/lib/compiler/InMemoryJavaCompiler$FileManagerWrapper",
|
|
|
|
"jdk/test/lib/compiler/InMemoryJavaCompiler$FileManagerWrapper$1",
|
|
|
|
"jdk/test/lib/compiler/InMemoryJavaCompiler$MemoryJavaFileObject"
|
|
|
|
};
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
2022-07-08 15:55:14 +00:00
|
|
|
String wbJar = ClassFileInstaller.writeJar("WhiteBox.jar", "jdk.test.whitebox.WhiteBox");
|
2017-11-27 20:21:34 -08:00
|
|
|
String appJar = ClassFileInstaller.writeJar("RedefineRunningMethods_Shared.jar", shared_classes);
|
|
|
|
String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar;
|
|
|
|
|
|
|
|
OutputAnalyzer output;
|
|
|
|
TestCommon.testDump(appJar, shared_classes,
|
|
|
|
// command-line arguments ...
|
8284161: Implementation of Virtual Threads (Preview)
Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
2022-05-07 08:06:16 +00:00
|
|
|
use_whitebox_jar,
|
|
|
|
"--enable-preview");
|
2017-11-27 20:21:34 -08:00
|
|
|
|
|
|
|
// RedefineRunningMethods.java contained this:
|
|
|
|
// @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace RedefineRunningMethods
|
|
|
|
output = TestCommon.exec(appJar,
|
|
|
|
// command-line arguments ...
|
|
|
|
use_whitebox_jar,
|
|
|
|
"-XX:+UnlockDiagnosticVMOptions",
|
|
|
|
"-XX:+WhiteBoxAPI",
|
8284161: Implementation of Virtual Threads (Preview)
Co-authored-by: Ron Pressler <rpressler@openjdk.org>
Co-authored-by: Alan Bateman <alanb@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Co-authored-by: Andrew Haley <aph@openjdk.org>
Co-authored-by: Rickard Bäckman <rbackman@openjdk.org>
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org>
Co-authored-by: Leonid Mesnik <lmesnik@openjdk.org>
Co-authored-by: Serguei Spitsyn <sspitsyn@openjdk.org>
Co-authored-by: Chris Plummer <cjplummer@openjdk.org>
Co-authored-by: Coleen Phillimore <coleenp@openjdk.org>
Co-authored-by: Robbin Ehn <rehn@openjdk.org>
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Thomas Schatzl <tschatzl@openjdk.org>
Co-authored-by: Sergey Kuksenko <skuksenko@openjdk.org>
Reviewed-by: lancea, eosterlund, rehn, sspitsyn, stefank, tschatzl, dfuchs, lmesnik, dcubed, kevinw, amenkov, dlong, mchung, psandoz, bpb, coleenp, smarks, egahlin, mseledtsov, coffeys, darcy
2022-05-07 08:06:16 +00:00
|
|
|
"--enable-preview",
|
2017-11-27 20:21:34 -08:00
|
|
|
// These arguments are expected by RedefineRunningMethods
|
|
|
|
"-javaagent:redefineagent.jar",
|
|
|
|
"-Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace",
|
|
|
|
"RedefineRunningMethods_SharedHelper");
|
|
|
|
TestCommon.checkExec(output);
|
|
|
|
}
|
|
|
|
}
|