void printSize() { System.out.printf("PrintImageHeapPartitionSizes: partition: %s size: %d%n", name, getSize()); }
assert (getSize() == paddedSize) : String.format("Incorrect sizing: partition: %s getSize(): %d uniqueSize: %d prePad: %d postPad: %d", name, getSize(), uniqueSize, getPrePad(), getPostPad()); final long nonuniqueCount = uniqueCount + canonicalizedCount; final long nonuniqueSize = uniqueSize + canonicalizedSize; getSize(), nonuniqueSize, sizePercent)); histogram.print();
/** * This code assumes that the read-only primitive partition is the first thing in the read-only * section of the image heap, and that the read-only relocatable partition is the last thing in * the read-only section. * * Compare to {@link NativeImageHeap#setReadOnlySection(String, long)} that sets the ordering or * partitions within the read-only section. */ void alignRelocatablePartition(long alignment) { long relocatablePartitionOffset = readOnlyPrimitive.getSize() + readOnlyReference.getSize(); long beforeRelocPadding = NumUtil.roundUp(relocatablePartitionOffset, alignment) - relocatablePartitionOffset; readOnlyPrimitive.addPrePad(beforeRelocPadding); long afterRelocPadding = NumUtil.roundUp(readOnlyRelocatable.getSize(), alignment) - readOnlyRelocatable.getSize(); readOnlyRelocatable.addPostPad(afterRelocPadding); }
long getReadOnlyRelocatablePartitionSize() { return readOnlyRelocatable.getSize(); }
void setWritableSection(final String sectionName, final long sectionOffset) { writablePrimitive.setSection(sectionName, sectionOffset); writableReference.setSection(sectionName, writablePrimitive.offsetInSection(writablePrimitive.getSize())); }
private void addDirectRelocationWithAddend(RelocatableBuffer buffer, int index, DynamicHub target, long objectHeaderBits) { assert !spawnIsolates() || index >= readOnlyRelocatable.offsetInSection() && index < readOnlyRelocatable.offsetInSection(readOnlyRelocatable.getSize()); buffer.addDirectRelocationWithAddend(index, referenceSize(), objectHeaderBits, target); if (firstRelocatablePointerOffsetInSection == -1) { firstRelocatablePointerOffsetInSection = index; } }
private void addDirectRelocationWithoutAddend(RelocatableBuffer buffer, int index, int size, Object target) { assert !spawnIsolates() || index >= readOnlyRelocatable.offsetInSection() && index < readOnlyRelocatable.offsetInSection(readOnlyRelocatable.getSize()); buffer.addDirectRelocationWithoutAddend(index, size, target); if (firstRelocatablePointerOffsetInSection == -1) { firstRelocatablePointerOffsetInSection = index; } }
void setReadOnlySection(final String sectionName, final long sectionOffset) { readOnlyPrimitive.setSection(sectionName, sectionOffset); readOnlyReference.setSection(sectionName, readOnlyPrimitive.offsetInSection(readOnlyPrimitive.getSize())); readOnlyRelocatable.setSection(sectionName, readOnlyReference.offsetInSection(readOnlyReference.getSize())); }