mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8237805: Use inline @jls @jvms in core libs where appropriate
Reviewed-by: xiaofeya, dfuchs, prappo
This commit is contained in:
parent
1ef862d03d
commit
683a5b1197
8 changed files with 35 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -222,8 +222,9 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
|||
* refers directly to an associated {@code CONSTANT_Methodref},
|
||||
* {@code CONSTANT_InterfaceMethodref}, or {@code CONSTANT_Fieldref}
|
||||
* constant pool entry.
|
||||
* (For full details on method handle constants,
|
||||
* see sections 4.4.8 and 5.4.3.5 of the Java Virtual Machine Specification.)
|
||||
* (For full details on method handle constants, see sections {@jvms
|
||||
* 4.4.8} and {@jvms 5.4.3.5} of the Java Virtual Machine
|
||||
* Specification.)
|
||||
* <p>
|
||||
* Method handles produced by lookups or constant loads from methods or
|
||||
* constructors with the variable arity modifier bit ({@code 0x0080})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -43,7 +43,8 @@ import static java.lang.invoke.MethodHandleStatics.*;
|
|||
* Direct method handles may be obtained in any of these ways:
|
||||
* <ul>
|
||||
* <li>By executing an {@code ldc} instruction on a {@code CONSTANT_MethodHandle} constant.
|
||||
* (See the Java Virtual Machine Specification, sections 4.4.8 and 5.4.3.)
|
||||
* (See the Java Virtual Machine Specification, sections {@jvms
|
||||
* 4.4.8} and {@jvms 5.4.3}.)
|
||||
* <li>By calling one of the <a href="MethodHandles.Lookup.html#lookups">Lookup Factory Methods</a>,
|
||||
* such as {@link Lookup#findVirtual Lookup.findVirtual},
|
||||
* to resolve a symbolic reference into a method handle.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -318,7 +318,8 @@ public class MethodHandles {
|
|||
* use cases for methods, constructors, and fields.
|
||||
* Each method handle created by a factory method is the functional
|
||||
* equivalent of a particular <em>bytecode behavior</em>.
|
||||
* (Bytecode behaviors are described in section 5.4.3.5 of the Java Virtual Machine Specification.)
|
||||
* (Bytecode behaviors are described in section {@jvms 5.4.3.5} of
|
||||
* the Java Virtual Machine Specification.)
|
||||
* Here is a summary of the correspondence between these factory methods and
|
||||
* the behavior of the resulting method handles:
|
||||
* <table class="striped">
|
||||
|
@ -502,7 +503,8 @@ public class MethodHandles {
|
|||
* If the desired member is {@code protected}, the usual JVM rules apply,
|
||||
* including the requirement that the lookup class must either be in the
|
||||
* same package as the desired member, or must inherit that member.
|
||||
* (See the Java Virtual Machine Specification, sections 4.9.2, 5.4.3.5, and 6.4.)
|
||||
* (See the Java Virtual Machine Specification, sections {@jvms
|
||||
* 4.9.2}, {@jvms 5.4.3.5}, and {@jvms 6.4}.)
|
||||
* In addition, if the desired member is a non-static field or method
|
||||
* in a different package, the resulting method handle may only be applied
|
||||
* to objects of the lookup class or one of its subclasses.
|
||||
|
@ -515,7 +517,7 @@ public class MethodHandles {
|
|||
* that the receiver argument must match both the resolved method <em>and</em>
|
||||
* the current class. Again, this requirement is enforced by narrowing the
|
||||
* type of the leading parameter to the resulting method handle.
|
||||
* (See the Java Virtual Machine Specification, section 4.10.1.9.)
|
||||
* (See the Java Virtual Machine Specification, section {@jmvs 4.10.1.9}.)
|
||||
* <p>
|
||||
* The JVM represents constructors and static initializer blocks as internal methods
|
||||
* with special names ({@code "<init>"} and {@code "<clinit>"}).
|
||||
|
@ -525,7 +527,8 @@ public class MethodHandles {
|
|||
* <p>
|
||||
* If the relationship between nested types is expressed directly through the
|
||||
* {@code NestHost} and {@code NestMembers} attributes
|
||||
* (see the Java Virtual Machine Specification, sections 4.7.28 and 4.7.29),
|
||||
* (see the Java Virtual Machine Specification, sections {@jvms
|
||||
* 4.7.28} and {@jvms 4.7.29}),
|
||||
* then the associated {@code Lookup} object provides direct access to
|
||||
* the lookup class and all of its nestmates
|
||||
* (see {@link java.lang.Class#getNestHost Class.getNestHost}).
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -91,8 +91,9 @@ import static java.lang.invoke.MethodType.fromDescriptor;
|
|||
* A method type may be loaded by an {@code ldc} instruction which refers
|
||||
* to a suitable {@code CONSTANT_MethodType} constant pool entry.
|
||||
* The entry refers to a {@code CONSTANT_Utf8} spelling for the descriptor string.
|
||||
* (For full details on method type constants,
|
||||
* see sections 4.4.8 and 5.4.3.5 of the Java Virtual Machine Specification.)
|
||||
* (For full details on method type constants, see sections {@jvms
|
||||
* 4.4.8} and {@jvms 5.4.3.5} of the Java Virtual Machine
|
||||
* Specification.)
|
||||
* <p>
|
||||
* When the JVM materializes a {@code MethodType} from a descriptor string,
|
||||
* all classes named in the descriptor must be accessible, and will be loaded.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue