< prev index next >
src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LIRKind.java
Print this page
*** 20,30 ****
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.meta;
! import java.util.*;
/**
* Represents the type of values in the LIR. It is composed of a {@link PlatformKind} that gives the
* low level representation of the value, and a {@link #referenceMask} that describes the location
* of object references in the value, and optionally a {@link #derivedReferenceBase}.
--- 20,30 ----
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.meta;
! import java.util.ArrayList;
/**
* Represents the type of values in the LIR. It is composed of a {@link PlatformKind} that gives the
* low level representation of the value, and a {@link #referenceMask} that describes the location
* of object references in the value, and optionally a {@link #derivedReferenceBase}.
*** 55,78 ****
* can not track, {@link LIRKind#unknownReference} can be used. In most cases,
* {@link LIRKind#combine} should be used instead, since it is able to detect this automatically.
*/
public final class LIRKind {
/**
* The non-type. This uses {@link #unknownReference}, so it can never be part of an oop map.
*/
! public static final LIRKind Illegal = unknownReference(JavaKind.Illegal);
private final PlatformKind platformKind;
private final int referenceMask;
private AllocatableValue derivedReferenceBase;
private static final int UNKNOWN_REFERENCE = -1;
private LIRKind(PlatformKind platformKind, int referenceMask, AllocatableValue derivedReferenceBase) {
- assert platformKind != JavaKind.Object : "Kind.Object shouldn't be used in the backend";
this.platformKind = platformKind;
this.referenceMask = referenceMask;
this.derivedReferenceBase = derivedReferenceBase;
assert derivedReferenceBase == null || !derivedReferenceBase.getLIRKind().isDerivedReference() : "derived reference can't have another derived reference as base";
--- 55,99 ----
* can not track, {@link LIRKind#unknownReference} can be used. In most cases,
* {@link LIRKind#combine} should be used instead, since it is able to detect this automatically.
*/
public final class LIRKind {
+ private static enum IllegalKind implements PlatformKind {
+ ILLEGAL;
+
+ private final EnumKey<IllegalKind> key = new EnumKey<>(this);
+
+ public Key getKey() {
+ return key;
+ }
+
+ public int getSizeInBytes() {
+ return 0;
+ }
+
+ public int getVectorLength() {
+ return 0;
+ }
+
+ public char getTypeChar() {
+ return '-';
+ }
+ }
+
/**
* The non-type. This uses {@link #unknownReference}, so it can never be part of an oop map.
*/
! public static final LIRKind Illegal = unknownReference(IllegalKind.ILLEGAL);
private final PlatformKind platformKind;
private final int referenceMask;
private AllocatableValue derivedReferenceBase;
private static final int UNKNOWN_REFERENCE = -1;
private LIRKind(PlatformKind platformKind, int referenceMask, AllocatableValue derivedReferenceBase) {
this.platformKind = platformKind;
this.referenceMask = referenceMask;
this.derivedReferenceBase = derivedReferenceBase;
assert derivedReferenceBase == null || !derivedReferenceBase.getLIRKind().isDerivedReference() : "derived reference can't have another derived reference as base";
*** 429,451 ****
public static boolean verifyMoveKinds(LIRKind dst, LIRKind src) {
if (src.equals(dst)) {
return true;
}
! /*
! * TODO(je,rs) What we actually want is toStackKind(src.getPlatformKind()).equals(
! * dst.getPlatformKind()) but due to the handling of sub-integer at the current point
! * (phi-)moves from e.g. integer to short can happen. Therefore we compare stack kinds.
! */
! if (toStackKind(src.getPlatformKind()).equals(toStackKind(dst.getPlatformKind()))) {
return !src.isUnknownReference() || dst.isUnknownReference();
}
return false;
}
-
- private static PlatformKind toStackKind(PlatformKind platformKind) {
- if (platformKind instanceof JavaKind) {
- return ((JavaKind) platformKind).getStackKind();
- }
- return platformKind;
- }
}
--- 450,460 ----
public static boolean verifyMoveKinds(LIRKind dst, LIRKind src) {
if (src.equals(dst)) {
return true;
}
! if (src.getPlatformKind().equals(dst.getPlatformKind())) {
return !src.isUnknownReference() || dst.isUnknownReference();
}
return false;
}
}
< prev index next >