StaticConfig(final ID id, final boolean littleEndian, final int[] sizes, final int[] alignments) { this.id = id; int i=0, j=0; this.md = new MachineDescription(false, littleEndian, sizes[i++], sizes[i++], sizes[i++], sizes[i++], sizes[i++], sizes[i++], sizes[i++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++], alignments[j++]); }
private static MachineDescription getRuntimeImpl() { try { Platform.initSingleton(); // loads native gluegen-rt library } catch (final UnsatisfiedLinkError err) { return null; } final int pointerSizeInBytes = getPointerSizeInBytesImpl(); switch(pointerSizeInBytes) { case 4: case 8: break; default: throw new RuntimeException("Unsupported pointer size "+pointerSizeInBytes+"bytes, please implement."); } final long pageSizeL = getPageSizeInBytesImpl(); if(Integer.MAX_VALUE < pageSizeL) { throw new InternalError("PageSize exceeds integer value: " + pageSizeL); } // size: int, long, float, double, pointer, pageSize // alignment: int8, int16, int32, int64, int, long, float, double, pointer return new MachineDescription( true /* runtime validated */, PlatformPropsImpl.LITTLE_ENDIAN, getSizeOfIntImpl(), getSizeOfLongImpl(), getSizeOfFloatImpl(), getSizeOfDoubleImpl(), getSizeOfLongDoubleImpl(), pointerSizeInBytes, (int)pageSizeL, getAlignmentInt8Impl(), getAlignmentInt16Impl(), getAlignmentInt32Impl(), getAlignmentInt64Impl(), getAlignmentIntImpl(), getAlignmentLongImpl(), getAlignmentFloatImpl(), getAlignmentDoubleImpl(), getAlignmentLongDoubleImpl(), getAlignmentPointerImpl()); }