Skip to content
Permalink
Browse files
8269792: [lworld] Duplicate/redundant CONSTANT_Class_info entry in co…
…nstant pool
  • Loading branch information
Srikanth Adayapalam committed Jul 2, 2021
1 parent b62a66e commit b3b7fb2bf96b40fd4636a699e150b8ab5c2d8610
@@ -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",
});

0 comments on commit b3b7fb2

Please sign in to comment.