8292914: Lambda proxies have unstable names
Change the name of generated lambda proxy classes so that they no longer have a numerical suffix. Reviewed-by: mchung
This commit is contained in:
parent
42330d28da
commit
b527edd338
src
java.base/share/classes/java/lang/invoke
jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta
test
hotspot/jtreg
runtime/cds/appcds
LambdaContainsOldInf.javaLambdaEagerInit.javaLambdaWithOldClass.javaSignedJar.javaStaticArchiveWithLambda.java
dynamicArchive
BasicLambdaTest.javaLambdaContainsOldInf.javaLambdaCustomLoader.javaLambdaForClassInBaseArchive.javaLambdaForOldInfInBaseArchive.javaLambdaInBaseArchive.javaLambdaProxyCallerIsHidden.javaLambdaProxyDuringShutdown.javaNestHostOldInf.javaNestTest.javaNoClassToArchive.javaParallelLambdaLoadTest.javaPredicateTest.javaRedefineCallerClassTest.javaStaticInnerTest.javaUsedAllArchivedLambdas.java
methodHandles
javaldr
methodHandles
CDSMHTest_generate.shMethodHandlesAsCollectorTest.javaMethodHandlesCastFailureTest.javaMethodHandlesGeneralTest.javaMethodHandlesInvokersTest.javaMethodHandlesPermuteArgumentsTest.javaMethodHandlesSpreadArgumentsTest.java
test-classes/pkg2
serviceability
dcmd/vm
jvmti
RedefineClasses
thread/GetStackTrace
jdk/java
io/Serializable/serialFilter
lang
StackWalker
invoke
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023, 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
|
||||
@ -85,7 +85,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
|
||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
|
||||
// Used to ensure that each spun class name is unique
|
||||
// Used to ensure that dumped class files for failed definitions have a unique class name
|
||||
private static final AtomicInteger counter = new AtomicInteger();
|
||||
|
||||
// For dumping generated classes to disk, for debugging purposes
|
||||
@ -119,7 +119,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
private final ClassWriter cw; // ASM class writer
|
||||
private final String[] argNames; // Generated names for the constructor arguments
|
||||
private final String[] argDescs; // Type descriptors for the constructor arguments
|
||||
private final String lambdaClassName; // Generated name for the generated class "X$$Lambda$1"
|
||||
private final String lambdaClassName; // Generated name for the generated class "X$$Lambda"
|
||||
private final boolean useImplMethodHandle; // use MethodHandle invocation instead of symbolic bytecode invocation
|
||||
|
||||
/**
|
||||
@ -209,7 +209,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
// use the original class name
|
||||
name = name.replace('/', '_');
|
||||
}
|
||||
return name.replace('.', '/') + "$$Lambda$" + counter.incrementAndGet();
|
||||
return name.replace('.', '/') + "$$Lambda";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -301,7 +301,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
* @throws LambdaConversionException If properly formed functional interface
|
||||
* is not found
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
private Class<?> generateInnerClass() throws LambdaConversionException {
|
||||
String[] interfaceNames;
|
||||
String interfaceName = interfaceClass.getName().replace('.', '/');
|
||||
@ -362,29 +361,32 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
// Define the generated class in this VM.
|
||||
|
||||
final byte[] classBytes = cw.toByteArray();
|
||||
// If requested, dump out to a file for debugging purposes
|
||||
if (dumper != null) {
|
||||
AccessController.doPrivileged(new PrivilegedAction<>() {
|
||||
@Override
|
||||
public Void run() {
|
||||
dumper.dumpClass(lambdaClassName, classBytes);
|
||||
return null;
|
||||
}
|
||||
}, null,
|
||||
new FilePermission("<<ALL FILES>>", "read, write"),
|
||||
// createDirectories may need it
|
||||
new PropertyPermission("user.dir", "read"));
|
||||
}
|
||||
try {
|
||||
// this class is linked at the indy callsite; so define a hidden nestmate
|
||||
Lookup lookup;
|
||||
if (useImplMethodHandle) {
|
||||
lookup = caller.defineHiddenClassWithClassData(classBytes, implementation, !disableEagerInitialization,
|
||||
NESTMATE, STRONG);
|
||||
} else {
|
||||
lookup = caller.defineHiddenClass(classBytes, !disableEagerInitialization, NESTMATE, STRONG);
|
||||
Lookup lookup = null;
|
||||
try {
|
||||
if (useImplMethodHandle) {
|
||||
lookup = caller.defineHiddenClassWithClassData(classBytes, implementation, !disableEagerInitialization,
|
||||
NESTMATE, STRONG);
|
||||
} else {
|
||||
lookup = caller.defineHiddenClass(classBytes, !disableEagerInitialization, NESTMATE, STRONG);
|
||||
}
|
||||
return lookup.lookupClass();
|
||||
} finally {
|
||||
// If requested, dump out to a file for debugging purposes
|
||||
if (dumper != null) {
|
||||
String name;
|
||||
if (lookup != null) {
|
||||
String definedName = lookup.lookupClass().getName();
|
||||
int suffixIdx = definedName.lastIndexOf('/');
|
||||
assert suffixIdx != -1;
|
||||
name = lambdaClassName + '.' + definedName.substring(suffixIdx + 1);
|
||||
} else {
|
||||
name = lambdaClassName + ".failed-" + counter.incrementAndGet();
|
||||
}
|
||||
doDump(name, classBytes);
|
||||
}
|
||||
}
|
||||
return lookup.lookupClass();
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new LambdaConversionException("Exception defining lambda proxy class", e);
|
||||
} catch (Throwable t) {
|
||||
@ -392,6 +394,20 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private void doDump(final String className, final byte[] classBytes) {
|
||||
AccessController.doPrivileged(new PrivilegedAction<>() {
|
||||
@Override
|
||||
public Void run() {
|
||||
dumper.dumpClass(className, classBytes);
|
||||
return null;
|
||||
}
|
||||
}, null,
|
||||
new FilePermission("<<ALL FILES>>", "read, write"),
|
||||
// createDirectories may need it
|
||||
new PropertyPermission("user.dir", "read"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a static field and a static initializer that sets this field to an instance of the lambda
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2023, 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
|
||||
@ -96,7 +96,7 @@ public class MetaUtil {
|
||||
* by {@link Class#getName()} that are not package separators.
|
||||
* These are distinguished by being followed by a character that is not a
|
||||
* {@link Character#isJavaIdentifierStart(char)} (e.g.,
|
||||
* "jdk.vm.ci.runtime.test.TypeUniverse$$Lambda$1/869601985").
|
||||
* "jdk.vm.ci.runtime.test.TypeUniverse$$Lambda/869601985").
|
||||
*
|
||||
* @param name the name to perform the replacements on
|
||||
* @param packageSeparator the {@link Character} used as the package separator, e.g. {@code /} in internal form
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -64,7 +64,7 @@ public class LambdaContainsOldInf {
|
||||
OutputAnalyzer output = CDSTestUtils.createArchiveAndCheck(opts);
|
||||
TestCommon.checkExecReturn(output, 0, true,
|
||||
"Skipping OldProvider: Old class has been linked");
|
||||
output.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked");
|
||||
output.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda.*0x.*:.*Old.class.has.been.linked");
|
||||
|
||||
// run with archive
|
||||
CDSOptions runOpts = (new CDSOptions())
|
||||
@ -77,7 +77,7 @@ public class LambdaContainsOldInf {
|
||||
TestCommon.checkExecReturn(output, 0, true,
|
||||
"[class,load] LambdaContainsOldInfApp source: shared objects file");
|
||||
output.shouldMatch(".class.load. OldProvider.source:.*lambdacontainsoldinf.jar")
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf");
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda.*/0x.*source:.*LambdaContainsOldInf");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -62,9 +62,9 @@ public class LambdaEagerInit {
|
||||
private static final String mainClass = LambdaEagerInitTest.class.getName();
|
||||
private static final String testProperty = "-Djdk.internal.lambda.disableEagerInitialization=true";
|
||||
private static final String lambdaNotLoadedFromArchive =
|
||||
".class.load. java.util.stream.Collectors[$][$]Lambda[$].*/0x.*source:.*java.*util.*stream.*Collectors";
|
||||
".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*java.*util.*stream.*Collectors";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. java.util.stream.Collectors[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file";
|
||||
".class.load. java.util.stream.Collectors[$][$]Lambda.*/0x.*source:.*shared.*objects.*file";
|
||||
private static final String cdsLoadedLambdaProxy = ".cds.*Loaded.*lambda.*proxy";
|
||||
private static final String archiveName = mainClass + ".jsa";
|
||||
private static String appJar;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -68,7 +68,7 @@ public class LambdaWithOldClass {
|
||||
.addSuffix(mainClass);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldContain("[class,load] LambdaWithOldClassApp source: shared objects file")
|
||||
.shouldMatch(".class.load. LambdaWithOldClassApp[$][$]Lambda[$].*/0x.*source:.*shared objects file")
|
||||
.shouldMatch(".class.load. LambdaWithOldClassApp[$][$]Lambda.*/0x.*source:.*shared objects file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -49,9 +49,9 @@ public class SignedJar {
|
||||
String mainClass = "Hello";
|
||||
|
||||
String skipMsg = "Skipping Hello: Signed JAR";
|
||||
String lambdaInArchive = "klasses.*=.*app.*Hello[$][$]Lambda[$].*hidden";
|
||||
String lambdaInArchive = "klasses.*=.*app.*Hello[$][$]Lambda.*hidden";
|
||||
String loadFromJar = ".class,load. Hello source: file:.*signed_hello.jar";
|
||||
String lambdaLoadFromHello = ".class.load. Hello[$][$]Lambda[$].*/0x.*source.*Hello";
|
||||
String lambdaLoadFromHello = ".class.load. Hello[$][$]Lambda.*/0x.*source.*Hello";
|
||||
|
||||
for (String mainArg : mainArgs) {
|
||||
output = TestCommon.dump(signedJar, TestCommon.list(mainClass),
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -62,7 +62,7 @@ public class StaticArchiveWithLambda {
|
||||
.addSuffix(appClass);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldContain("LambHello source: shared objects file")
|
||||
.shouldMatch("class.load.*LambHello[$][$]Lambda[$].*0x.*source:.shared.objects.file")
|
||||
.shouldMatch("class.load.*LambHello[$][$]Lambda.*0x.*source:.shared.objects.file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -56,7 +56,7 @@ public class BasicLambdaTest extends DynamicArchiveTestBase {
|
||||
use_whitebox_jar,
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden BasicLambdaApp$$Lambda$")
|
||||
output.shouldContain("Archiving hidden BasicLambdaApp$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -65,7 +65,7 @@ public class LambdaContainsOldInf extends DynamicArchiveTestBase {
|
||||
"-cp", appJar, mainClass, mainArg)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Skipping OldProvider: Old class has been linked")
|
||||
.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked")
|
||||
.shouldMatch("Skipping.LambdaContainsOldInfApp[$][$]Lambda.*0x.*:.*Old.class.has.been.linked")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
@ -78,7 +78,7 @@ public class LambdaContainsOldInf extends DynamicArchiveTestBase {
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("[class,load] LambdaContainsOldInfApp source: shared objects file (top)")
|
||||
.shouldMatch(".class.load. OldProvider.source:.*lambda_contains_old_inf.jar")
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*LambdaContainsOldInf")
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda.*/0x.*source:.*LambdaContainsOldInf")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -51,7 +51,7 @@ public class LambdaCustomLoader extends DynamicArchiveTestBase {
|
||||
"-Xlog:class+load,cds=debug,cds+dynamic",
|
||||
"-cp", appJar, mainClass, appJar, "init", "keep-alive")
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldMatch("Skipping.LambHello[$][$]Lambda[$].*0x.*:.Hidden.class")
|
||||
output.shouldMatch("Skipping.LambHello[$][$]Lambda.*0x.*:.Hidden.class")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
@ -59,7 +59,7 @@ public class LambdaCustomLoader extends DynamicArchiveTestBase {
|
||||
"-Xlog:class+load,class+unload",
|
||||
"-cp", appJar, mainClass, appJar, "init")
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldMatch("class.load.*LambHello[$][$]Lambda[$].*0x.*source:.LambHello")
|
||||
output.shouldMatch("class.load.*LambHello[$][$]Lambda.*0x.*source:.LambHello")
|
||||
.shouldContain("LambHello source: shared objects file (top)")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -76,7 +76,7 @@ public class LambdaForClassInBaseArchive extends DynamicArchiveTestBase {
|
||||
appClass, "lambda")
|
||||
.assertNormalExit(out -> {
|
||||
out.shouldHaveExitValue(0)
|
||||
.shouldMatch("Archiving hidden SimpleApp[$][$]Lambda[$][\\d+]*");
|
||||
.shouldMatch("Archiving hidden SimpleApp[$][$]Lambda");
|
||||
});
|
||||
|
||||
// Run with both base and dynamic archives. The SimpleApp class
|
||||
@ -90,7 +90,7 @@ public class LambdaForClassInBaseArchive extends DynamicArchiveTestBase {
|
||||
.assertNormalExit(out -> {
|
||||
out.shouldHaveExitValue(0)
|
||||
.shouldContain("SimpleApp source: shared objects file")
|
||||
.shouldMatch(".class.load. SimpleApp[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
.shouldMatch(".class.load. SimpleApp[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -78,7 +78,7 @@ public class LambdaForOldInfInBaseArchive extends DynamicArchiveTestBase {
|
||||
appClass)
|
||||
.assertNormalExit(out -> {
|
||||
out.shouldContain("OldProvider source: shared objects file")
|
||||
.shouldMatch("Archiving hidden LambdaContainsOldInfApp[$][$]Lambda[$][\\d+]*");
|
||||
.shouldMatch("Archiving hidden LambdaContainsOldInfApp[$][$]Lambda*");
|
||||
});
|
||||
|
||||
// Run with both base and dynamic archives. The OldProvider class
|
||||
@ -91,7 +91,7 @@ public class LambdaForOldInfInBaseArchive extends DynamicArchiveTestBase {
|
||||
.assertNormalExit(out -> {
|
||||
out.shouldContain("OldProvider source: shared objects file")
|
||||
.shouldContain("LambdaContainsOldInfApp source: shared objects file (top)")
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
.shouldMatch(".class.load. LambdaContainsOldInfApp[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -83,8 +83,8 @@ public class LambdaInBaseArchive extends DynamicArchiveTestBase {
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("LambHello source: shared objects file")
|
||||
.shouldMatch("class.load.*LambHello[$][$]Lambda[$].*0x.*source:.shared.objects.file")
|
||||
.shouldNotMatch("class.load.*LambHello[$][$]Lambda[$].*0x.*source:.shared.objects.file.*(top)");
|
||||
.shouldMatch("class.load.*LambHello[$][$]Lambda.*0x.*source:.shared.objects.file")
|
||||
.shouldNotMatch("class.load.*LambHello[$][$]Lambda.*0x.*source:.shared.objects.file.*(top)");
|
||||
});
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -58,7 +58,7 @@ public class LambdaProxyCallerIsHidden extends DynamicArchiveTestBase {
|
||||
"-Xlog:class+load,cds+dynamic,cds=debug",
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldMatch("Skipping.LambdaHello_0x.*[$][$]Lambda[$].*:.Hidden.class")
|
||||
output.shouldMatch("Skipping.LambdaHello_0x.*[$][$]Lambda.*:.Hidden.class")
|
||||
.shouldMatch("Skipping.LambdaHello.0x.*:.Hidden.class")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
@ -68,7 +68,7 @@ public class LambdaProxyCallerIsHidden extends DynamicArchiveTestBase {
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldMatch("class.load.*LambdaHello/0x.*source.*LambdaProxyCallerIsHiddenApp")
|
||||
.shouldMatch("class.load.*LambdaHello_0x.*[$][$]Lambda[$].*source.*LambdaProxyCallerIsHiddenApp")
|
||||
.shouldMatch("class.load.*LambdaHello_0x.*[$][$]Lambda.*source.*LambdaProxyCallerIsHiddenApp")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -63,7 +63,7 @@ public class LambdaProxyDuringShutdown extends DynamicArchiveTestBase {
|
||||
// Nest host should not be skipped although it is not in the linked state.
|
||||
output.shouldNotContain("Skipping Outer: Not linked")
|
||||
// Lambda proxy is loaded normally.
|
||||
.shouldMatch("class.load.*Outer[$]Inner[$][$]Lambda[$].*0x.*source:.Outer")
|
||||
.shouldMatch("class.load.*Outer[$]Inner[$][$]Lambda.*0x.*source:.Outer")
|
||||
.shouldContain(appOutput)
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
@ -79,7 +79,7 @@ public class LambdaProxyDuringShutdown extends DynamicArchiveTestBase {
|
||||
// from the dynamic archive.
|
||||
// The lambda proxy is not loaded from the dynamic archive.
|
||||
output.shouldMatch("class.load.*Outer.source:.*shared.*objects.*file.*(top)")
|
||||
.shouldMatch("class.load.*Outer[$]Inner[$][$]Lambda[$].*0x.*source:.Outer")
|
||||
.shouldMatch("class.load.*Outer[$]Inner[$][$]Lambda.*0x.*source:.Outer")
|
||||
.shouldMatch("class.load. Outer[$]Inner.source:.*shared.*objects.*file.*(top)")
|
||||
.shouldContain(appOutput)
|
||||
.shouldHaveExitValue(0);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -83,7 +83,7 @@ public class NestHostOldInf extends DynamicArchiveTestBase {
|
||||
.shouldMatch(".class.load. OldInf source:.*oldclassapp.jar")
|
||||
.shouldMatch(".class.load. ChildOldInf source:.*oldclassapp.jar")
|
||||
.shouldContain("ChildOldInf$InnerChild source: shared objects file (top)")
|
||||
.shouldMatch(".class.load. ChildOldInf[$]InnerChild[$][$]Lambda[$].*/0x.*source:.ChildOldInf");
|
||||
.shouldMatch(".class.load. ChildOldInf[$]InnerChild[$][$]Lambda.*/0x.*source:.ChildOldInf");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -58,7 +58,7 @@ public class NestTest extends DynamicArchiveTestBase {
|
||||
use_whitebox_jar,
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden NestApp$InnerA$InnerInnerA$$Lambda$")
|
||||
output.shouldContain("Archiving hidden NestApp$InnerA$InnerInnerA$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
@ -69,7 +69,7 @@ public class NestTest extends DynamicArchiveTestBase {
|
||||
"-Xlog:class+load=debug,class+resolve=debug,class+unload=info",
|
||||
"-cp", appJar, mainClass, "run")
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldMatch(".class.load.* NestApp[$]InnerA[$]InnerInnerA[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)")
|
||||
output.shouldMatch(".class.load.* NestApp[$]InnerA[$]InnerInnerA[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, 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
|
||||
@ -77,7 +77,7 @@ public class NoClassToArchive extends DynamicArchiveTestBase {
|
||||
private static void checkWarning(OutputAnalyzer output) throws Exception {
|
||||
if (output.firstMatch("bytes: [0-9]+ checksum: [0-9a-f]+") != null) {
|
||||
// Patterns like this indicate that a class was not loaded from CDS archive:
|
||||
// [info ][class,load] jdk.internal.module.DefaultRoots$$Lambda$1/0x00007f80c4512048 source: jdk.internal.module.DefaultRoots
|
||||
// [info ][class,load] jdk.internal.module.DefaultRoots$$Lambda/0x00007f80c4512048 source: jdk.internal.module.DefaultRoots
|
||||
// [debug][class,load] klass: 0x0000000800b77cf8 super: 0x0000000800007450 interfaces: 0x0000000800162538
|
||||
// loader: [loader data: 0x00007f80f416a5b0 of 'bootstrap'] bytes: 403 checksum: 753e58aa
|
||||
System.out.println("test skipped: this platform uses non-archived classes when running -version");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -55,7 +55,7 @@ public class ParallelLambdaLoadTest extends DynamicArchiveTestBase {
|
||||
use_whitebox_jar,
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden ParallelLambdaLoad$$Lambda$")
|
||||
output.shouldContain("Archiving hidden ParallelLambdaLoad$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -55,7 +55,7 @@ public class PredicateTest extends DynamicArchiveTestBase {
|
||||
use_whitebox_jar,
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden PredicateApp$$Lambda$")
|
||||
output.shouldContain("Archiving hidden PredicateApp$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -83,7 +83,7 @@ public class RedefineCallerClassTest extends DynamicArchiveTestBase {
|
||||
output.shouldHaveExitValue(0);
|
||||
if (mainArg.equals("both") || mainArg.equals("useOldInf")) {
|
||||
output.shouldContain("Skipping OldProvider: Old class has been linked")
|
||||
.shouldMatch("Skipping.SimpleLambda[$][$]Lambda[$].*0x.*:.*Old.class.has.been.linked");
|
||||
.shouldMatch("Skipping.SimpleLambda[$][$]Lambda.*0x.*:.*Old.class.has.been.linked");
|
||||
}
|
||||
if (mainArg.equals("both") || mainArg.equals("redefineCaller")) {
|
||||
output.shouldContain("Skipping SimpleLambda: Has been redefined");
|
||||
@ -94,7 +94,7 @@ public class RedefineCallerClassTest extends DynamicArchiveTestBase {
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldHaveExitValue(0)
|
||||
.shouldContain("RedefineCallerClass source: shared objects file (top)")
|
||||
.shouldMatch(".class.load. SimpleLambda[$][$]Lambda[$].*/0x.*source:.*SimpleLambda");
|
||||
.shouldMatch(".class.load. SimpleLambda[$][$]Lambda.*/0x.*source:.*SimpleLambda");
|
||||
if (mainArg.equals("both") || mainArg.equals("useOldInf")) {
|
||||
output.shouldMatch(".class.load. OldProvider.source:.*redefine_caller_class.jar");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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,7 @@ public class StaticInnerTest extends DynamicArchiveTestBase {
|
||||
"-Xlog:class+load=info,class+nestmates=trace,cds+dynamic=info",
|
||||
"-cp", appJar, mainClass, "dump")
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden HelloStaticInner$InnerHello$$Lambda$")
|
||||
output.shouldContain("Archiving hidden HelloStaticInner$InnerHello$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
@ -63,7 +63,7 @@ public class StaticInnerTest extends DynamicArchiveTestBase {
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldHaveExitValue(0)
|
||||
.shouldContain("HelloStaticInner source: shared objects file (top)")
|
||||
.shouldMatch(".class.load. HelloStaticInner[$]InnerHello[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
.shouldMatch(".class.load. HelloStaticInner[$]InnerHello[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -55,7 +55,7 @@ public class UsedAllArchivedLambdas extends DynamicArchiveTestBase {
|
||||
use_whitebox_jar,
|
||||
"-cp", appJar, mainClass)
|
||||
.assertNormalExit(output -> {
|
||||
output.shouldContain("Archiving hidden UsedAllArchivedLambdasApp$$Lambda$")
|
||||
output.shouldContain("Archiving hidden UsedAllArchivedLambdasApp$$Lambda")
|
||||
.shouldHaveExitValue(0);
|
||||
});
|
||||
|
||||
|
@ -96,7 +96,7 @@ public class $i extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "$i";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.$i[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.$i[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
2
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/methodHandles/MethodHandlesAsCollectorTest.java
2
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/methodHandles/MethodHandlesAsCollectorTest.java
@ -64,7 +64,7 @@ public class MethodHandlesAsCollectorTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesAsCollectorTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesAsCollectorTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesAsCollectorTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
2
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/methodHandles/MethodHandlesCastFailureTest.java
2
test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/methodHandles/MethodHandlesCastFailureTest.java
@ -64,7 +64,7 @@ public class MethodHandlesCastFailureTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesCastFailureTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesCastFailureTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesCastFailureTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
@ -64,7 +64,7 @@ public class MethodHandlesGeneralTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesGeneralTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesGeneralTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesGeneralTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
@ -64,7 +64,7 @@ public class MethodHandlesInvokersTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesInvokersTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesInvokersTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesInvokersTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
@ -64,7 +64,7 @@ public class MethodHandlesPermuteArgumentsTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesPermuteArgumentsTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesPermuteArgumentsTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesPermuteArgumentsTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
@ -64,7 +64,7 @@ public class MethodHandlesSpreadArgumentsTest extends DynamicArchiveTestBase {
|
||||
private static final String testClassName = "MethodHandlesSpreadArgumentsTest";
|
||||
private static final String loggingOpts = "-Xlog:cds,cds+dynamic=debug,class+load=trace";
|
||||
private static final String lambdaLoadedFromArchive =
|
||||
".class.load. test.java.lang.invoke.MethodHandlesSpreadArgumentsTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
".class.load. test.java.lang.invoke.MethodHandlesSpreadArgumentsTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file.*(top)";
|
||||
|
||||
static void testImpl() throws Exception {
|
||||
String topArchiveName = getNewArchiveName();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2023, 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
|
||||
@ -68,9 +68,9 @@ public class AnonVmClassesDuringDump {
|
||||
|
||||
String prefix = ".class.load. ";
|
||||
// class name pattern like the following:
|
||||
// jdk.internal.loader.BuiltinClassLoader$$Lambda$1/1816757085
|
||||
// jdk.internal.loader.BuiltinClassLoader$$Lambda/1816757085
|
||||
// java.lang.invoke.LambdaForm$MH/1585787493
|
||||
String class_pattern = ".*Lambda([a-z0-9$]+)/([0-9]+).*";
|
||||
String class_pattern = ".*Lambda/([0-9]+).*";
|
||||
String suffix = ".*source: shared objects file.*";
|
||||
String pattern = prefix + class_pattern + suffix;
|
||||
// during run time, anonymous classes shouldn't be loaded from the archive
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2023, 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
|
||||
@ -130,7 +130,7 @@ public class $i {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.$i[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.$i[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesAsCollectorTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesAsCollectorTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesAsCollectorTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesCastFailureTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesCastFailureTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesCastFailureTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesGeneralTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesGeneralTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesGeneralTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesInvokersTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesInvokersTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesInvokersTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesPermuteArgumentsTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesPermuteArgumentsTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesPermuteArgumentsTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class MethodHandlesSpreadArgumentsTest {
|
||||
.setUseVersion(false)
|
||||
.addSuffix(mainClass, testPackageName + "." + testClassName);
|
||||
OutputAnalyzer output = CDSTestUtils.runWithArchive(runOpts);
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesSpreadArgumentsTest[$][$]Lambda[$].*/0x.*source:.*shared.*objects.*file")
|
||||
output.shouldMatch(".class.load. test.java.lang.invoke.MethodHandlesSpreadArgumentsTest[$][$]Lambda.*/0x.*source:.*shared.*objects.*file")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -87,7 +87,7 @@ rm -f test-classes/pkg2/Child.java
|
||||
// at java.base/java.lang.Thread.dumpStack(Thread.java:1380)
|
||||
// at pkg1.BaseWithProtectedMethod.protectedMethod(BaseWithProtectedMethod.java:29)
|
||||
// at pkg2.Child.lambda$test$0(Child.java:8)
|
||||
// at pkg2.Child$$Lambda$1/0x0000000800c01000.accept(Unknown Source)
|
||||
// at pkg2.Child$$Lambda/0x0000000800c01000.accept(Unknown Source)
|
||||
// at java.base/java.util.Optional.ifPresent(Optional.java:178)
|
||||
// at pkg2.Child.test(Child.java:8)
|
||||
// at LambdaWithUseImplMethodHandleApp.main(LambdaWithUseImplMethodHandleApp.java:32)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -51,7 +51,7 @@ import java.util.regex.Pattern;
|
||||
public class ClassHierarchyTest {
|
||||
|
||||
// $> jcmd DcmdTestClass VM.class_hierarchy DcmdTestClass | grep DcmdTestClass\$\$Lambda
|
||||
// |--DcmdTestClass$$Lambda$1/4081552/0xa529fbb0
|
||||
// |--DcmdTestClass$$Lambda/4081552/0xa529fbb0
|
||||
|
||||
// > VM.class_hierarchy DcmdBaseClass
|
||||
// java.lang.Object/null
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -140,7 +140,7 @@ public class ModifyAnonymous {
|
||||
throw new RuntimeException("null class encountered");
|
||||
}
|
||||
final String name = clazz.getName();
|
||||
if (name.contains("$$Lambda$") && name.contains("App")) {
|
||||
if (name.contains("$$Lambda") && name.contains("App")) {
|
||||
if (inst.isModifiableClass(clazz)) {
|
||||
pw.flush();
|
||||
pw.close();
|
||||
@ -193,7 +193,7 @@ public class ModifyAnonymous {
|
||||
}.start();
|
||||
|
||||
// Test that NCDFE is not thrown for anonymous class:
|
||||
// ModifyAnonymous$InstanceMethodCallSiteApp$$Lambda$18
|
||||
// ModifyAnonymous$InstanceMethodCallSiteApp$$Lambda
|
||||
try {
|
||||
ModifyAnonymous test = new ModifyAnonymous();
|
||||
InstanceMethodCallSiteApp.test();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, 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
|
||||
@ -74,7 +74,7 @@ int compare_stack_trace(jvmtiEnv *jvmti, JNIEnv *jni, jthread thread,
|
||||
if (i < expected_frames_length) {
|
||||
|
||||
// for generated classes don't compare lambda indicies
|
||||
// Example: {"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda$31.0x0000000800098340;"
|
||||
// Example: {"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda.0x0000000800098340;"
|
||||
size_t lambda_idx = strlen(expected_frames[exp_idx].cls);
|
||||
const char *lambda = strstr(expected_frames[exp_idx].cls, "$$Lambda");
|
||||
if (lambda != nullptr) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2023, 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
|
||||
@ -47,7 +47,7 @@ static frame_info expected_virtual_frames[] = {
|
||||
{"Ljava/lang/VirtualThread;", "runWith", "(Ljava/lang/Object;Ljava/lang/Runnable;)V"},
|
||||
{"Ljava/lang/VirtualThread;", "run", "(Ljava/lang/Runnable;)V"},
|
||||
{"Ljava/lang/VirtualThread$VThreadContinuation;", "lambda$new$0", "(Ljava/lang/VirtualThread;Ljava/lang/Runnable;)V"},
|
||||
{"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda$31.0x0000000800098810;", "run", "()V"},
|
||||
{"Ljava/lang/VirtualThread$VThreadContinuation$$Lambda.0x0000000800098810;", "run", "()V"},
|
||||
{"Ljdk/internal/vm/Continuation;", "enter0", "()V"},
|
||||
{"Ljdk/internal/vm/Continuation;", "enter", "(Ljdk/internal/vm/Continuation;Z)V"}
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -519,7 +519,7 @@ public class SerialFilterTest implements Serializable {
|
||||
filter.depth(), filter.streamBytes());
|
||||
count++;
|
||||
if (serialClass != null) {
|
||||
if (serialClass.getName().contains("$$Lambda$")) {
|
||||
if (serialClass.getName().contains("$$Lambda")) {
|
||||
// TBD: proper identification of serialized Lambdas?
|
||||
// Fold the serialized Lambda into the SerializedLambda type
|
||||
classes.add(SerializedLambda.class);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -101,7 +101,7 @@ public class HiddenFrames {
|
||||
if (cn.startsWith("java.lang.reflect.") || cn.startsWith("jdk.internal.reflect.")) {
|
||||
reflects.add(frame);
|
||||
}
|
||||
if (cn.contains("$$Lambda$")) {
|
||||
if (cn.contains("$$Lambda")) {
|
||||
lambdas.add(frame);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -128,7 +128,7 @@ public class VerifyStackTrace {
|
||||
// test output in here (don't forget the final \n):
|
||||
private final String expected =
|
||||
"1: VerifyStackTrace.lambda$test$1(VerifyStackTrace.java:280)\n" +
|
||||
"2: VerifyStackTrace$$Lambda$1/0x0000000801001848.run(Unknown Source)\n" +
|
||||
"2: VerifyStackTrace$$Lambda/0x0000000801001848.run(Unknown Source)\n" +
|
||||
"3: VerifyStackTrace$Handle.execute(VerifyStackTrace.java:206)\n" +
|
||||
"4: java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)\n" +
|
||||
"5: java.base/java.lang.invoke.LambdaForm$MH/0x0000000801004800.invoke_MT(LambdaForm$MH)\n" +
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -162,7 +162,7 @@ public class MethodInvokeTest {
|
||||
|
||||
int index = caller.getName().indexOf('/');
|
||||
String cn = caller.getName().substring(0, index);
|
||||
assertTrue(cn.startsWith(LambdaTest.class.getName() + "$$Lambda$"), caller + " should be a lambda proxy class");
|
||||
assertTrue(cn.startsWith(LambdaTest.class.getName() + "$$Lambda"), caller + " should be a lambda proxy class");
|
||||
}
|
||||
}
|
||||
static void checkCaller(CSM csm, Class<?> expected, boolean adapter) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -136,7 +136,7 @@ public class LambdaAsm {
|
||||
int mcount = 0;
|
||||
try (DirectoryStream<Path> ds = newDirectoryStream(new File(".").toPath(),
|
||||
// filter in lambda proxy classes
|
||||
"A$I$$Lambda$*.class")) {
|
||||
"A$I$$Lambda.*.class")) {
|
||||
for (Path p : ds) {
|
||||
System.out.println(p.toFile());
|
||||
ClassFile cf = ClassFile.read(p.toFile());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -66,7 +66,7 @@ public class LambdaStackTrace {
|
||||
} catch (Exception ex) {
|
||||
// Before 8025636 the stacktrace would look like:
|
||||
// at LambdaStackTrace.lambda$main$0(LambdaStackTrace.java:37)
|
||||
// at LambdaStackTrace$$Lambda$1/1937396743.run(<Unknown>:1000000)
|
||||
// at LambdaStackTrace$$Lambda/1937396743.run(<Unknown>:1000000)
|
||||
// at LambdaStackTrace.testBasic(LambdaStackTrace.java:40)
|
||||
// at ...
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user