mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8234335: Remove line break in class declaration in java.base
Remove line break in class declarations where applicable Reviewed-by: rriggs, lancea
This commit is contained in:
parent
e636c69e61
commit
a8a2246158
103 changed files with 416 additions and 460 deletions
|
@ -59,7 +59,8 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
* Trusted implementation code for MethodHandle.
|
||||
* @author jrose
|
||||
*/
|
||||
/*non-public*/ abstract class MethodHandleImpl {
|
||||
/*non-public*/
|
||||
abstract class MethodHandleImpl {
|
||||
|
||||
/// Factory methods to create method handles:
|
||||
|
||||
|
@ -683,8 +684,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
}
|
||||
|
||||
@Hidden
|
||||
static
|
||||
MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
|
||||
static MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
|
||||
if (testResult) {
|
||||
return target;
|
||||
} else {
|
||||
|
@ -695,8 +695,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
// Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
|
||||
@Hidden
|
||||
@jdk.internal.HotSpotIntrinsicCandidate
|
||||
static
|
||||
boolean profileBoolean(boolean result, int[] counters) {
|
||||
static boolean profileBoolean(boolean result, int[] counters) {
|
||||
// Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
|
||||
int idx = result ? 1 : 0;
|
||||
try {
|
||||
|
@ -711,13 +710,11 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
// Intrinsified by C2. Returns true if obj is a compile-time constant.
|
||||
@Hidden
|
||||
@jdk.internal.HotSpotIntrinsicCandidate
|
||||
static
|
||||
boolean isCompileConstant(Object obj) {
|
||||
static boolean isCompileConstant(Object obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static
|
||||
MethodHandle makeGuardWithTest(MethodHandle test,
|
||||
static MethodHandle makeGuardWithTest(MethodHandle test,
|
||||
MethodHandle target,
|
||||
MethodHandle fallback) {
|
||||
MethodType type = target.type();
|
||||
|
@ -744,8 +741,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
}
|
||||
|
||||
|
||||
static
|
||||
MethodHandle profile(MethodHandle target) {
|
||||
static MethodHandle profile(MethodHandle target) {
|
||||
if (DONT_INLINE_THRESHOLD >= 0) {
|
||||
return makeBlockInliningWrapper(target);
|
||||
} else {
|
||||
|
@ -757,8 +753,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
* Block inlining during JIT-compilation of a target method handle if it hasn't been invoked enough times.
|
||||
* Corresponding LambdaForm has @DontInline when compiled into bytecode.
|
||||
*/
|
||||
static
|
||||
MethodHandle makeBlockInliningWrapper(MethodHandle target) {
|
||||
static MethodHandle makeBlockInliningWrapper(MethodHandle target) {
|
||||
LambdaForm lform;
|
||||
if (DONT_INLINE_THRESHOLD > 0) {
|
||||
lform = Makers.PRODUCE_BLOCK_INLINING_FORM.apply(target);
|
||||
|
@ -895,8 +890,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
LambdaForm makeGuardWithTestForm(MethodType basicType) {
|
||||
static LambdaForm makeGuardWithTestForm(MethodType basicType) {
|
||||
LambdaForm lform = basicType.form().cachedLambdaForm(MethodTypeForm.LF_GWT);
|
||||
if (lform != null) return lform;
|
||||
final int THIS_MH = 0; // the BMH_LLL
|
||||
|
@ -1026,8 +1020,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform);
|
||||
}
|
||||
|
||||
static
|
||||
MethodHandle makeGuardWithCatch(MethodHandle target,
|
||||
static MethodHandle makeGuardWithCatch(MethodHandle target,
|
||||
Class<? extends Throwable> exType,
|
||||
MethodHandle catcher) {
|
||||
MethodType type = target.type();
|
||||
|
@ -1078,8 +1071,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
return newArray;
|
||||
}
|
||||
|
||||
static
|
||||
MethodHandle throwException(MethodType type) {
|
||||
static MethodHandle throwException(MethodType type) {
|
||||
assert(Throwable.class.isAssignableFrom(type.parameterType(0)));
|
||||
int arity = type.parameterCount();
|
||||
if (arity > 1) {
|
||||
|
@ -1137,8 +1129,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
* is sensitive to its caller. A small number of system methods
|
||||
* are in this category, including Class.forName and Method.invoke.
|
||||
*/
|
||||
static
|
||||
MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
|
||||
static MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
|
||||
return BindCaller.bindCaller(mh, hostClass);
|
||||
}
|
||||
|
||||
|
@ -1147,8 +1138,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
private static class BindCaller {
|
||||
private static MethodType INVOKER_MT = MethodType.methodType(Object.class, MethodHandle.class, Object[].class);
|
||||
|
||||
static
|
||||
MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
|
||||
static MethodHandle bindCaller(MethodHandle mh, Class<?> hostClass) {
|
||||
// Code in the boot layer should now be careful while creating method handles or
|
||||
// functional interface instances created from method references to @CallerSensitive methods,
|
||||
// it needs to be ensured the handles or interface instances are kept safe and are not passed
|
||||
|
@ -1665,7 +1655,8 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
|||
return getConstantHandle(MH_copyAsPrimitiveArray).bindTo(Wrapper.forPrimitiveType(elemType));
|
||||
}
|
||||
|
||||
/*non-public*/ static void assertSame(Object mh1, Object mh2) {
|
||||
/*non-public*/
|
||||
static void assertSame(Object mh1, Object mh2) {
|
||||
if (mh1 != mh2) {
|
||||
String msg = String.format("mh1 != mh2: mh1 = %s (form: %s); mh2 = %s (form: %s)",
|
||||
mh1, ((MethodHandle)mh1).form,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue