105 }
106 } else {
107 if (JavaConstant.NULL_POINTER.equals(c)) {
108 return KLASS_ALWAYS_NULL;
109 }
110 }
111
112 assert c instanceof HotSpotMetaspaceConstant;
113 assert ((HotSpotMetaspaceConstant) c).isCompressed() == isCompressed();
114 if (nonNull()) {
115 return this;
116 }
117 if (isCompressed()) {
118 return new KlassPointerStamp(true, false, encoding);
119 } else {
120 return KLASS_NON_NULL;
121 }
122 }
123
124 @Override
125 public Constant asConstant() {
126 if (alwaysNull() && isCompressed()) {
127 return HotSpotCompressedNullConstant.COMPRESSED_NULL;
128 } else {
129 return super.asConstant();
130 }
131 }
132
133 @Override
134 public LIRKind getLIRKind(LIRKindTool tool) {
135 if (isCompressed()) {
136 return tool.getNarrowPointerKind();
137 } else {
138 return super.getLIRKind(tool);
139 }
140 }
141
142 public boolean isCompressed() {
143 return encoding != null;
144 }
145
146 public CompressEncoding getEncoding() {
147 return encoding;
148 }
149
|
105 }
106 } else {
107 if (JavaConstant.NULL_POINTER.equals(c)) {
108 return KLASS_ALWAYS_NULL;
109 }
110 }
111
112 assert c instanceof HotSpotMetaspaceConstant;
113 assert ((HotSpotMetaspaceConstant) c).isCompressed() == isCompressed();
114 if (nonNull()) {
115 return this;
116 }
117 if (isCompressed()) {
118 return new KlassPointerStamp(true, false, encoding);
119 } else {
120 return KLASS_NON_NULL;
121 }
122 }
123
124 @Override
125 public JavaConstant nullConstant() {
126 if (isCompressed()) {
127 return HotSpotCompressedNullConstant.COMPRESSED_NULL;
128 } else {
129 return super.nullConstant();
130 }
131 }
132
133 @Override
134 public LIRKind getLIRKind(LIRKindTool tool) {
135 if (isCompressed()) {
136 return tool.getNarrowPointerKind();
137 } else {
138 return super.getLIRKind(tool);
139 }
140 }
141
142 public boolean isCompressed() {
143 return encoding != null;
144 }
145
146 public CompressEncoding getEncoding() {
147 return encoding;
148 }
149
|