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 @@ -32,7 +32,6 @@
import org.graalvm.nativeimage.c.function.CLibrary;
import org.graalvm.word.UnsignedWord;

import com.oracle.svm.core.SubstrateOptions;
import com.oracle.svm.core.util.BasedOnJDKFile;

/**
Expand Down Expand Up @@ -89,7 +88,7 @@
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+8/src/hotspot/share/runtime/globals.hpp")
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+5/src/hotspot/share/utilities/debug.cpp")
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+5/src/hotspot/share/utilities/debug.hpp")
class ContainerLibrary {
public class ContainerLibrary {
static final int VERSION = 240100;

// keep in sync with svm_container.hpp
Expand Down Expand Up @@ -142,14 +141,9 @@ class ContainerLibrary {
class ContainerLibraryDirectives implements CContext.Directives {
/**
* True if {@link ContainerLibrary} should be linked.
*
* Note that although this method returns {@code true} only for certain GCs, the
* {@link CFunction}s defined in {@link ContainerLibrary} are always registered and can be
* called even if this method returns {@code false}, as other GCs provide alternative
* implementations themselves.
*/
@Override
public boolean isInConfiguration() {
return Container.isSupported() && (SubstrateOptions.useSerialGC() || SubstrateOptions.useEpsilonGC());
return Container.isSupported();
}
}
10 changes: 8 additions & 2 deletions substratevm/src/com.oracle.svm.native.libcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ To help keeping the `@BasedOnJDKFile` annotations up to date, the
`mx gate --tags check_libcontainer_annotations` command ensures that the actual files and
annotations are in sync.

To do a full reimport, replace the files in [`src/hotspot`](./src/hotspot) with those from the OpenJDK.
To do a full reimport, first remove the C++-namespace from the source code using the
[`removeNamespace.py`](./scripts/removeNamespace.py)-script, in order to minimize the diff to the files
from the OpenJDK. Execute it like `python ./scripts/removeNamespace.py -n svm_container -d ./src`.
Then commit these changes, otherwise the namespace will still show in the diff later.
Then replace the files in [`src/hotspot`](./src/hotspot) with those from the OpenJDK.
The `mx reimport-libcontainer-files --jdk-repo path/to/jdk` can help with that. Then reapply all the
changes (`#ifdef` guards) using the diff tool of your choice. Then, adopt the files in
[`src/svm`](./src/svm) to provide new functionality, if needed. Finally, update the `@BasedOnJDKFile`
[`src/svm`](./src/svm) to provide new functionality, if needed. Then, update the `@BasedOnJDKFile`
annotations in `ContainerLibrary.java` to reflect the import revision.
Finally, add the C++-namespace back to the source code using the [`addNamespace.py`](./scripts/addNamespace.py)
script. Execute it like `python ./scripts/addNamespace.py -n svm_container -d ./src`.

## Local Testing

Expand Down
Loading