當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodHandleAccessProvider類代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:28,代碼來源:MethodHandleNode.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:26,代碼來源:MethodHandleAccessProviderData.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:19,代碼來源:MethodHandleNode.java

示例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;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:MethodHandleNode.java

示例5: MethodHandlePlugin

import jdk.vm.ci.meta.MethodHandleAccessProvider; //導入依賴的package包/類
public MethodHandlePlugin(MethodHandleAccessProvider methodHandleAccess, boolean safeForDeoptimization) {
    this.methodHandleAccess = methodHandleAccess;
    this.safeForDeoptimization = safeForDeoptimization;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:5,代碼來源:MethodHandlePlugin.java

示例6: getMethodHandleAccess

import jdk.vm.ci.meta.MethodHandleAccessProvider; //導入依賴的package包/類
public MethodHandleAccessProvider getMethodHandleAccess() {
    return methodHandleAccess;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:4,代碼來源:HotSpotConstantReflectionProvider.java

示例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");
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:HotSpotConstantReflectionProviderTest.java

示例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");
}
 
開發者ID:campolake,項目名稱:openjdk9,代碼行數:7,代碼來源:HotSpotConstantReflectionProviderTest.java


注:本文中的jdk.vm.ci.meta.MethodHandleAccessProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。