< prev index next >
src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java
Print this page
@@ -20,13 +20,14 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.code;
-import static jdk.vm.ci.meta.MetaUtil.*;
-
-import jdk.vm.ci.meta.*;
+import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString;
+import jdk.vm.ci.meta.JavaKind;
+import jdk.vm.ci.meta.LIRKind;
+import jdk.vm.ci.meta.PlatformKind;
/**
* Represents the target machine for a compiler, including the CPU architecture, the size of
* pointers and references, alignment of stacks, caches, etc.
*/
@@ -48,13 +49,13 @@
* The machine word size on this target.
*/
public final int wordSize;
/**
- * The kind to be used for representing raw pointers and CPU registers.
+ * The {@link JavaKind} to be used for representing raw pointers and CPU registers in Java code.
*/
- public final JavaKind wordKind;
+ public final JavaKind wordJavaKind;
/**
* The stack alignment requirement of the platform. For example, from Appendix D of <a
* href="http://www.intel.com/Assets/PDF/manual/248966.pdf">Intel 64 and IA-32 Architectures
* Optimization Reference Manual</a>:
@@ -76,14 +77,16 @@
public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) {
this.arch = arch;
this.isMP = isMP;
this.wordSize = arch.getWordSize();
- this.wordKind = JavaKind.fromWordSize(wordSize);
+ this.wordJavaKind = JavaKind.fromWordSize(wordSize);
this.stackAlignment = stackAlignment;
this.implicitNullCheckLimit = implicitNullCheckLimit;
this.inlineObjects = inlineObjects;
+
+ assert arch.getPlatformKind(wordJavaKind).equals(arch.getWordKind());
}
@Override
public final int hashCode() {
throw new UnsupportedOperationException();
@@ -99,11 +102,11 @@
// @formatter:off
if (this.implicitNullCheckLimit == that.implicitNullCheckLimit &&
this.inlineObjects == that.inlineObjects &&
this.isMP == that.isMP &&
this.stackAlignment == that.stackAlignment &&
- this.wordKind.equals(that.wordKind) &&
+ this.wordJavaKind.equals(that.wordJavaKind) &&
this.wordSize == that.wordSize &&
this.arch.equals(that.arch)) {
return true;
}
// @formatter:on
@@ -114,14 +117,10 @@
@Override
public String toString() {
return identityHashCodeString(this);
}
- public int getSizeInBytes(PlatformKind kind) {
- return kind.getSizeInBytes();
- }
-
public LIRKind getLIRKind(JavaKind javaKind) {
PlatformKind platformKind = arch.getPlatformKind(javaKind);
if (javaKind.isObject()) {
return LIRKind.reference(platformKind);
} else {
< prev index next >