本文整理汇总了Java中jdk.vm.ci.meta.MethodHandleAccessProvider类的典型用法代码示例。如果您正苦于以下问题:Java MethodHandleAccessProvider类的具体用法?Java MethodHandleAccessProvider怎么用?Java MethodHandleAccessProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodHandleAccessProvider类属于jdk.vm.ci.meta包,在下文中一共展示了MethodHandleAccessProvider类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryResolveTargetInvoke
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
/**
* Attempts to transform application of an intrinsifiable {@link MethodHandle} method into an
* invocation on another method with possibly transformed arguments.
*
* @param methodHandleAccess objects for accessing the implementation internals of a
* {@link MethodHandle}
* @param intrinsicMethod denotes the intrinsifiable {@link MethodHandle} method being processed
* @param bci the BCI of the original {@link MethodHandle} call
* @param returnStamp return stamp of the original {@link MethodHandle} call
* @param arguments arguments to the original {@link MethodHandle} call
* @return a more direct invocation derived from the {@link MethodHandle} call or null
*/
public static InvokeNode tryResolveTargetInvoke(GraphAdder adder, MethodHandleAccessProvider methodHandleAccess, IntrinsicMethod intrinsicMethod,
ResolvedJavaMethod original, int bci,
StampPair returnStamp, ValueNode... arguments) {
switch (intrinsicMethod) {
case INVOKE_BASIC:
return getInvokeBasicTarget(adder, intrinsicMethod, methodHandleAccess, original, bci, returnStamp, arguments);
case LINK_TO_STATIC:
case LINK_TO_SPECIAL:
case LINK_TO_VIRTUAL:
case LINK_TO_INTERFACE:
return getLinkToTarget(adder, intrinsicMethod, methodHandleAccess, original, bci, returnStamp, arguments);
default:
throw GraalError.shouldNotReachHere();
}
}
示例2: getIntrinsicsDataPositive
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
@DataProvider(name = "intrinsicsPositive")
public static Object[][] getIntrinsicsDataPositive() {
Object[][] result;
try {
result = new Object[][]{
new Object[]{
META_ACCESS.lookupJavaMethod(MethodHandle.class.getDeclaredMethod("invokeBasic", Object[].class)),
MethodHandleAccessProvider.IntrinsicMethod.INVOKE_BASIC},
new Object[]{
META_ACCESS.lookupJavaMethod(MethodHandle.class.getDeclaredMethod("linkToInterface", Object[].class)),
MethodHandleAccessProvider.IntrinsicMethod.LINK_TO_INTERFACE},
new Object[]{
META_ACCESS.lookupJavaMethod(MethodHandle.class.getDeclaredMethod("linkToStatic", Object[].class)),
MethodHandleAccessProvider.IntrinsicMethod.LINK_TO_STATIC},
new Object[]{
META_ACCESS.lookupJavaMethod(MethodHandle.class.getDeclaredMethod("linkToVirtual", Object[].class)),
MethodHandleAccessProvider.IntrinsicMethod.LINK_TO_VIRTUAL},
new Object[]{
META_ACCESS.lookupJavaMethod(MethodHandle.class.getDeclaredMethod("linkToSpecial", Object[].class)),
MethodHandleAccessProvider.IntrinsicMethod.LINK_TO_SPECIAL}};
} catch (NoSuchMethodException e) {
throw new Error("TESTBUG: can't find method: " + e, e);
}
return result;
}
示例3: getInvokeBasicTarget
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
/**
* Used for the MethodHandle.invokeBasic method (the {@link IntrinsicMethod#INVOKE_BASIC }
* method) to get the target {@link InvokeNode} if the method handle receiver is constant.
*
* @param adder
*
* @return invoke node for the {@link java.lang.invoke.MethodHandle} target
*/
private static InvokeNode getInvokeBasicTarget(GraphAdder adder, IntrinsicMethod intrinsicMethod, MethodHandleAccessProvider methodHandleAccess,
ResolvedJavaMethod original,
int bci,
StampPair returnStamp, ValueNode[] arguments) {
ValueNode methodHandleNode = getReceiver(arguments);
if (methodHandleNode.isConstant()) {
return getTargetInvokeNode(adder, intrinsicMethod, bci, returnStamp, arguments, methodHandleAccess.resolveInvokeBasicTarget(methodHandleNode.asJavaConstant(), true), original);
}
return null;
}
示例4: getLinkToTarget
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
/**
* Used for the MethodHandle.linkTo* methods (the {@link IntrinsicMethod#LINK_TO_STATIC},
* {@link IntrinsicMethod#LINK_TO_SPECIAL}, {@link IntrinsicMethod#LINK_TO_VIRTUAL}, and
* {@link IntrinsicMethod#LINK_TO_INTERFACE} methods) to get the target {@link InvokeNode} if
* the member name argument is constant.
*
* @param adder
*
* @return invoke node for the member name target
*/
private static InvokeNode getLinkToTarget(GraphAdder adder, IntrinsicMethod intrinsicMethod, MethodHandleAccessProvider methodHandleAccess,
ResolvedJavaMethod original,
int bci,
StampPair returnStamp, ValueNode[] arguments) {
ValueNode memberNameNode = getMemberName(arguments);
if (memberNameNode.isConstant()) {
return getTargetInvokeNode(adder, intrinsicMethod, bci, returnStamp, arguments, methodHandleAccess.resolveLinkToTarget(memberNameNode.asJavaConstant()), original);
}
return null;
}
示例5: MethodHandlePlugin
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
public MethodHandlePlugin(MethodHandleAccessProvider methodHandleAccess, boolean safeForDeoptimization) {
this.methodHandleAccess = methodHandleAccess;
this.safeForDeoptimization = safeForDeoptimization;
}
示例6: getMethodHandleAccess
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
public MethodHandleAccessProvider getMethodHandleAccess() {
return methodHandleAccess;
}
示例7: testGetMethodHandleAccess
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
@Test
public void testGetMethodHandleAccess() {
MethodHandleAccessProvider actual = CONSTANT_REFLECTION_PROVIDER.getMethodHandleAccess();
Assert.assertNotNull(actual,
"Returned MethodHandleAccessProvider instance should not be null");
}
示例8: testGetMethodHandleAccess
import jdk.vm.ci.meta.MethodHandleAccessProvider; //导入依赖的package包/类
@Test
public void testGetMethodHandleAccess() {
MethodHandleAccessProvider actual = CONSTANT_REFLECTION_PROVIDER.getMethodHandleAccess();
Assert.assertNotNull(actual,
"Returned MethodHandleAccessProvider instance should not be null");
}