void setSection(String name, long offset) { sectionName = name; sectionOffset = offset; assert heap.layout.isAligned(offset) : String.format("Partition: %s: offset: %d in section: %s must be aligned.", this.name, offsetInSection(), getSectionName()); }
long offsetInSection(long offset) { return offsetInSection() + offset; }
/** The start within a native image heap section (e.g., read-only or writable). */ public long getOffsetInSection() { return getPartition().offsetInSection(getOffsetInPartition()); }
void setWritableSection(final String sectionName, final long sectionOffset) { writablePrimitive.setSection(sectionName, sectionOffset); writableReference.setSection(sectionName, writablePrimitive.offsetInSection(writablePrimitive.getSize())); }
long getReadOnlyRelocatablePartitionOffset() { return readOnlyRelocatable.offsetInSection(); }
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())); }