< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java

Print this page
rev 16336 : 8171373: Reduce copying during initialization of ModuleHashes
Reviewed-by: alanb, mchung, chegar

@@ -965,12 +965,13 @@
              */
             void newModuleHashesBuilder() {
                 hmv.visitTypeInsn(NEW, MODULE_HASHES_BUILDER);
                 hmv.visitInsn(DUP);
                 hmv.visitLdcInsn(recordedHashes.algorithm());
+                pushInt(hmv, ((4 * recordedHashes.names().size()) / 3) + 1);
                 hmv.visitMethodInsn(INVOKESPECIAL, MODULE_HASHES_BUILDER,
-                    "<init>", "(Ljava/lang/String;)V", false);
+                    "<init>", "(Ljava/lang/String;I)V", false);
                 hmv.visitVarInsn(ASTORE, BUILDER_VAR);
                 hmv.visitVarInsn(ALOAD, BUILDER_VAR);
             }
 
 
< prev index next >