8195731: [Graal] runtime/SharedArchiveFile/serviceability/transformRelatedClasses/TransformSuperSubTwoPckgs.java intermittently fails with Graal JIT

Print detailed error if class transformation fails. Exclude tests from Graal testing.

Reviewed-by: kvn, dholmes, sspitsyn
This commit is contained in:
Tobias Hartmann 2018-02-05 08:08:01 +01:00
parent e5131d5ceb
commit 9eb320a418
7 changed files with 24 additions and 10 deletions

View File

@ -29,6 +29,7 @@
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* java.management

View File

@ -30,6 +30,7 @@
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* java.management

View File

@ -30,6 +30,7 @@
* @library /test/lib /runtime/SharedArchiveFile /testlibrary/jvmti
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* java.management

View File

@ -30,6 +30,7 @@
* /test/hotspot/jtreg/runtime/appcds/test-classes /test/hotspot/jtreg/runtime/appcds/jvmti
* /test/hotspot/jtreg/testlibrary/jvmti
* @requires vm.cds
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* java.management
* jdk.jartool/sun.tools.jar

View File

@ -34,6 +34,7 @@
* /test/hotspot/jtreg/runtime/appcds/customLoader/test-classes
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* java.management

View File

@ -34,6 +34,7 @@
* /test/hotspot/jtreg/runtime/appcds/customLoader/test-classes
* @requires vm.cds
* @requires vm.flavor != "minimal"
* @requires !vm.graal.enabled
* @modules java.base/jdk.internal.misc
* jdk.jartool/sun.tools.jar
* java.management

View File

@ -57,17 +57,25 @@ public class TransformerAgent {
static class SimpleTransformer implements ClassFileTransformer {
public byte[] transform(ClassLoader loader, String name, Class<?> classBeingRedefined,
ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException {
public byte[] transform(ClassLoader loader, String name, Class<?> classBeingRedefined,
ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException {
try {
log("SimpleTransformer called for: " + name + "@" + incrCounter(name));
if (!shouldTransform(name))
return null;
log("SimpleTransformer called for: " + name + "@" + incrCounter(name));
if (!shouldTransform(name))
return null;
log("transforming: class name = " + name);
int nrOfReplacements = TransformUtil.replace(buffer, TransformUtil.BeforePattern,
TransformUtil.AfterPattern);
log("replaced the string, nrOfReplacements = " + nrOfReplacements);
log("transforming: class name = " + name);
int nrOfReplacements = TransformUtil.replace(buffer, TransformUtil.BeforePattern,
TransformUtil.AfterPattern);
log("replaced the string, nrOfReplacements = " + nrOfReplacements);
} catch (Throwable t) {
// The retransform native code that called this method does not propagate
// exceptions. Instead of getting an uninformative generic error, catch
// problems here and print it, then exit.
log("Transformation failed!");
t.printStackTrace();
System.exit(1);
}
return buffer;
}