Skip to content

Conversation

graalvmbot
Copy link
Collaborator

No description provided.

Elia Trachsel and others added 28 commits August 11, 2025 15:24
… includes:

- Adding projects io.jdk21 and io.jdk25 to cope with internal API changes
- Adding the apporpriate ExtraJavaHomes to CI
- Adding a jdk21 daily job to the CI for testing EspressoLibs on 21
- Introduces LibsMeta to conditionally load meta-data used in EspressoLibs
- For the native methods we generally extract the string name from the guest file and convert this string to a TruffleFile which is than used to implement the semantics
- If in the native mehtod we are given a TrufflePath we can extract TruffleFile from a hidden field.
- NewFileChannelHelper to cope with internal API changes of FileChannelImpl.open
- Introduce a helper class for parsing file attributes
…ello-World:

- For NativeThread substitutions are nops based (among other things) on the nativeBackendId. Thus we moved determining this id from EspressoContext to EspressoLanguage such that we can then use  LanguageFilters for those nops.
- Some methods are just linked agains JVM methods e.g. see ConstantPool
- For other methods we can just use the public java API e.g. see TimeZone
- Continuation is not supported
- Momentarily for off-heap memory we forward native host addresses to the guest: See FileDispatcherImpl
- Introduced some get<Type>Channel methods to eliminate "instanceof blocks" every time we need to use a channel of <Type>
- Introduced a shortcut to directly get the fd given the StaticObject and FdAccess
- Introduced a default FDAccess in LibsUtil
We added an option to disable networking on the user side. Then if we reach networking classes we always check if its enabled from the user and the Truffle side.
Generally we use the host system to implement all networking functionalities by associating a fd with the appropriate channel (eg ServerSocketChannel) in TruffleIO.
Then in the native methods we can use the provided fd to retrieve the corresponding host channel to implement the semantics.
Both implementations are very similar: In the constructor of the Poller/Selector (in the guest code) we generate a handle which in the native world gets associated with a host Selector.
This handle is then always provided to the native methods, where we can easily retrieve the host Selector and implement the semantics.
One of the most notable differences is that for the Poller all events are now one-shot meaning they should only be polled once.
Additionally the EpollPoller sees new registerations in midst the poll operation, whereas the public Selector API does not. We solved that by waking up the Selector after new registerations.
- DirectoryStream implementation by setting a host Iterator and Stream as hidden host reference then proxying all methods to the native world where we retrieve the host object and do the semantics of the function.
- FileDisptacherImpl now has a TruffleDispatcher as a field to avoid code duplication. And generally the substitutions in the dispatcher classes just link against the appropriate methods in TruffleIO.
- ReadV and WriteV implementation by retrieving the underlying direct bytebuffers of the native struct.
- Most of the substitutions just simply link against VM methods.
- Introduction of JNU to store system encodings
This includes:
- Substitutions for "startup" native libraries (libnespresso, libjvm, libjimage). Most of the methods are just nops.
- We needed to add flags to disable signature mangling and enable relaxed type checks in the SubstitutionProcessor for the startup libraries.
- Added isValidFor to the Lib.Factory class to maintain the mixed-no-native-access mode. More specifically for the startup libraries we only substitute in no-native mode.
- Added substitutions for LibManagement
- Substitutions for PlatformSocketOptions to avoid reaching LinuxSocketOptions
Basically just makes EspressoLibs use the newly added NativeMemory interface. Meaning all function that involved off-heap accesses were rewritten.
Additionally the functionality to read and write from certain address in TruffleIO was added.
The substitutions of Unsafe involving off-heap accesses were also adjusted to use NativeMemory.
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants