Skip to content

Use Espresso instead of the Java Virtual Machine. How to parse native methods? #8283

Answered by gilles-duboscq
tcmot asked this question in General
Discussion options

You must be logged in to vote

For this specific one, there is an espresso-specific "substitution".
You can see it in Target_java_lang_System.java. When a substituted method is called, espresso will run the code of the substitution in the host jvm.

In general though, for native methods, espresso supports JNI and will load and link to native libraries like any other jvm implementation. Espresso can use Truffle NFI or Sulong for loading the native libraries. When using NFI, it'll call the native code in the usual way. If you have a version of the library with bitcode, it can be executed by Sulong.

You can check out the NativeAccess interface an its implementations.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tcmot
Comment options

@tcmot
Comment options

@gilles-duboscq
Comment options

@tcmot
Comment options

Answer selected by tcmot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants