8214809: CDS storage improvements

Reviewed-by: acorn, iklam, ahgross, rhalade
This commit is contained in:
Calvin Cheung 2018-12-12 11:57:22 -08:00
parent def1ac3acc
commit b999cc8f33
2 changed files with 7 additions and 8 deletions

View File

@ -6016,9 +6016,9 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
_minor_version = stream->get_u2_fast();
_major_version = stream->get_u2_fast();
if (DumpSharedSpaces && _major_version < JAVA_1_5_VERSION) {
if (DumpSharedSpaces && _major_version < JAVA_6_VERSION) {
ResourceMark rm;
warning("Pre JDK 1.5 class not supported by CDS: %u.%u %s",
warning("Pre JDK 6 class not supported by CDS: %u.%u %s",
_major_version, _minor_version, _class_name->as_C_string());
Exceptions::fthrow(
THREAD_AND_LOCATION,

View File

@ -24,7 +24,7 @@
/*
* @test
* @summary classes with major version < JDK_1.5 (48) should not be included in CDS
* @summary classes with major version < JDK_6 (50) should not be included in CDS
* @requires vm.cds
* @library /test/lib
* @modules java.base/jdk.internal.org.objectweb.asm
@ -61,9 +61,9 @@ public class OldClassTest implements Opcodes {
String appClasses[] = TestCommon.list("Hello");
// CASE 1: pre-JDK 1.5 compiled classes should be excluded from the dump
// CASE 1: pre-JDK 6 compiled classes should be excluded from the dump
OutputAnalyzer output = TestCommon.dump(jar, appClasses);
TestCommon.checkExecReturn(output, 0, true, "Pre JDK 1.5 class not supported by CDS");
TestCommon.checkExecReturn(output, 0, true, "Pre JDK 6 class not supported by CDS");
TestCommon.run(
"-cp", jar,
@ -74,7 +74,7 @@ public class OldClassTest implements Opcodes {
// the newer version of this class in a subsequent classpath element.
String classpath = jar + File.pathSeparator + jarSrcFile.getPath();
output = TestCommon.dump(classpath, appClasses);
TestCommon.checkExecReturn(output, 0, true, "Pre JDK 1.5 class not supported by CDS");
TestCommon.checkExecReturn(output, 0, true, "Pre JDK 6 class not supported by CDS");
TestCommon.run(
"-cp", classpath,
@ -127,8 +127,7 @@ java jdk.internal.org.objectweb.asm.util.ASMifier Hello.class
MethodVisitor mv;
AnnotationVisitor av0;
//WAS cw.visit(V1_6, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null);
cw.visit(V1_4, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null);
cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, "Hello", null, "java/lang/Object", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);