Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2306,7 +2306,6 @@ public Object mmap(Node inliningTarget, long length, int prot, int flags, int fd
}

@Override
@TruffleBoundary
@SuppressWarnings("static-method")
public byte mmapReadByte(Object mmap, long index) {
MMapHandle handle = (MMapHandle) mmap;
Expand All @@ -2318,7 +2317,6 @@ public byte mmapReadByte(Object mmap, long index) {
}

@Override
@TruffleBoundary
@SuppressWarnings("static-method")
public void mmapWriteByte(Object mmap, long index, byte value) {
MMapHandle handle = (MMapHandle) mmap;
Expand All @@ -2327,7 +2325,6 @@ public void mmapWriteByte(Object mmap, long index, byte value) {
}

@Override
@TruffleBoundary
@SuppressWarnings("static-method")
public int mmapReadBytes(Object mmap, long index, byte[] bytes, int length) {
MMapHandle handle = (MMapHandle) mmap;
Expand All @@ -2337,7 +2334,6 @@ public int mmapReadBytes(Object mmap, long index, byte[] bytes, int length) {
}

@Override
@TruffleBoundary
@SuppressWarnings("static-method")
public void mmapWriteBytes(Object mmap, long index, byte[] bytes, int length) {
MMapHandle handle = (MMapHandle) mmap;
Expand Down Expand Up @@ -2368,7 +2364,6 @@ public void mmapUnmap(Object mmap, long length) throws PosixException {
}

@Override
@TruffleBoundary
@SuppressWarnings("static-method")
public long mmapGetPointer(Object mmap) {
MMapHandle handle = (MMapHandle) mmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public abstract class PosixSupport {
* warnings. After devirtualization, partial evaluation sees the concrete implementation, which
* needs its own annotation because method annotations are not inherited. TruffleString
* conversions that benefit from partial evaluation belong in PosixSupportNodes, outside these
* boundaries.
* boundaries. The mmap memory access methods are an exception: the native backend performs
* direct memory accesses that must remain visible to partial evaluation.
*/

public static final int ST_MODE = 0;
Expand Down Expand Up @@ -932,16 +933,14 @@ public abstract int forkExec(Object[] executables, Object[] args, Object cwd, Ob
@TruffleBoundary
public abstract Object mmap(Node location, long length, int prot, int flags, int fd, long offset, Object tagname) throws PosixException;

@TruffleBoundary
// Keep memory accesses and pointer extraction visible to partial evaluation in the native
// backend and its pre-initialization wrapper. Other backends may still use boundaries.
public abstract byte mmapReadByte(Object mmap, long index) throws PosixException;

@TruffleBoundary
public abstract void mmapWriteByte(Object mmap, long index, byte value) throws PosixException;

@TruffleBoundary
public abstract int mmapReadBytes(Object mmap, long index, byte[] bytes, int length) throws PosixException;

@TruffleBoundary
public abstract void mmapWriteBytes(Object mmap, long index, byte[] bytes, int length) throws PosixException;

@TruffleBoundary
Expand All @@ -950,7 +949,6 @@ public abstract int forkExec(Object[] executables, Object[] args, Object cwd, Ob
@TruffleBoundary
public abstract void mmapUnmap(Object mmap, long length) throws PosixException;

@TruffleBoundary
public abstract long mmapGetPointer(Object mmap) throws UnsupportedPosixFeatureException;

@TruffleBoundary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,28 +907,24 @@ public final Object mmap(Node location, long length, int prot, int flags, int fd
}

@Override
@TruffleBoundary
public final byte mmapReadByte(Object mmap, long index) throws PosixException {
checkNotInPreInitialization();
return nativePosixSupport.mmapReadByte(mmap, index);
}

@Override
@TruffleBoundary
public final void mmapWriteByte(Object mmap, long index, byte value) throws PosixException {
checkNotInPreInitialization();
nativePosixSupport.mmapWriteByte(mmap, index, value);
}

@Override
@TruffleBoundary
public final int mmapReadBytes(Object mmap, long index, byte[] bytes, int length) throws PosixException {
checkNotInPreInitialization();
return nativePosixSupport.mmapReadBytes(mmap, index, bytes, length);
}

@Override
@TruffleBoundary
public final void mmapWriteBytes(Object mmap, long index, byte[] bytes, int length) throws PosixException {
checkNotInPreInitialization();
nativePosixSupport.mmapWriteBytes(mmap, index, bytes, length);
Expand All @@ -949,7 +945,6 @@ public final void mmapUnmap(Object mmap, long length) throws PosixException {
}

@Override
@TruffleBoundary
public final long mmapGetPointer(Object mmap) throws UnsupportedPosixFeatureException {
checkNotInPreInitialization();
return nativePosixSupport.mmapGetPointer(mmap);
Expand Down
Loading