Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8269792: [lworld] Duplicate/redundant CONSTANT_Class_info entry in constant pool #471

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -116,6 +116,12 @@ int putClass(ClassSymbol csym) {
* or an array type.
*/
int putClass(Type t) {
/* Their is nothing to be gained by having the pair of class types Foo.ref and Foo.val
result in two different CONSTANT_Class_info strucures in the pool. These are
indistinguishable at the class file level. Hence we coalesce them here.
*/
if (t.isReferenceProjection())
t = t.valueProjection();
return pool.writeIfNeeded(types.erasure(t));
}

@@ -53,10 +53,10 @@ void run() {
Paths.get(System.getProperty("test.classes"),
"ArrayCreationWithQuestion$VT.class").toString() };
runCheck(params, new String [] {
" 6: anewarray #3 // class ArrayCreationWithQuestion$VT",
" 17: anewarray #3 // class ArrayCreationWithQuestion$VT",
" 28: anewarray #11 // class \"QArrayCreationWithQuestion$VT;\"",
" 39: anewarray #11 // class \"QArrayCreationWithQuestion$VT;\"",
" 6: anewarray #1 // class ArrayCreationWithQuestion$VT",
" 17: anewarray #1 // class ArrayCreationWithQuestion$VT",
" 28: anewarray #10 // class \"QArrayCreationWithQuestion$VT;\"",
" 39: anewarray #10 // class \"QArrayCreationWithQuestion$VT;\"",
});

}
@@ -1,3 +1,4 @@

/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -72,14 +73,14 @@ void run() {
" 2: anewarray #11 // class \"QUnifiedPrimitiveClassBytecodeTest$X;\"",
" 5: astore_2",
" 6: bipush 10",
" 8: anewarray #13 // class UnifiedPrimitiveClassBytecodeTest$X",
" 8: anewarray #1 // class UnifiedPrimitiveClassBytecodeTest$X",
"11: astore_1",
"12: aload_1",
"13: iconst_0",
"14: aload_2",
"15: iconst_0",
"16: aaload",
"17: checkcast #13 // class UnifiedPrimitiveClassBytecodeTest$X",
"17: checkcast #1 // class UnifiedPrimitiveClassBytecodeTest$X",
"20: aastore",
"21: aload_2",
"22: iconst_1",
@@ -90,7 +91,7 @@ void run() {
"29: aastore",
"30: ldc #11 // class \"QUnifiedPrimitiveClassBytecodeTest$X;\"",
"32: astore_3",
"33: ldc #13 // class UnifiedPrimitiveClassBytecodeTest$X",
"33: ldc #1 // class UnifiedPrimitiveClassBytecodeTest$X",
"35: astore_3",
"36: return",
});