@@ -1919,21 +1919,18 @@ public void finish() {
1919
1919
}
1920
1920
}
1921
1921
1922
+ // Note: all the mmap related messages are behind Truffle boundary until GR-29663 is resolved
1923
+
1922
1924
public static final class MMapHandle {
1923
1925
private static final MMapHandle NONE = new MMapHandle (null , 0 );
1924
1926
private SeekableByteChannel channel ;
1925
1927
private final long offset ;
1926
1928
1927
1929
public MMapHandle (SeekableByteChannel channel , long offset ) {
1928
- setChannel ( channel ) ;
1930
+ this . channel = channel ;
1929
1931
this .offset = offset ;
1930
1932
}
1931
1933
1932
- @ TruffleBoundary
1933
- private void setChannel (SeekableByteChannel channel ) {
1934
- // this.channel = channel;
1935
- }
1936
-
1937
1934
@ Override
1938
1935
public String toString () {
1939
1936
CompilerAsserts .neverPartOfCompilation ();
@@ -2005,6 +2002,7 @@ public SeekableByteChannel truncate(long size) throws IOException {
2005
2002
2006
2003
@ ExportMessage
2007
2004
@ SuppressWarnings ("static-method" )
2005
+ @ TruffleBoundary
2008
2006
final MMapHandle mmap (long length , int prot , int flags , int fd , long offset ,
2009
2007
@ Shared ("defaultDirProfile" ) @ Cached ConditionProfile isAnonymousProfile ) throws PosixException {
2010
2008
if (prot == PROT_NONE ) {
@@ -2058,6 +2056,7 @@ private static SeekableByteChannel newByteChannel(TruffleFile file, Set<Standard
2058
2056
2059
2057
@ ExportMessage
2060
2058
@ SuppressWarnings ("static-method" )
2059
+ @ TruffleBoundary
2061
2060
public byte mmapReadByte (Object mmap , long index ,
2062
2061
@ Shared ("errorBranch" ) @ Cached BranchProfile errBranch ) throws PosixException {
2063
2062
if (mmap == MMapHandle .NONE ) {
@@ -2075,6 +2074,7 @@ public byte mmapReadByte(Object mmap, long index,
2075
2074
2076
2075
@ ExportMessage
2077
2076
@ SuppressWarnings ("static-method" )
2077
+ @ TruffleBoundary
2078
2078
public int mmapReadBytes (Object mmap , long index , byte [] bytes , int length ,
2079
2079
@ Shared ("errorBranch" ) @ Cached BranchProfile errBranch ) throws PosixException {
2080
2080
if (mmap == MMapHandle .NONE ) {
@@ -2109,6 +2109,7 @@ private static int readBytes(MMapHandle handle, long index, ByteBuffer readingBu
2109
2109
2110
2110
@ ExportMessage
2111
2111
@ SuppressWarnings ("static-method" )
2112
+ @ TruffleBoundary
2112
2113
public void mmapWriteBytes (Object mmap , long index , byte [] bytes , int length ,
2113
2114
@ Shared ("errorBranch" ) @ Cached BranchProfile errBranch ) throws PosixException {
2114
2115
if (mmap == MMapHandle .NONE ) {
@@ -2131,6 +2132,7 @@ public void mmapWriteBytes(Object mmap, long index, byte[] bytes, int length,
2131
2132
2132
2133
@ ExportMessage
2133
2134
@ SuppressWarnings ({"static-method" , "unused" })
2135
+ @ TruffleBoundary
2134
2136
public void mmapFlush (Object mmap , long offset , long length ) {
2135
2137
// Intentionally noop
2136
2138
// If we had access to the underlying NIO FileChannel, we could explicitly set force(true)
@@ -2141,6 +2143,7 @@ public void mmapFlush(Object mmap, long offset, long length) {
2141
2143
2142
2144
@ ExportMessage
2143
2145
@ SuppressWarnings ("static-method" )
2146
+ @ TruffleBoundary
2144
2147
public void mmapUnmap (Object mmap , @ SuppressWarnings ("unused" ) long length ) throws PosixException {
2145
2148
if (mmap == MMapHandle .NONE ) {
2146
2149
return ;
0 commit comments