jdk/src/java.base/share/classes/java/lang/invoke/GenerateJLIClassesHelper.java
author redestad
Thu, 18 Aug 2016 19:00:39 +0200
changeset 40408 cf7e826d4d63
parent 40259 439673b634a9
child 40419 20e2e4b25a40
permissions -rw-r--r--
8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time Reviewed-by: vlivanov, mhaupt, shade
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     1
/*
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     4
 *
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    10
 *
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    15
 * accompanied this code).
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    16
 *
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    20
 *
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    23
 * questions.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    24
 */
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    25
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    26
package java.lang.invoke;
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    27
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    28
import java.util.Map;
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    29
import jdk.internal.org.objectweb.asm.ClassWriter;
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    30
import jdk.internal.org.objectweb.asm.Opcodes;
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    31
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    32
import java.util.ArrayList;
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    33
import java.util.HashSet;
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    34
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    35
/**
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    36
 * Helper class to assist the GenerateJLIClassesPlugin to get access to
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    37
 * generate classes ahead of time.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    38
 */
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    39
class GenerateJLIClassesHelper {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    40
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    41
    static byte[] generateDirectMethodHandleHolderClassBytes(String className,
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    42
            MethodType[] methodTypes, int[] types) {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    43
        LambdaForm[] forms = new LambdaForm[methodTypes.length];
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    44
        String[] names = new String[methodTypes.length];
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    45
        for (int i = 0; i < forms.length; i++) {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    46
            forms[i] = DirectMethodHandle.makePreparedLambdaForm(methodTypes[i],
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    47
                                                                 types[i]);
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    48
            names[i] = forms[i].kind.defaultLambdaName;
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    49
        }
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    50
        return generateCodeBytesForLFs(className, names, forms);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    51
    }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    52
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    53
    static byte[] generateDelegatingMethodHandleHolderClassBytes(String className,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    54
            MethodType[] methodTypes) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    55
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    56
        HashSet<MethodType> dedupSet = new HashSet<>();
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    57
        ArrayList<LambdaForm> forms = new ArrayList<>();
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    58
        ArrayList<String> names = new ArrayList<>();
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    59
        for (int i = 0; i < methodTypes.length; i++) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    60
            // generate methods representing the DelegatingMethodHandle
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    61
            if (dedupSet.add(methodTypes[i])) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    62
                // reinvokers are variant with the associated SpeciesData
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    63
                // and shape of the target LF, but we can easily pregenerate
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    64
                // the basic reinvokers associated with Species_L. Ultimately we
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    65
                // may want to consider pregenerating more of these, which will
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    66
                // require an even more complex naming scheme
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    67
                LambdaForm reinvoker = makeReinvokerFor(methodTypes[i]);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    68
                forms.add(reinvoker);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    69
                String speciesSig = BoundMethodHandle
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    70
                        .speciesData(reinvoker).fieldSignature();
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    71
                assert(speciesSig.equals("L"));
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    72
                names.add(reinvoker.kind.defaultLambdaName + "_" + speciesSig);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    73
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    74
                LambdaForm delegate = makeDelegateFor(methodTypes[i]);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    75
                forms.add(delegate);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    76
                names.add(delegate.kind.defaultLambdaName);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    77
            }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    78
        }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    79
        return generateCodeBytesForLFs(className,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    80
                names.toArray(new String[0]),
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    81
                forms.toArray(new LambdaForm[0]));
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    82
    }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    83
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    84
    /*
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    85
     * Generate customized code for a set of LambdaForms of specified types into
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    86
     * a class with a specified name.
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    87
     */
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    88
    private static byte[] generateCodeBytesForLFs(String className,
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    89
            String[] names, LambdaForm[] forms) {
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    90
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    91
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    92
        cw.visit(Opcodes.V1_8, Opcodes.ACC_PRIVATE + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER,
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    93
                className, null, InvokerBytecodeGenerator.INVOKER_SUPER_NAME, null);
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    94
        cw.visitSource(className.substring(className.lastIndexOf('/') + 1), null);
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    95
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    96
        for (int i = 0; i < forms.length; i++) {
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    97
            addMethod(className, names[i], forms[i],
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
    98
                    forms[i].methodType(), cw);
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
    99
        }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   100
        return cw.toByteArray();
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   101
    }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   102
40408
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   103
    private static void addMethod(String className, String methodName, LambdaForm form,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   104
            MethodType type, ClassWriter cw) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   105
        InvokerBytecodeGenerator g
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   106
                = new InvokerBytecodeGenerator(className, methodName, form, type);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   107
        g.setClassWriter(cw);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   108
        g.addMethod();
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   109
    }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   110
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   111
    private static LambdaForm makeReinvokerFor(MethodType type) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   112
        MethodHandle emptyHandle = MethodHandles.empty(type);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   113
        return DelegatingMethodHandle.makeReinvokerForm(emptyHandle,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   114
                MethodTypeForm.LF_REBIND,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   115
                BoundMethodHandle.speciesData_L(),
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   116
                BoundMethodHandle.speciesData_L().getterFunction(0));
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   117
    }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   118
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   119
    private static LambdaForm makeDelegateFor(MethodType type) {
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   120
        MethodHandle handle = MethodHandles.empty(type);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   121
        return DelegatingMethodHandle.makeReinvokerForm(
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   122
                handle,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   123
                MethodTypeForm.LF_DELEGATE,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   124
                DelegatingMethodHandle.class,
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   125
                DelegatingMethodHandle.NF_getTarget);
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   126
    }
cf7e826d4d63 8164044: Generate corresponding simple DelegatingMethodHandles when generating a DirectMethodHandle at link time
redestad
parents: 40259
diff changeset
   127
40259
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   128
    static Map.Entry<String, byte[]> generateConcreteBMHClassBytes(
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   129
            final String types) {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   130
        for (char c : types.toCharArray()) {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   131
            if ("LIJFD".indexOf(c) < 0) {
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   132
                throw new IllegalArgumentException("All characters must "
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   133
                        + "correspond to a basic field type: LIJFD");
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   134
            }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   135
        }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   136
        String shortTypes = LambdaForm.shortenSignature(types);
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   137
        final String className =
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   138
                BoundMethodHandle.Factory.speciesInternalClassName(shortTypes);
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   139
        return Map.entry(className,
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   140
                         BoundMethodHandle.Factory.generateConcreteBMHClassBytes(
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   141
                                 shortTypes, types, className));
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   142
    }
439673b634a9 8163814: JDK build has been failing after 8163373
redestad
parents:
diff changeset
   143
}