8162815: unnecessary object creation in reflection
Reviewed-by: psandoz, shade
Contributed-by: tomas.hurka@oracle.com
--- a/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java Tue Aug 09 09:44:25 2016 +0530
+++ b/jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java Tue Aug 09 09:42:01 2016 +0200
@@ -437,17 +437,6 @@
cb.opc_new(targetClass);
cb.opc_dup();
} else {
- // Setup before iterating down argument list
- if (isPrimitive(returnType)) {
- // new <boxing type for primitive type>
- // dup
- // ... (see below:)
- // invokespecial <constructor for boxing type for primitive type>
- // areturn
- cb.opc_new(indexForPrimitiveType(returnType));
- cb.opc_dup();
- }
-
// Get target object on operand stack if necessary.
// We need to do an explicit null check here; we won't see