8162815: unnecessary object creation in reflection
authorredestad
Tue, 09 Aug 2016 09:42:01 +0200
changeset 40210 f13fa56f89ba
parent 40209 68e8944f4424
child 40211 8b78c9b31244
8162815: unnecessary object creation in reflection Reviewed-by: psandoz, shade Contributed-by: tomas.hurka@oracle.com
jdk/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java
--- 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