Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @ 23679:b5557b757040
fix HotSpotVMConfig startup performance (JDK-8159167)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 15 Jun 2016 00:00:41 +0200 |
parents | 9ed5b586018b |
children |
comparison
equal
deleted
inserted
replaced
23678:e86a0b0ba969 | 23679:b5557b757040 |
---|---|
36 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; | 36 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; |
37 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; | 37 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; |
38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; | 38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; |
39 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; | 39 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; |
40 import jdk.vm.ci.hotspot.HotSpotStackIntrospection; | 40 import jdk.vm.ci.hotspot.HotSpotStackIntrospection; |
41 import jdk.vm.ci.hotspot.HotSpotVMConfig; | |
42 import jdk.vm.ci.meta.ConstantReflectionProvider; | 41 import jdk.vm.ci.meta.ConstantReflectionProvider; |
43 import jdk.vm.ci.runtime.JVMCIBackend; | 42 import jdk.vm.ci.runtime.JVMCIBackend; |
44 | 43 |
45 public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { | 44 public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { |
46 | 45 |
47 protected EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) { | 46 protected EnumSet<AArch64.CPUFeature> computeFeatures(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { |
48 // Configure the feature set using the HotSpot flag settings. | 47 // Configure the feature set using the HotSpot flag settings. |
49 EnumSet<AArch64.CPUFeature> features = EnumSet.noneOf(AArch64.CPUFeature.class); | 48 EnumSet<AArch64.CPUFeature> features = EnumSet.noneOf(AArch64.CPUFeature.class); |
50 return features; | 49 return features; |
51 } | 50 } |
52 | 51 |
53 protected EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") HotSpotVMConfig config) { | 52 protected EnumSet<AArch64.Flag> computeFlags(@SuppressWarnings("unused") AArch64HotSpotVMConfig config) { |
54 EnumSet<AArch64.Flag> flags = EnumSet.noneOf(AArch64.Flag.class); | 53 EnumSet<AArch64.Flag> flags = EnumSet.noneOf(AArch64.Flag.class); |
55 return flags; | 54 return flags; |
56 } | 55 } |
57 | 56 |
58 protected TargetDescription createTarget(HotSpotVMConfig config) { | 57 protected TargetDescription createTarget(AArch64HotSpotVMConfig config) { |
59 final int stackFrameAlignment = 16; | 58 final int stackFrameAlignment = 16; |
60 final int implicitNullCheckLimit = 4096; | 59 final int implicitNullCheckLimit = 4096; |
61 final boolean inlineObjects = true; | 60 final boolean inlineObjects = true; |
62 Architecture arch = new AArch64(computeFeatures(config), computeFlags(config)); | 61 Architecture arch = new AArch64(computeFeatures(config), computeFlags(config)); |
63 return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); | 62 return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); |
65 | 64 |
66 protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { | 65 protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { |
67 return new HotSpotConstantReflectionProvider(runtime); | 66 return new HotSpotConstantReflectionProvider(runtime); |
68 } | 67 } |
69 | 68 |
70 protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { | 69 protected RegisterConfig createRegisterConfig(AArch64HotSpotVMConfig config, TargetDescription target) { |
71 return new AArch64HotSpotRegisterConfig(target, runtime.getConfig()); | 70 return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops); |
72 } | 71 } |
73 | 72 |
74 protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { | 73 protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { |
75 return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); | 74 return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); |
76 } | 75 } |
91 | 90 |
92 @SuppressWarnings("try") | 91 @SuppressWarnings("try") |
93 public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { | 92 public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { |
94 | 93 |
95 assert host == null; | 94 assert host == null; |
96 TargetDescription target = createTarget(runtime.getConfig()); | 95 AArch64HotSpotVMConfig config = new AArch64HotSpotVMConfig(runtime.getConfigStore()); |
96 TargetDescription target = createTarget(config); | |
97 | 97 |
98 RegisterConfig regConfig; | 98 RegisterConfig regConfig; |
99 HotSpotCodeCacheProvider codeCache; | 99 HotSpotCodeCacheProvider codeCache; |
100 ConstantReflectionProvider constantReflection; | 100 ConstantReflectionProvider constantReflection; |
101 HotSpotMetaAccessProvider metaAccess; | 101 HotSpotMetaAccessProvider metaAccess; |
103 try (InitTimer t = timer("create providers")) { | 103 try (InitTimer t = timer("create providers")) { |
104 try (InitTimer rt = timer("create MetaAccess provider")) { | 104 try (InitTimer rt = timer("create MetaAccess provider")) { |
105 metaAccess = createMetaAccess(runtime); | 105 metaAccess = createMetaAccess(runtime); |
106 } | 106 } |
107 try (InitTimer rt = timer("create RegisterConfig")) { | 107 try (InitTimer rt = timer("create RegisterConfig")) { |
108 regConfig = createRegisterConfig(runtime, target); | 108 regConfig = createRegisterConfig(config, target); |
109 } | 109 } |
110 try (InitTimer rt = timer("create CodeCache provider")) { | 110 try (InitTimer rt = timer("create CodeCache provider")) { |
111 codeCache = createCodeCache(runtime, target, regConfig); | 111 codeCache = createCodeCache(runtime, target, regConfig); |
112 } | 112 } |
113 try (InitTimer rt = timer("create ConstantReflection provider")) { | 113 try (InitTimer rt = timer("create ConstantReflection provider")) { |