|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
package java.lang.invoke; |
|
|
|
import jdk.internal.vm.annotation.Stable; |
|
|
|
import static java.lang.invoke.LambdaForm.BasicType.*; |
|
import static java.lang.invoke.MethodHandleStatics.*; |
|
|
|
|
|
|
|
|
|
*/ |
|
final class SimpleMethodHandle extends BoundMethodHandle { |
|
|
|
private SimpleMethodHandle(MethodType type, LambdaForm form) { |
|
super(type, form); |
|
} |
|
|
|
static BoundMethodHandle make(MethodType type, LambdaForm form) { |
|
return new SimpleMethodHandle(type, form); |
|
} |
|
|
|
static @Stable BoundMethodHandle.SpeciesData BMH_SPECIES; |
|
|
|
@Override |
|
BoundMethodHandle.SpeciesData speciesData() { |
|
return BMH_SPECIES; |
|
} |
|
|
|
@Override |
|
BoundMethodHandle copyWith(MethodType mt, LambdaForm lf) { |
|
return make(mt, lf); |
|
} |
|
|
|
@Override |
|
String internalProperties() { |
|
return "\n& Class="+getClass().getSimpleName(); |
|
} |
|
|
|
@Override |
|
final BoundMethodHandle copyWithExtendL(MethodType mt, LambdaForm lf, Object narg) { |
|
return BoundMethodHandle.bindSingle(mt, lf, narg); |
|
} |
|
@Override |
|
final BoundMethodHandle copyWithExtendI(MethodType mt, LambdaForm lf, int narg) { |
|
try { |
|
return (BoundMethodHandle) BMH_SPECIES.extendWith(I_TYPE_NUM).factory().invokeBasic(mt, lf, narg); |
|
} catch (Throwable ex) { |
|
throw uncaughtException(ex); |
|
} |
|
} |
|
@Override |
|
final BoundMethodHandle copyWithExtendJ(MethodType mt, LambdaForm lf, long narg) { |
|
try { |
|
return (BoundMethodHandle) BMH_SPECIES.extendWith(J_TYPE_NUM).factory().invokeBasic(mt, lf, narg); |
|
} catch (Throwable ex) { |
|
throw uncaughtException(ex); |
|
} |
|
} |
|
@Override |
|
final BoundMethodHandle copyWithExtendF(MethodType mt, LambdaForm lf, float narg) { |
|
try { |
|
return (BoundMethodHandle) BMH_SPECIES.extendWith(F_TYPE_NUM).factory().invokeBasic(mt, lf, narg); |
|
} catch (Throwable ex) { |
|
throw uncaughtException(ex); |
|
} |
|
} |
|
@Override |
|
final BoundMethodHandle copyWithExtendD(MethodType mt, LambdaForm lf, double narg) { |
|
try { |
|
return (BoundMethodHandle) BMH_SPECIES.extendWith(D_TYPE_NUM).factory().invokeBasic(mt, lf, narg); |
|
} catch (Throwable ex) { |
|
throw uncaughtException(ex); |
|
} |
|
} |
|
} |