Search in sources :

Example 1 with ArithmeticStamp

use of org.graalvm.compiler.core.common.type.ArithmeticStamp in project graal by oracle.

the class ReinterpretNode method evalConst.

private static SerializableConstant evalConst(Stamp stamp, SerializableConstant c) {
    /*
         * We don't care about byte order here. Either would produce the correct result.
         */
    ByteBuffer buffer = ByteBuffer.wrap(new byte[c.getSerializedSize()]).order(ByteOrder.nativeOrder());
    c.serialize(buffer);
    buffer.rewind();
    SerializableConstant ret = ((ArithmeticStamp) stamp).deserialize(buffer);
    assert !buffer.hasRemaining();
    return ret;
}
Also used : ArithmeticStamp(org.graalvm.compiler.core.common.type.ArithmeticStamp) ByteBuffer(java.nio.ByteBuffer) SerializableConstant(jdk.vm.ci.meta.SerializableConstant)

Aggregations

ByteBuffer (java.nio.ByteBuffer)1 SerializableConstant (jdk.vm.ci.meta.SerializableConstant)1 ArithmeticStamp (org.graalvm.compiler.core.common.type.ArithmeticStamp)1