native method that calls directly from Java to C, without following the JNI
protocol. This means that there are no artificial additional parameters such as the JNI
environment passed, and no marshaling or processing of arguments (such as creating handles for
objects) is performed. If the method is non-static, the receiver will be ignored.
Parameter types and return types must not be Java reference types, only
primitive Java types, word types and
CEnum types are allowed. The representation of passed primitive values matches exactly
how they are specified in the Java language, for example, int as a 32-bit signed integer
or char as a 16-bit unsigned integer. boolean is specified as a single byte that
corresponds to true if non-zero, and to false if zero. If a Word value is passed
that points to a Java object, no guarantees are taken regarding its integrity as a pointer.
The class containing the annotated method must be annotated with CContext.
Note that this annotation must not be used for native functions that use variadic arguments (varargs) because varargs calling conventions are not supported and even a declaration with a specific non-varargs signature can be incompatible with vararg target functions on some platforms.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | CFunction.
Describes the thread state transition performed when the C function is invoked. |
| Modifier and Type | Method and Description |
|---|---|
| public CFunction. | |
| public String |
| transition | back to summary |
|---|---|
| public CFunction. The Java-to-C thread transition code used when calling the function.
| |
| value | back to summary |
|---|---|
| public String value() The symbol name to use to link this method. If no value is specified, the name of the method (without name mangling or a class name prefix) is used.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final CFunction. | NO_TRANSITION
No prologue and epilogue is emitted. |
| public static final CFunction. | TO_NATIVE
The thread state is transitioned from Java to C, and the Java parts of the stack are made walkable. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CFunction. | |
| public static CFunction. |
| NO_TRANSITION | back to summary |
|---|---|
| public static final CFunction. No prologue and epilogue is emitted. The C code must not block and must not call back to Java. Also, long running C code delays safepoints (and therefore garbage collection) of other threads until the call returns.
| |
| TO_NATIVE | back to summary |
|---|---|
| public static final CFunction. The thread state is transitioned from Java to C, and the Java parts of the stack are made walkable. The C code can block and call back to Java.
| |
| Transition | back to summary |
|---|---|
| private Transition() | |
| valueOf | back to summary |
|---|---|
| public static CFunction. | |
| values | back to summary |
|---|---|
| public static CFunction. | |