24
25 import static jdk.vm.ci.inittimer.InitTimer.timer;
26
27 import java.util.EnumSet;
28
29 import jdk.vm.ci.aarch64.AArch64;
30 import jdk.vm.ci.code.Architecture;
31 import jdk.vm.ci.code.RegisterConfig;
32 import jdk.vm.ci.code.TargetDescription;
33 import jdk.vm.ci.code.stack.StackIntrospection;
34 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
35 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
36 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
37 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
38 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider;
39 import jdk.vm.ci.hotspot.HotSpotStackIntrospection;
40 import jdk.vm.ci.hotspot.HotSpotVMConfig;
41 import jdk.vm.ci.inittimer.InitTimer;
42 import jdk.vm.ci.meta.ConstantReflectionProvider;
43 import jdk.vm.ci.runtime.JVMCIBackend;
44 import jdk.vm.ci.service.ServiceProvider;
45
46 @ServiceProvider(HotSpotJVMCIBackendFactory.class)
47 public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
48
49 protected EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) {
50 // Configure the feature set using the HotSpot flag settings.
51 EnumSet<AArch64.CPUFeature> features = EnumSet.noneOf(AArch64.CPUFeature.class);
52 return features;
53 }
54
55 protected EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") HotSpotVMConfig config) {
56 EnumSet<AArch64.Flag> flags = EnumSet.noneOf(AArch64.Flag.class);
57 return flags;
58 }
59
60 protected TargetDescription createTarget(HotSpotVMConfig config) {
61 final int stackFrameAlignment = 16;
62 final int implicitNullCheckLimit = 4096;
63 final boolean inlineObjects = true;
64 Architecture arch = new AArch64(computeFeatures(config), computeFlags(config));
65 return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
66 }
107 metaAccess = createMetaAccess(runtime);
108 }
109 try (InitTimer rt = timer("create RegisterConfig")) {
110 regConfig = createRegisterConfig(runtime, target);
111 }
112 try (InitTimer rt = timer("create CodeCache provider")) {
113 codeCache = createCodeCache(runtime, target, regConfig);
114 }
115 try (InitTimer rt = timer("create ConstantReflection provider")) {
116 constantReflection = createConstantReflection(runtime);
117 }
118 try (InitTimer rt = timer("create StackIntrospection provider")) {
119 stackIntrospection = new HotSpotStackIntrospection(runtime);
120 }
121 }
122 try (InitTimer rt = timer("instantiate backend")) {
123 return createBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
124 }
125 }
126
127 protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection,
128 StackIntrospection stackIntrospection) {
129 return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
130 }
131 }
|
24
25 import static jdk.vm.ci.inittimer.InitTimer.timer;
26
27 import java.util.EnumSet;
28
29 import jdk.vm.ci.aarch64.AArch64;
30 import jdk.vm.ci.code.Architecture;
31 import jdk.vm.ci.code.RegisterConfig;
32 import jdk.vm.ci.code.TargetDescription;
33 import jdk.vm.ci.code.stack.StackIntrospection;
34 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
35 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
36 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
37 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
38 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider;
39 import jdk.vm.ci.hotspot.HotSpotStackIntrospection;
40 import jdk.vm.ci.hotspot.HotSpotVMConfig;
41 import jdk.vm.ci.inittimer.InitTimer;
42 import jdk.vm.ci.meta.ConstantReflectionProvider;
43 import jdk.vm.ci.runtime.JVMCIBackend;
44
45 public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory {
46
47 protected EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) {
48 // Configure the feature set using the HotSpot flag settings.
49 EnumSet<AArch64.CPUFeature> features = EnumSet.noneOf(AArch64.CPUFeature.class);
50 return features;
51 }
52
53 protected EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") HotSpotVMConfig config) {
54 EnumSet<AArch64.Flag> flags = EnumSet.noneOf(AArch64.Flag.class);
55 return flags;
56 }
57
58 protected TargetDescription createTarget(HotSpotVMConfig config) {
59 final int stackFrameAlignment = 16;
60 final int implicitNullCheckLimit = 4096;
61 final boolean inlineObjects = true;
62 Architecture arch = new AArch64(computeFeatures(config), computeFlags(config));
63 return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects);
64 }
105 metaAccess = createMetaAccess(runtime);
106 }
107 try (InitTimer rt = timer("create RegisterConfig")) {
108 regConfig = createRegisterConfig(runtime, target);
109 }
110 try (InitTimer rt = timer("create CodeCache provider")) {
111 codeCache = createCodeCache(runtime, target, regConfig);
112 }
113 try (InitTimer rt = timer("create ConstantReflection provider")) {
114 constantReflection = createConstantReflection(runtime);
115 }
116 try (InitTimer rt = timer("create StackIntrospection provider")) {
117 stackIntrospection = new HotSpotStackIntrospection(runtime);
118 }
119 }
120 try (InitTimer rt = timer("instantiate backend")) {
121 return createBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
122 }
123 }
124
125 protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, StackIntrospection stackIntrospection) {
126 return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection);
127 }
128 }
|