当前位置: 首页>>代码示例>>Java>>正文


Java ResolvedJavaMethod.isStatic方法代码示例

本文整理汇总了Java中jdk.vm.ci.meta.ResolvedJavaMethod.isStatic方法的典型用法代码示例。如果您正苦于以下问题:Java ResolvedJavaMethod.isStatic方法的具体用法?Java ResolvedJavaMethod.isStatic怎么用?Java ResolvedJavaMethod.isStatic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.vm.ci.meta.ResolvedJavaMethod的用法示例。


在下文中一共展示了ResolvedJavaMethod.isStatic方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testUnsafe

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
@Test
public void testUnsafe() {
    int m = 42;
    long addr1 = createBuffer();
    long addr2 = createBuffer();
    try {
        ResolvedJavaMethod method = getResolvedJavaMethod("readWriteReadUnsafe");
        Object receiver = method.isStatic() ? null : this;
        Result expect = executeExpected(method, receiver, addr1, m);
        if (getCodeCache() == null) {
            return;
        }
        testAgainstExpected(method, expect, receiver, addr2, m);
    } catch (AssumptionViolatedException e) {
        // Suppress so that subsequent calls to this method within the
        // same Junit @Test annotated method can proceed.
    } finally {
        disposeBuffer(addr1);
        disposeBuffer(addr2);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:UnsafeDeopt.java

示例2: testByteBuffer

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
@Test
public void testByteBuffer() {
    int m = 42;
    try {
        ResolvedJavaMethod method = getResolvedJavaMethod("readWriteReadByteBuffer");
        Object receiver = method.isStatic() ? null : this;
        Result expect = executeExpected(method, receiver, ByteBuffer.allocateDirect(32), m);
        if (getCodeCache() == null) {
            return;
        }
        ByteBuffer warmupBuffer = ByteBuffer.allocateDirect(32);
        for (int i = 0; i < 10000; ++i) {
            readWriteReadByteBuffer(warmupBuffer, (i % 50) + 1);
            warmupBuffer.putInt(0, 0);
        }
        testAgainstExpected(method, expect, receiver, ByteBuffer.allocateDirect(32), m);
    } catch (AssumptionViolatedException e) {
        // Suppress so that subsequent calls to this method within the
        // same Junit @Test annotated method can proceed.
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:UnsafeDeopt.java

示例3: runTest

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
protected void runTest(OptionValues options, Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) {
    ResolvedJavaMethod method = getResolvedJavaMethod(name);
    Object receiver = method.isStatic() ? null : this;

    Result expect = executeExpected(method, receiver, args);

    if (noProfile) {
        method.reprofile();
    }

    testAgainstExpected(options, method, expect, shouldNotDeopt, receiver, args);
    if (args.length > 0 && bind) {
        if (noProfile) {
            method.reprofile();
        }

        this.argsToBind = args;
        testAgainstExpected(options, method, expect, shouldNotDeopt, receiver, args);
        this.argsToBind = null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:JTTTest.java

示例4: createParameterStamps

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
public static Stamp[] createParameterStamps(Assumptions assumptions, ResolvedJavaMethod method) {
    Signature sig = method.getSignature();
    Stamp[] result = new Stamp[sig.getParameterCount(!method.isStatic())];
    int index = 0;

    if (!method.isStatic()) {
        result[index++] = StampFactory.objectNonNull(TypeReference.create(assumptions, method.getDeclaringClass()));
    }

    int max = sig.getParameterCount(false);
    ResolvedJavaType accessingClass = method.getDeclaringClass();
    for (int i = 0; i < max; i++) {
        JavaType type = sig.getParameterType(i, accessingClass);
        JavaKind kind = type.getJavaKind();
        Stamp stamp;
        if (kind == JavaKind.Object && type instanceof ResolvedJavaType) {
            stamp = StampFactory.object(TypeReference.create(assumptions, (ResolvedJavaType) type));
        } else {
            stamp = StampFactory.forKind(kind);
        }
        result[index++] = stamp;
    }

    return result;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:StampFactory.java

示例5: getCallingConvention

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * Create a calling convention from a {@link ResolvedJavaMethod}.
 */
public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, ValueKindFactory<?> valueKindFactory) {
    Signature sig = method.getSignature();
    JavaType retType = sig.getReturnType(null);
    int sigCount = sig.getParameterCount(false);
    JavaType[] argTypes;
    int argIndex = 0;
    if (!method.isStatic()) {
        argTypes = new JavaType[sigCount + 1];
        argTypes[argIndex++] = method.getDeclaringClass();
    } else {
        argTypes = new JavaType[sigCount];
    }
    for (int i = 0; i < sigCount; i++) {
        argTypes[argIndex++] = sig.getParameterType(i, null);
    }

    RegisterConfig registerConfig = codeCache.getRegisterConfig();
    return registerConfig.getCallingConvention(type, retType, argTypes, valueKindFactory);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:CodeUtil.java

示例6: testVirtualMethodTableAccess

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * All public non-final methods should be available in the vtable.
 */
@Test
public void testVirtualMethodTableAccess() {
    for (Class<?> c : classes) {
        if (c.isPrimitive() || c.isInterface()) {
            continue;
        }
        ResolvedJavaType receiverType = metaAccess.lookupJavaType(c);
        for (Method m : c.getMethods()) {
            ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
            if (!method.isStatic() && !method.isFinal() && !method.getDeclaringClass().isLeaf() && !method.getDeclaringClass().isInterface()) {
                assertTrue(method + " not available in " + receiverType, method.isInVirtualMethodTable(receiverType));
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:TestResolvedJavaMethod.java

示例7: findMethod

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
ResolvedJavaMethod findMethod(ResolvedJavaType type, String name, String descriptor, boolean isStatic) {
    ResolvedJavaMethod method = getMethods(type).lookup(type, name, descriptor);
    if (method != null && method.isStatic() == isStatic) {
        return method;
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ClassfileBytecodeProvider.java

示例8: createTargetInvokeNode

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * Creates an {@link InvokeNode} for the given target method. The {@link CallTargetNode} passed
 * to the InvokeNode is in fact a {@link ResolvedMethodHandleCallTargetNode}.
 *
 * @return invoke node for the member name target
 */
private static InvokeNode createTargetInvokeNode(Assumptions assumptions, IntrinsicMethod intrinsicMethod, ResolvedJavaMethod target, ResolvedJavaMethod original, int bci, StampPair returnStamp,
                ValueNode[] arguments) {
    InvokeKind targetInvokeKind = target.isStatic() ? InvokeKind.Static : InvokeKind.Special;
    JavaType targetReturnType = target.getSignature().getReturnType(null);

    // MethodHandleLinkTo* nodes have a trailing MemberName argument which
    // needs to be popped.
    ValueNode[] targetArguments;
    switch (intrinsicMethod) {
        case INVOKE_BASIC:
            targetArguments = arguments;
            break;
        case LINK_TO_STATIC:
        case LINK_TO_SPECIAL:
        case LINK_TO_VIRTUAL:
        case LINK_TO_INTERFACE:
            targetArguments = Arrays.copyOfRange(arguments, 0, arguments.length - 1);
            break;
        default:
            throw GraalError.shouldNotReachHere();
    }
    StampPair targetReturnStamp = StampFactory.forDeclaredType(assumptions, targetReturnType, false);

    MethodCallTargetNode callTarget = ResolvedMethodHandleCallTargetNode.create(targetInvokeKind, target, targetArguments, targetReturnStamp, original, arguments, returnStamp);

    // The call target can have a different return type than the invoker,
    // e.g. the target returns an Object but the invoker void. In this case
    // we need to use the stamp of the invoker. Note: always using the
    // invoker's stamp would be wrong because it's a less concrete type
    // (usually java.lang.Object).
    if (returnStamp.getTrustedStamp().getStackKind() == JavaKind.Void) {
        return new InvokeNode(callTarget, bci, StampFactory.forVoid());
    } else {
        return new InvokeNode(callTarget, bci);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:43,代码来源:MethodHandleNode.java

示例9: init

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
public InvocationPluginReceiver init(ResolvedJavaMethod targetMethod, ValueNode[] newArgs) {
    if (!targetMethod.isStatic()) {
        this.args = newArgs;
        this.value = null;
        return this;
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:InvocationPlugins.java

示例10: addMethod

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * Adds a root method to the static analysis. The method must be static and must not have any
 * parameters, because the possible types of the parameters would not be known.
 */
public void addMethod(ResolvedJavaMethod method) {
    if (!method.isStatic() || method.getSignature().getParameterCount(false) > 0) {
        error("Entry point method is not static or has parameters: " + method.format("%H.%n(%p)"));
    }
    addToWorklist(results.lookupMethod(method));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:StaticAnalysis.java

示例11: test

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
protected final Result test(OptionValues options, String name, Object... args) {
    try {
        ResolvedJavaMethod method = getResolvedJavaMethod(name);
        Object receiver = method.isStatic() ? null : this;
        return test(options, method, receiver, args);
    } catch (AssumptionViolatedException e) {
        // Suppress so that subsequent calls to this method within the
        // same Junit @Test annotated method can proceed.
        return null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:GraalCompilerTest.java

示例12: InvocationPluginAssertions

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
InvocationPluginAssertions(InvocationPlugin plugin, ValueNode[] args, ResolvedJavaMethod targetMethod, JavaKind resultType) {
    guarantee(Assertions.assertionsEnabled(), "%s should only be loaded and instantiated if assertions are enabled", getClass().getSimpleName());
    this.plugin = plugin;
    this.targetMethod = targetMethod;
    this.args = args;
    this.resultType = resultType;
    this.beforeStackSize = frameState.stackSize();
    this.needsNullCheck = !targetMethod.isStatic() && args[0].getStackKind() == JavaKind.Object && !StampTool.isPointerNonNull(args[0].stamp());
    this.nodeCount = graph.getNodeCount();
    this.mark = graph.getMark();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:BytecodeParser.java

示例13: synchronizedObject

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
private ValueNode synchronizedObject(FrameStateBuilder state, ResolvedJavaMethod target) {
    if (target.isStatic()) {
        return appendConstant(getConstantReflection().asJavaClass(target.getDeclaringClass()));
    } else {
        return state.loadLocal(0, JavaKind.Object);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:BytecodeParser.java

示例14: doInline

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
protected LoopScope doInline(PEMethodScope methodScope, LoopScope loopScope, InvokeData invokeData, InlineInfo inlineInfo, ValueNode[] arguments) {
    ResolvedJavaMethod inlineMethod = inlineInfo.getMethodToInline();
    EncodedGraph graphToInline = lookupEncodedGraph(inlineMethod, inlineInfo.getIntrinsicBytecodeProvider());
    if (graphToInline == null) {
        return null;
    }

    if (methodScope.inliningDepth > Options.InliningDepthError.getValue(options)) {
        throw tooDeepInlining(methodScope);
    }

    for (InlineInvokePlugin plugin : inlineInvokePlugins) {
        plugin.notifyBeforeInline(inlineMethod);
    }

    Invoke invoke = invokeData.invoke;
    FixedNode invokeNode = invoke.asNode();
    FixedWithNextNode predecessor = (FixedWithNextNode) invokeNode.predecessor();
    invokeNode.replaceAtPredecessor(null);

    PEMethodScope inlineScope = new PEMethodScope(graph, methodScope, loopScope, graphToInline, inlineMethod, invokeData, methodScope.inliningDepth + 1,
                    loopExplosionPlugin, arguments);

    if (!inlineMethod.isStatic()) {
        if (StampTool.isPointerAlwaysNull(arguments[0])) {
            /*
             * The receiver is null, so we can unconditionally throw a NullPointerException
             * instead of performing any inlining.
             */
            DeoptimizeNode deoptimizeNode = graph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException));
            predecessor.setNext(deoptimizeNode);
            finishInlining(inlineScope);
            /* Continue decoding in the caller. */
            return loopScope;

        } else if (!StampTool.isPointerNonNull(arguments[0])) {
            /* The receiver might be null, so we need to insert a null check. */
            PEAppendGraphBuilderContext graphBuilderContext = new PEAppendGraphBuilderContext(inlineScope, predecessor);
            arguments[0] = graphBuilderContext.nullCheckedValue(arguments[0]);
            predecessor = graphBuilderContext.lastInstr;
        }
    }

    LoopScope inlineLoopScope = createInitialLoopScope(inlineScope, predecessor);

    /*
     * The GraphEncoder assigns parameters a nodeId immediately after the fixed nodes.
     * Initializing createdNodes here avoid decoding and immediately replacing the
     * ParameterNodes.
     */
    int firstArgumentNodeId = inlineScope.maxFixedNodeOrderId + 1;
    for (int i = 0; i < arguments.length; i++) {
        inlineLoopScope.createdNodes[firstArgumentNodeId + i] = arguments[i];
    }

    /*
     * Do the actual inlining by returning the initial loop scope for the inlined method scope.
     */
    return inlineLoopScope;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:61,代码来源:PEGraphDecoder.java

示例15: emitCodePrefix

import jdk.vm.ci.meta.ResolvedJavaMethod; //导入方法依赖的package包/类
/**
 * Emits the code prior to the verified entry point.
 *
 * @param installedCodeOwner see {@link Backend#emitCode}
 */
public void emitCodePrefix(ResolvedJavaMethod installedCodeOwner, CompilationResultBuilder crb, AMD64MacroAssembler asm, RegisterConfig regConfig, Label verifiedEntry) {
    HotSpotProviders providers = getProviders();
    if (installedCodeOwner != null && !installedCodeOwner.isStatic()) {
        crb.recordMark(config.MARKID_UNVERIFIED_ENTRY);
        CallingConvention cc = regConfig.getCallingConvention(HotSpotCallingConventionType.JavaCallee, null, new JavaType[]{providers.getMetaAccess().lookupJavaType(Object.class)}, this);
        Register inlineCacheKlass = rax; // see definition of IC_Klass in
                                         // c1_LIRAssembler_x86.cpp
        Register receiver = asRegister(cc.getArgument(0));
        AMD64Address src = new AMD64Address(receiver, config.hubOffset);

        if (config.useCompressedClassPointers) {
            Register register = r10;
            AMD64HotSpotMove.decodeKlassPointer(crb, asm, register, providers.getRegisters().getHeapBaseRegister(), src, config);
            if (GeneratePIC.getValue(crb.getOptions())) {
                asm.movq(providers.getRegisters().getHeapBaseRegister(), asm.getPlaceholder(-1));
                crb.recordMark(config.MARKID_NARROW_OOP_BASE_ADDRESS);
            } else {
                if (config.narrowKlassBase != 0) {
                    // The heap base register was destroyed above, so restore it
                    asm.movq(providers.getRegisters().getHeapBaseRegister(), config.narrowOopBase);
                }
            }
            asm.cmpq(inlineCacheKlass, register);
        } else {
            asm.cmpq(inlineCacheKlass, src);
        }
        AMD64Call.directConditionalJmp(crb, asm, getForeignCalls().lookupForeignCall(IC_MISS_HANDLER), ConditionFlag.NotEqual);
    }

    asm.align(config.codeEntryAlignment);
    crb.recordMark(config.MARKID_OSR_ENTRY);
    asm.bind(verifiedEntry);
    crb.recordMark(config.MARKID_VERIFIED_ENTRY);

    if (GeneratePIC.getValue(crb.getOptions())) {
        // Check for method state
        HotSpotFrameContext frameContext = (HotSpotFrameContext) crb.frameContext;
        if (!frameContext.isStub) {
            crb.recordInlineDataInCodeWithNote(new HotSpotSentinelConstant(LIRKind.value(AMD64Kind.QWORD), JavaKind.Long), HotSpotConstantLoadAction.MAKE_NOT_ENTRANT);
            asm.movq(AMD64.rax, asm.getPlaceholder(-1));
            asm.testq(AMD64.rax, AMD64.rax);
            AMD64Call.directConditionalJmp(crb, asm, getForeignCalls().lookupForeignCall(WRONG_METHOD_HANDLER), ConditionFlag.NotZero);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:51,代码来源:AMD64HotSpotBackend.java


注:本文中的jdk.vm.ci.meta.ResolvedJavaMethod.isStatic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。