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


Java JavaConstant.isDefaultForKind方法代码示例

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


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

示例1: emitStore

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
@Override
public void emitStore(ValueKind<?> lirKind, Value address, Value inputVal, LIRFrameState state) {
    AArch64AddressValue storeAddress = getLIRGen().asAddressValue(address);
    AArch64Kind kind = (AArch64Kind) lirKind.getPlatformKind();

    if (isJavaConstant(inputVal) && kind.isInteger()) {
        JavaConstant c = asJavaConstant(inputVal);
        if (c.isDefaultForKind()) {
            // We can load 0 directly into integer registers
            getLIRGen().append(new StoreConstantOp(kind, storeAddress, c, state));
            return;
        }
    }
    AllocatableValue input = getLIRGen().asAllocatable(inputVal);
    getLIRGen().append(new StoreOp(kind, storeAddress, input, state));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:AArch64ArithmeticLIRGenerator.java

示例2: tryConstantFold

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
private static ValueNode tryConstantFold(ValueNode array, ValueNode index, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection) {
    if (array.isConstant() && !array.isNullConstant() && index.isConstant()) {
        JavaConstant arrayConstant = array.asJavaConstant();
        if (arrayConstant != null) {
            int stableDimension = ((ConstantNode) array).getStableDimension();
            if (stableDimension > 0) {
                JavaConstant constant = constantReflection.readArrayElement(arrayConstant, index.asJavaConstant().asInt());
                boolean isDefaultStable = ((ConstantNode) array).isDefaultStable();
                if (constant != null && (isDefaultStable || !constant.isDefaultForKind())) {
                    return ConstantNode.forConstant(constant, stableDimension - 1, isDefaultStable, metaAccess);
                }
            }
        }
    }
    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:LoadIndexedNode.java

示例3: StoreConstantOp

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
public StoreConstantOp(AArch64Kind kind, AArch64AddressValue address, JavaConstant input, LIRFrameState state) {
    super(TYPE, kind, address, state);
    this.input = input;
    if (!input.isDefaultForKind()) {
        throw GraalError.shouldNotReachHere("Can only store null constants to memory");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:AArch64Move.java

示例4: const2stack

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
private static void const2stack(CompilationResultBuilder crb, AArch64MacroAssembler masm, Value result, JavaConstant constant) {
    try (ScratchRegister addrReg = masm.getScratchRegister()) {
        StackSlot slot = (StackSlot) result;
        AArch64Address resultAddress = loadStackSlotAddress(crb, masm, slot, addrReg.getRegister());
        if (constant.isDefaultForKind() || constant.isNull()) {
            emitStore(crb, masm, (AArch64Kind) result.getPlatformKind(), resultAddress, zr.asValue(LIRKind.combine(result)));
        } else {
            try (ScratchRegister sc = masm.getScratchRegister()) {
                Value scratchRegisterValue = sc.getRegister().asValue(LIRKind.combine(result));
                const2reg(crb, masm, scratchRegisterValue, constant);
                emitStore(crb, masm, (AArch64Kind) result.getPlatformKind(), resultAddress, scratchRegisterValue);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:AArch64Move.java

示例5: emitStore

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
@Override
public void emitStore(ValueKind<?> kind, Value address, Value inputVal, LIRFrameState state) {
    SPARCAddressValue storeAddress = getLIRGen().asAddressValue(address);
    if (isJavaConstant(inputVal)) {
        JavaConstant c = asJavaConstant(inputVal);
        if (c.isDefaultForKind()) {
            getLIRGen().append(new StoreConstantOp(kind.getPlatformKind(), storeAddress, c, state));
            return;
        }
    }
    Variable input = getLIRGen().load(inputVal);
    getLIRGen().append(new StoreOp(kind.getPlatformKind(), storeAddress, input, state));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:SPARCArithmeticLIRGenerator.java

示例6: StoreConstantOp

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
public StoreConstantOp(PlatformKind kind, SPARCAddressValue address, JavaConstant input, LIRFrameState state) {
    super(TYPE, SIZE, kind, address, state);
    this.input = input;
    if (!input.isDefaultForKind()) {
        throw GraalError.shouldNotReachHere("Can only store null constants to memory");
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:SPARCMove.java

示例7: isStableFieldValueConstant

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
@SuppressWarnings("unused")
protected boolean isStableFieldValueConstant(ResolvedJavaField field, JavaConstant value, ConstantFieldTool<?> tool) {
    return !value.isDefaultForKind();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:JavaConstantFieldProvider.java

示例8: isFinalFieldValueConstant

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
@SuppressWarnings("unused")
protected boolean isFinalFieldValueConstant(ResolvedJavaField field, JavaConstant value, ConstantFieldTool<?> tool) {
    return !value.isDefaultForKind() || Options.TrustFinalDefaultFields.getValue(tool.getOptions());
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:JavaConstantFieldProvider.java

示例9: emitCompareOp

import jdk.vm.ci.meta.JavaConstant; //导入方法依赖的package包/类
@Override
public void emitCompareOp(AMD64Kind cmpKind, Variable left, Value right) {
    OperandSize size;
    switch (cmpKind) {
        case BYTE:
            size = BYTE;
            break;
        case WORD:
            size = WORD;
            break;
        case DWORD:
            size = DWORD;
            break;
        case QWORD:
            size = QWORD;
            break;
        case SINGLE:
            getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PS, left, getLIRGen().asAllocatable(right)));
            return;
        case DOUBLE:
            getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PD, left, getLIRGen().asAllocatable(right)));
            return;
        default:
            throw GraalError.shouldNotReachHere("unexpected kind: " + cmpKind);
    }

    if (isConstantValue(right)) {
        Constant c = LIRValueUtil.asConstant(right);
        if (JavaConstant.isNull(c)) {
            getLIRGen().append(new AMD64BinaryConsumer.Op(TEST, size, left, left));
            return;
        } else if (c instanceof VMConstant) {
            VMConstant vc = (VMConstant) c;
            if (size == DWORD && !GeneratePIC.getValue(getOptions())) {
                getLIRGen().append(new AMD64BinaryConsumer.VMConstOp(CMP.getMIOpcode(DWORD, false), left, vc));
            } else {
                getLIRGen().append(new AMD64BinaryConsumer.DataOp(CMP.getRMOpcode(size), size, left, vc));
            }
            return;
        } else if (c instanceof JavaConstant) {
            JavaConstant jc = (JavaConstant) c;
            if (jc.isDefaultForKind()) {
                AMD64RMOp op = size == BYTE ? TESTB : TEST;
                getLIRGen().append(new AMD64BinaryConsumer.Op(op, size, left, left));
                return;
            } else if (NumUtil.is32bit(jc.asLong())) {
                getLIRGen().append(new AMD64BinaryConsumer.ConstOp(CMP, size, left, (int) jc.asLong()));
                return;
            }
        }
    }

    // fallback: load, then compare
    getLIRGen().append(new AMD64BinaryConsumer.Op(CMP.getRMOpcode(size), size, left, getLIRGen().asAllocatable(right)));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:56,代码来源:AMD64ArithmeticLIRGenerator.java


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