use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.
the class SPARCHotSpotLIRGenerator method emitCompare.
@Override
protected boolean emitCompare(SPARCKind cmpKind, Value a, Value b) {
Value localA = a;
Value localB = b;
if (isConstantValue(a)) {
Constant c = asConstant(a);
if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
localA = SPARC.g0.asValue(LIRKind.value(WORD));
} else if (c instanceof HotSpotObjectConstant) {
localA = load(localA);
}
}
if (isConstantValue(b)) {
Constant c = asConstant(b);
if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) {
localB = SPARC.g0.asValue(LIRKind.value(WORD));
} else if (c instanceof HotSpotObjectConstant) {
localB = load(localB);
}
}
return super.emitCompare(cmpKind, localA, localB);
}
use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.
the class AMD64HotSpotLIRGenerator method emitLoadObjectAddress.
@Override
public Value emitLoadObjectAddress(Constant constant) {
HotSpotObjectConstant objectConstant = (HotSpotObjectConstant) constant;
LIRKind kind = objectConstant.isCompressed() ? getLIRKindTool().getNarrowOopKind() : getLIRKindTool().getObjectKind();
Variable result = newVariable(kind);
append(new AMD64HotSpotLoadAddressOp(result, constant, HotSpotConstantLoadAction.RESOLVE));
return result;
}
use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.
the class AArch64HotSpotLIRGenerator method emitCompareBranch.
@Override
public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, double trueDestinationProbability) {
Value localX = x;
Value localY = y;
if (localX instanceof HotSpotObjectConstant) {
localX = load(localX);
}
if (localY instanceof HotSpotObjectConstant) {
localY = load(localY);
}
super.emitCompareBranch(cmpKind, localX, localY, cond, unorderedIsTrue, trueDestination, falseDestination, trueDestinationProbability);
}
use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.
the class CallSiteTargetNode method tryFold.
public static ConstantNode tryFold(ValueNode callSite, MetaAccessProvider metaAccess, Assumptions assumptions) {
if (callSite != null && callSite.isConstant() && !callSite.isNullConstant()) {
HotSpotObjectConstant c = (HotSpotObjectConstant) callSite.asConstant();
JavaConstant target = c.getCallSiteTarget(assumptions);
if (target != null) {
return ConstantNode.forConstant(target, metaAccess);
}
}
return null;
}
use of jdk.vm.ci.hotspot.HotSpotObjectConstant in project graal by oracle.
the class IdentityHashCodeNode method canonical.
@Override
public Node canonical(CanonicalizerTool tool) {
if (object.isConstant()) {
assert object.stamp(NodeView.DEFAULT) instanceof AbstractObjectStamp;
JavaConstant c = (JavaConstant) object.asConstant();
if (ImmutableCode.getValue(tool.getOptions())) {
return this;
}
JavaConstant identityHashCode = null;
if (c.isNull()) {
identityHashCode = JavaConstant.forInt(0);
} else {
identityHashCode = JavaConstant.forInt(((HotSpotObjectConstant) c).getIdentityHashCode());
}
return new ConstantNode(identityHashCode, StampFactory.forConstant(identityHashCode));
}
return this;
}
Aggregations