• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /openjdk10/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/

Lines Matching refs:type

23 package org.graalvm.compiler.core.common.type;
29 * This class represents a reference to a Java type and whether this reference is referring only to
30 * the represented type or also to its sub types in the class hierarchy. When creating a type
34 * <li>The reference should always only refer to the given concrete type. Use
37 * reference is exact only when the type is a leaf type (i.e., it cannot have subclasses). Depending
38 * on whether interface types can be trusted for this type reference use
41 * reference is also exact, when there is only a single concrete sub type for the given type.
42 * Depending on whether interface types can be trusted for this type reference use {@link #create}
52 private final ResolvedJavaType type;
55 private TypeReference(ResolvedJavaType type, boolean exactReference) {
56 this.type = type;
61 * Creates an exact type reference using the given type.
63 public static TypeReference createExactTrusted(ResolvedJavaType type) {
64 if (type == null) {
67 return new TypeReference(type, true);
71 * Creates a type reference using the given type without assumptions and without trusting
74 public static TypeReference createWithoutAssumptions(ResolvedJavaType type) {
75 return create(null, type);
79 * Creates a type reference using the given type without assumptions and trusting interface
82 public static TypeReference createTrustedWithoutAssumptions(ResolvedJavaType type) {
83 return createTrusted(null, type);
87 * Creates a type reference using the given type with assumptions and without trusting interface
90 public static TypeReference create(Assumptions assumptions, ResolvedJavaType type) {
91 return createTrusted(assumptions, filterInterfaceTypesOut(type));
95 * Create a type reference using the given type with assumptions and trusting interface types.
97 public static TypeReference createTrusted(Assumptions assumptions, ResolvedJavaType type) {
98 if (type == null) {
101 ResolvedJavaType exactType = type.isLeaf() ? type : null;
103 Assumptions.AssumptionResult<ResolvedJavaType> leafConcreteSubtype = type.findLeafConcreteSubtype();
110 return new TypeReference(type, false);
116 * The type this reference refers to.
119 return type;
123 * @return {@code true} if this reference is exact and only refers to the given type and
137 return new TypeReference(type, true);
140 private static ResolvedJavaType filterInterfaceTypesOut(ResolvedJavaType type) {
141 if (type != null) {
142 if (type.isArray()) {
143 ResolvedJavaType componentType = filterInterfaceTypesOut(type.getComponentType());
148 return type.getSuperclass().getArrayClass();
150 if (type.isInterface()) {
154 return type;
159 return (isExact() ? "#" : "") + type;