8285633: Take better advantage of generic MethodType cache

Reviewed-by: jvernee
This commit is contained in:
Claes Redestad 2022-04-27 17:54:21 +00:00
parent 5b42747ba1
commit 6c79671e50
8 changed files with 118 additions and 23 deletions

View file

@ -5601,7 +5601,7 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
for (int pos : positions) {
ptypes[pos - 1] = newParamType;
}
MethodType newType = MethodType.makeImpl(targetType.rtype(), ptypes, true);
MethodType newType = MethodType.methodType(targetType.rtype(), ptypes, true);
LambdaForm lform = result.editor().filterRepeatedArgumentForm(BasicType.basicType(newParamType), positions);
return result.copyWithExtendL(newType, lform, filter);