< prev index next >

src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java

Print this page
rev 53560 : 8218022: Repeated words typos in java.base
Reviewed-by: alanb, lancea
Contributed-by: Andrey Turbanov <turbanoff@gmail.com>
   1 /*
   2  * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 417      * rewritten to {@code int}.
 418      * A linker method is trusted to return a strongly typed result,
 419      * according to the specific method type descriptor of the
 420      * signature-polymorphic instance it is emulating.
 421      * This can involve (as necessary) a dynamic check using
 422      * data extracted from the appendix argument.
 423      * <p>
 424      * The JVM does not inspect the appendix, other than to pass
 425      * it verbatim to the linker method at every call.
 426      * This means that the JDK runtime has wide latitude
 427      * for choosing the shape of each linker method and its
 428      * corresponding appendix.
 429      * Linker methods should be generated from {@code LambdaForm}s
 430      * so that they do not become visible on stack traces.
 431      * <p>
 432      * The {@code linkMethod} call is free to omit the appendix
 433      * (returning null) and instead emulate the required function
 434      * completely in the linker method.
 435      * As a corner case, if N==255, no appendix is possible.
 436      * In this case, the method returned must be custom-generated to
 437      * to perform any needed type checking.
 438      * <p>
 439      * If the JVM does not reify a method at a call site, but instead
 440      * calls {@code linkMethod}, the corresponding call represented
 441      * in the bytecodes may mention a valid method which is not
 442      * representable with a {@code MemberName}.
 443      * Therefore, use cases for {@code linkMethod} tend to correspond to
 444      * special cases in reflective code such as {@code findVirtual}
 445      * or {@code revealDirect}.
 446      */
 447     static MemberName linkMethod(Class<?> callerClass, int refKind,
 448                                  Class<?> defc, String name, Object type,
 449                                  Object[] appendixResult) {
 450         if (!TRACE_METHOD_LINKAGE)
 451             return linkMethodImpl(callerClass, refKind, defc, name, type, appendixResult);
 452         return linkMethodTracing(callerClass, refKind, defc, name, type, appendixResult);
 453     }
 454     static MemberName linkMethodImpl(Class<?> callerClass, int refKind,
 455                                      Class<?> defc, String name, Object type,
 456                                      Object[] appendixResult) {
 457         try {


   1 /*
   2  * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 417      * rewritten to {@code int}.
 418      * A linker method is trusted to return a strongly typed result,
 419      * according to the specific method type descriptor of the
 420      * signature-polymorphic instance it is emulating.
 421      * This can involve (as necessary) a dynamic check using
 422      * data extracted from the appendix argument.
 423      * <p>
 424      * The JVM does not inspect the appendix, other than to pass
 425      * it verbatim to the linker method at every call.
 426      * This means that the JDK runtime has wide latitude
 427      * for choosing the shape of each linker method and its
 428      * corresponding appendix.
 429      * Linker methods should be generated from {@code LambdaForm}s
 430      * so that they do not become visible on stack traces.
 431      * <p>
 432      * The {@code linkMethod} call is free to omit the appendix
 433      * (returning null) and instead emulate the required function
 434      * completely in the linker method.
 435      * As a corner case, if N==255, no appendix is possible.
 436      * In this case, the method returned must be custom-generated to
 437      * perform any needed type checking.
 438      * <p>
 439      * If the JVM does not reify a method at a call site, but instead
 440      * calls {@code linkMethod}, the corresponding call represented
 441      * in the bytecodes may mention a valid method which is not
 442      * representable with a {@code MemberName}.
 443      * Therefore, use cases for {@code linkMethod} tend to correspond to
 444      * special cases in reflective code such as {@code findVirtual}
 445      * or {@code revealDirect}.
 446      */
 447     static MemberName linkMethod(Class<?> callerClass, int refKind,
 448                                  Class<?> defc, String name, Object type,
 449                                  Object[] appendixResult) {
 450         if (!TRACE_METHOD_LINKAGE)
 451             return linkMethodImpl(callerClass, refKind, defc, name, type, appendixResult);
 452         return linkMethodTracing(callerClass, refKind, defc, name, type, appendixResult);
 453     }
 454     static MemberName linkMethodImpl(Class<?> callerClass, int refKind,
 455                                      Class<?> defc, String name, Object type,
 456                                      Object[] appendixResult) {
 457         try {


< prev index next >