Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @ 23396:9ed5b586018b
Replace LIRKind with abstract base class (JDK-8156942).
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 13 May 2016 14:33:19 +0200 |
parents | 1d4ce2d19e52 |
children | b5557b757040 |
rev | line source |
---|---|
22759 | 1 /* |
23396
9ed5b586018b
Replace LIRKind with abstract base class (JDK-8156942).
Roland Schatz <roland.schatz@oracle.com>
parents:
23393
diff
changeset
|
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
22759 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package jdk.vm.ci.hotspot.aarch64; | |
24 | |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23345
diff
changeset
|
25 import static jdk.vm.ci.common.InitTimer.timer; |
22759 | 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; | |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
23345
diff
changeset
|
34 import jdk.vm.ci.common.InitTimer; |
22759 | 35 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; |
36 import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; | |
37 import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; | |
38 import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; | |
39 import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; | |
40 import jdk.vm.ci.hotspot.HotSpotStackIntrospection; | |
41 import jdk.vm.ci.hotspot.HotSpotVMConfig; | |
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 } | |
65 | |
66 protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { | |
67 return new HotSpotConstantReflectionProvider(runtime); | |
68 } | |
69 | |
70 protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { | |
23396
9ed5b586018b
Replace LIRKind with abstract base class (JDK-8156942).
Roland Schatz <roland.schatz@oracle.com>
parents:
23393
diff
changeset
|
71 return new AArch64HotSpotRegisterConfig(target, runtime.getConfig()); |
22759 | 72 } |
73 | |
74 protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { | |
75 return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); | |
76 } | |
77 | |
78 protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { | |
79 return new HotSpotMetaAccessProvider(runtime); | |
80 } | |
81 | |
82 @Override | |
83 public String getArchitecture() { | |
84 return "aarch64"; | |
85 } | |
86 | |
87 @Override | |
88 public String toString() { | |
89 return "JVMCIBackend:" + getArchitecture(); | |
90 } | |
91 | |
92 @SuppressWarnings("try") | |
93 public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { | |
94 | |
95 assert host == null; | |
96 TargetDescription target = createTarget(runtime.getConfig()); | |
97 | |
98 RegisterConfig regConfig; | |
99 HotSpotCodeCacheProvider codeCache; | |
100 ConstantReflectionProvider constantReflection; | |
101 HotSpotMetaAccessProvider metaAccess; | |
102 StackIntrospection stackIntrospection; | |
103 try (InitTimer t = timer("create providers")) { | |
104 try (InitTimer rt = timer("create MetaAccess provider")) { | |
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 | |
23345
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
125 protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, |
1c4b6a7f1917
update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents:
22761
diff
changeset
|
126 StackIntrospection stackIntrospection) { |
22759 | 127 return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection); |
128 } | |
129 } |