Skip to content

Commit

Permalink
call VM.shutdown during HotSpotGraalRuntime shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed May 18, 2019
1 parent 2c73fc4 commit f52efa0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,16 @@ void shutdown() {
BenchmarkCounters.shutdown(runtime(), optionsRef.get(), runtimeStartTime);

outputDirectory.close();

shutdownLibGraal();
}

/**
* Substituted by
* {@code com.oracle.svm.graal.hotspot.libgraal.Target_org_graalvm_compiler_hotspot_HotSpotGraalRuntime}
* to call {@code org.graalvm.nativeimage.VMRuntime.shutdown()}.
*/
private static void shutdownLibGraal() {
}

void clearMetrics() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
import org.graalvm.nativeimage.VMRuntime;
import org.graalvm.nativeimage.hosted.Feature;
import org.graalvm.nativeimage.hosted.RuntimeReflection;

Expand Down Expand Up @@ -529,6 +530,14 @@ static Object convertUnknownValue(Object object) {
}
}

@TargetClass(className = "org.graalvm.compiler.hotspot.HotSpotGraalRuntime", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
final class Target_org_graalvm_compiler_hotspot_HotSpotGraalRuntime {
@Substitute
private static void shutdownLibGraal() {
VMRuntime.shutdown();
}
}

@TargetClass(className = "org.graalvm.compiler.hotspot.HotSpotGraalOptionValues", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
final class Target_org_graalvm_compiler_hotspot_HotSpotGraalOptionValues {

Expand Down

0 comments on commit f52efa0

Please sign in to comment.