use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class SPARCImmediateAddressNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
SPARCLIRGenerator tool = (SPARCLIRGenerator) gen.getLIRGeneratorTool();
AllocatableValue baseValue = tool.asAllocatable(gen.operand(base));
LIRKind kind = tool.getLIRKind(stamp(NodeView.DEFAULT));
AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue);
if (baseReference != null) {
kind = kind.makeDerivedReference(baseReference);
}
gen.setResult(this, new SPARCImmediateAddressValue(kind, baseValue, displacement));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class SPARCIndexedAddressNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
SPARCLIRGenerator tool = (SPARCLIRGenerator) gen.getLIRGeneratorTool();
AllocatableValue baseValue = tool.asAllocatable(gen.operand(base));
AllocatableValue indexValue = tool.asAllocatable(gen.operand(index));
AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue);
AllocatableValue indexReference = LIRKind.derivedBaseFromValue(indexValue);
LIRKind kind = LIRKind.combineDerived(tool.getLIRKind(stamp(NodeView.DEFAULT)), baseReference, indexReference);
gen.setResult(this, new SPARCIndexedAddressValue(kind, baseValue, indexValue));
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class JVMCIInfopointErrorTest method testInvalidShortOop.
@Test(expected = Error.class)
public void testInvalidShortOop() {
test((tool, state, safepoint) -> {
PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
LIRKind lirKind = LIRKind.reference(kind);
Variable var = tool.newVariable(lirKind);
tool.append(new ValueDef(var));
safepoint.accept(state);
tool.append(new ValueUse(var));
});
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class HotSpotReferenceMapBuilder method finish.
@Override
public ReferenceMap finish(LIRFrameState state) {
Location[] objects;
Location[] derivedBase;
int[] sizeInBytes;
if (objectCount == 0) {
objects = NO_LOCATIONS;
derivedBase = NO_LOCATIONS;
sizeInBytes = NO_SIZES;
} else {
objects = new Location[objectCount];
derivedBase = new Location[objectCount];
sizeInBytes = new int[objectCount];
}
int idx = 0;
for (Value obj : objectValues) {
LIRKind kind = (LIRKind) obj.getValueKind();
int bytes = bytesPerElement(kind);
if (kind.isUnknownReference()) {
throw GraalError.shouldNotReachHere(String.format("unknown reference alive across safepoint: %s", obj));
} else {
Location base = null;
if (kind.isDerivedReference()) {
Variable baseVariable = (Variable) kind.getDerivedReferenceBase();
Value baseValue = state.getLiveBasePointers().get(baseVariable.index);
assert baseValue.getPlatformKind().getVectorLength() == 1 && ((LIRKind) baseValue.getValueKind()).isReference(0) && !((LIRKind) baseValue.getValueKind()).isDerivedReference();
base = toLocation(baseValue, 0);
}
for (int i = 0; i < kind.getPlatformKind().getVectorLength(); i++) {
if (kind.isReference(i)) {
assert kind.isCompressedReference(i) ? (bytes < uncompressedReferenceSize) : (bytes == uncompressedReferenceSize);
objects[idx] = toLocation(obj, i * bytes);
derivedBase[idx] = base;
sizeInBytes[idx] = bytes;
idx++;
}
}
}
}
return new HotSpotReferenceMap(objects, derivedBase, sizeInBytes, maxRegisterSize);
}
use of org.graalvm.compiler.core.common.LIRKind in project graal by oracle.
the class FloatingReadNode method generate.
@Override
public void generate(NodeLIRBuilderTool gen) {
LIRKind readKind = gen.getLIRGeneratorTool().getLIRKind(stamp(NodeView.DEFAULT));
gen.setResult(this, gen.getLIRGeneratorTool().getArithmetic().emitLoad(readKind, gen.operand(address), null));
}
Aggregations