Skip to content

Commit

Permalink
[GR-15334] Rename libgraal classes to LibGraal.
Browse files Browse the repository at this point in the history
PullRequest: graal/3684
  • Loading branch information
dougxc committed May 27, 2019
2 parents 9f28168 + 08cd8d3 commit 4e5857a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def deploy_native_image_maven_plugin(svmVersion, repo, gpg, keyid):
'compiler:GRAAL_TRUFFLE_COMPILER_LIBGRAAL'
],
build_args=[
'--features=com.oracle.svm.graal.hotspot.libgraal.HotSpotGraalLibraryFeature',
'--features=com.oracle.svm.graal.hotspot.libgraal.LibGraalFeature',
'--initialize-at-build-time',
'-H:-UseServiceLoaderFeature',
'-H:+AllowFoldMethods',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private static synchronized OptionValues decodeOptions(long address, int size, i

@SuppressWarnings({"unused"})
@CEntryPoint(name = "Java_org_graalvm_libgraal_LibGraal_setCurrentThreadName")
@CEntryPointOptions(include = HotSpotGraalLibraryFeature.IsEnabled.class)
@CEntryPointOptions(include = LibGraalFeature.IsEnabled.class)
private static void setCurrentThreadName(PointerBase jniEnv,
PointerBase jclass,
@CEntryPoint.IsolateThreadContext long isolateThread,
Expand Down Expand Up @@ -144,7 +144,7 @@ private static void setCurrentThreadName(PointerBase jniEnv,
*/
@SuppressWarnings({"unused", "try"})
@CEntryPoint(name = "Java_org_graalvm_compiler_hotspot_test_CompileTheWorld_compileMethodInLibgraal")
@CEntryPointOptions(include = HotSpotGraalLibraryFeature.IsEnabled.class)
@CEntryPointOptions(include = LibGraalFeature.IsEnabled.class)
private static long compileMethod(PointerBase jniEnv,
PointerBase jclass,
@CEntryPoint.IsolateThreadContext long isolateThread,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;

public final class HotSpotGraalLibraryFeature implements com.oracle.svm.core.graal.GraalFeature {
public final class LibGraalFeature implements com.oracle.svm.core.graal.GraalFeature {

private HotSpotReplacementsImpl hotSpotSubstrateReplacements;

Expand All @@ -130,7 +130,7 @@ public List<Class<? extends Feature>> getRequiredFeatures() {
public static final class IsEnabled implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return ImageSingletons.contains(HotSpotGraalLibraryFeature.class);
return ImageSingletons.contains(LibGraalFeature.class);
}
}

Expand Down Expand Up @@ -525,22 +525,22 @@ static HotSpotReplacementsImpl getReplacements() {

}

@TargetClass(className = "jdk.vm.ci.hotspot.SharedLibraryJVMCIReflection", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(className = "jdk.vm.ci.hotspot.SharedLibraryJVMCIReflection", onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_jdk_vm_ci_hotspot_SharedLibraryJVMCIReflection {

@Substitute
static Annotation[] getClassAnnotations(String className) {
return ImageSingletons.lookup(HotSpotGraalLibraryFeature.MethodAnnotationSupport.class).getClassAnnotations(className);
return ImageSingletons.lookup(LibGraalFeature.MethodAnnotationSupport.class).getClassAnnotations(className);
}

@Substitute
static Annotation[][] getParameterAnnotations(String className, String methodName) {
return ImageSingletons.lookup(HotSpotGraalLibraryFeature.MethodAnnotationSupport.class).getParameterAnnotations(className, methodName);
return ImageSingletons.lookup(LibGraalFeature.MethodAnnotationSupport.class).getParameterAnnotations(className, methodName);
}

@Substitute
static Annotation[] getMethodAnnotationsInternal(ResolvedJavaMethod javaMethod) {
return ImageSingletons.lookup(HotSpotGraalLibraryFeature.MethodAnnotationSupport.class).getMethodAnnotations(javaMethod);
return ImageSingletons.lookup(LibGraalFeature.MethodAnnotationSupport.class).getMethodAnnotations(javaMethod);
}

@Substitute
Expand All @@ -549,15 +549,15 @@ static Object convertUnknownValue(Object object) {
}
}

@TargetClass(className = "org.graalvm.compiler.hotspot.HotSpotGraalRuntime", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(className = "org.graalvm.compiler.hotspot.HotSpotGraalRuntime", onlyWith = LibGraalFeature.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)
@TargetClass(className = "org.graalvm.compiler.hotspot.HotSpotGraalOptionValues", onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_org_graalvm_compiler_hotspot_HotSpotGraalOptionValues {

@Substitute
Expand Down Expand Up @@ -611,15 +611,15 @@ private static OptionValues initializeOptions() {
* This field resetting must be done via substitutions instead of {@link NativeImageReinitialize} as
* the fields must only be reset in a libgraal image.
*/
@TargetClass(className = "org.graalvm.compiler.truffle.common.TruffleCompilerRuntimeInstance", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(className = "org.graalvm.compiler.truffle.common.TruffleCompilerRuntimeInstance", onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_org_graalvm_compiler_truffle_common_TruffleCompilerRuntimeInstance {
// Checkstyle: stop
@Alias @RecomputeFieldValue(kind = Kind.Reset, isFinal = true) static Object TRUFFLE_RUNTIME;
// Checkstyle: resume
@Alias @RecomputeFieldValue(kind = Kind.Reset) static TruffleCompilerRuntime truffleCompilerRuntime;
}

@TargetClass(className = "org.graalvm.compiler.core.GraalServiceThread", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(className = "org.graalvm.compiler.core.GraalServiceThread", onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_org_graalvm_compiler_core_GraalServiceThread {
@Substitute()
void beforeRun() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
import jdk.vm.ci.services.Services;

/** Dummy class to have a class with the file's name. Do not remove. */
public final class HotSpotGraalSubstitutions {
public final class LibGraalSubstitutions {
// Dummy
}

@TargetClass(value = Services.class, onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(value = Services.class, onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_jdk_vm_ci_services_Services {
// Checkstyle: stop
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.FromAlias, isFinal = true)//
public static boolean IS_IN_NATIVE_IMAGE = true;
// Checkstyle: resume
}

@TargetClass(className = "jdk.vm.ci.hotspot.HotSpotJDKReflection", onlyWith = HotSpotGraalLibraryFeature.IsEnabled.class)
@TargetClass(className = "jdk.vm.ci.hotspot.HotSpotJDKReflection", onlyWith = LibGraalFeature.IsEnabled.class)
final class Target_jdk_vm_ci_hotspot_HotSpotJDKReflection {

@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.None)//
Expand Down

0 comments on commit 4e5857a

Please sign in to comment.