annotate jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java @ 24218:719853999215 jvmci-0.32

Merge with jdk8u141-b15
author Doug Simon <doug.simon@oracle.com>
date Mon, 14 Aug 2017 23:20:38 +0200
parents 9ed5b586018b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
23396
9ed5b586018b Replace LIRKind with abstract base class (JDK-8156942).
Roland Schatz <roland.schatz@oracle.com>
parents: 23345
diff changeset
2 * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22594
diff changeset
23 package jdk.vm.ci.code;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22594
diff changeset
25 import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString;
23396
9ed5b586018b Replace LIRKind with abstract base class (JDK-8156942).
Roland Schatz <roland.schatz@oracle.com>
parents: 23345
diff changeset
26
22672
1bbd4a7c274b Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 22594
diff changeset
27 import jdk.vm.ci.meta.JavaKind;
5504
452f91ebdb54 Moved RiKind to cri.ri package.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5503
diff changeset
28
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6582
diff changeset
30 * Represents the target machine for a compiler, including the CPU architecture, the size of
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6582
diff changeset
31 * pointers and references, alignment of stacks, caches, etc.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 */
22237
e45ce323bdf5 Remove unused class HotSpotTargetDescription.
Roland Schatz <roland.schatz@oracle.com>
parents: 22236
diff changeset
33 public class TargetDescription {
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6582
diff changeset
34
5547
b6617d13ea44 Dropping Ci* prefixes. Some additional renamings in the api.code interface.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5540
diff changeset
35 public final Architecture arch;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 * Specifies if this is a multi-processor system.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40 public final boolean isMP;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 * Specifies if this target supports encoding objects inline in the machine code.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 public final boolean inlineObjects;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 * The machine word size on this target.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 public final int wordSize;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 /**
22567
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
53 * The {@link JavaKind} to be used for representing raw pointers and CPU registers in Java code.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 */
22567
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
55 public final JavaKind wordJavaKind;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 /**
23345
1c4b6a7f1917 update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents: 22672
diff changeset
58 * The stack alignment requirement of the platform. For example, from Appendix D of
1c4b6a7f1917 update to Eclipse 4.5.2 format style
Doug Simon <doug.simon@oracle.com>
parents: 22672
diff changeset
59 * <a href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 6582
diff changeset
60 * Optimization Reference Manual</a>:
16094
c0b8d395368b Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents: 14562
diff changeset
61 *
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 * <pre>
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 * "It is important to ensure that the stack frame is aligned to a
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 * 16-byte boundary upon function entry to keep local __m128 data,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 * parameters, and XMM register spill locations aligned throughout
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 * a function invocation."
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67 * </pre>
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 public final int stackAlignment;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 /**
7646
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
72 * Maximum constant displacement at which a memory access can no longer be an implicit null
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
73 * check.
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
74 */
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
75 public final int implicitNullCheckLimit;
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
76
7841
674a8b9e62f8 Remove unused fields in TargetDescription. Use Unsafe.pageSize().
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7838
diff changeset
77 public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 this.arch = arch;
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 this.isMP = isMP;
6582
cc32ce37eddc deleted Architecture.twoOperandMode() and encapsulated all public fields in Architecture with getters
Doug Simon <doug.simon@oracle.com>
parents: 6488
diff changeset
80 this.wordSize = arch.getWordSize();
22567
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
81 this.wordJavaKind = JavaKind.fromWordSize(wordSize);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 this.stackAlignment = stackAlignment;
7646
16b5195c5f30 Remove more TODOs. Introduce implicitNullCheckLimit as target parameter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7645
diff changeset
83 this.implicitNullCheckLimit = implicitNullCheckLimit;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 this.inlineObjects = inlineObjects;
22567
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
85
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
86 assert arch.getPlatformKind(wordJavaKind).equals(arch.getWordKind());
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87 }
14559
883fbd3e06e0 Make size of PlatformKind overridable by VM specific code.
Roland Schatz <roland.schatz@oracle.com>
parents: 10958
diff changeset
88
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
89 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
90 public final int hashCode() {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
91 throw new UnsupportedOperationException();
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
92 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
93
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
94 @Override
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
95 public final boolean equals(Object obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
96 if (this == obj) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
97 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
98 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
99 if (obj instanceof TargetDescription) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
100 TargetDescription that = (TargetDescription) obj;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
101 // @formatter:off
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
102 if (this.implicitNullCheckLimit == that.implicitNullCheckLimit &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
103 this.inlineObjects == that.inlineObjects &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
104 this.isMP == that.isMP &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
105 this.stackAlignment == that.stackAlignment &&
22567
bfd5fdca1ce9 Clean separation between backend and frontend wordKind.
Roland Schatz <roland.schatz@oracle.com>
parents: 22536
diff changeset
106 this.wordJavaKind.equals(that.wordJavaKind) &&
18342
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
107 this.wordSize == that.wordSize &&
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
108 this.arch.equals(that.arch)) {
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
109 return true;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
110 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
111 // @formatter:on
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
112 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
113 return false;
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
114 }
d60dd21329f2 implemented .equals() for CompilationResult and the objects it encapsulates
Doug Simon <doug.simon@oracle.com>
parents: 16094
diff changeset
115
18499
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
116 @Override
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
117 public String toString() {
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
118 return identityHashCodeString(this);
bd74da0a76f3 implemented toString() for classes that throw UnsupportedError for hashCode()
Doug Simon <doug.simon@oracle.com>
parents: 18342
diff changeset
119 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
120 }