Mercurial > hg > graal-compiler
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 17446:9a804ec7f707
converted Constant and Value to be interfaces (GRAAL-874)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 15 Oct 2014 01:10:27 +0200 |
parents | 44b83285b645 |
children | f55f2d400797 |
comparison
equal
deleted
inserted
replaced
17445:8cc283ce4bd1 | 17446:9a804ec7f707 |
---|---|
175 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectType.klass()). | 175 // Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectType.klass()). |
176 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) { | 176 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) { |
177 if (constant->is_a(HotSpotMetaspaceConstant::klass())) { | 177 if (constant->is_a(HotSpotMetaspaceConstant::klass())) { |
178 oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant); | 178 oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant); |
179 jlong prim = HotSpotMetaspaceConstant::primitive(constant); | 179 jlong prim = HotSpotMetaspaceConstant::primitive(constant); |
180 assert(Kind::typeChar(Constant::kind(constant)) == 'j', "must have word kind"); | 180 assert(Kind::typeChar(AbstractConstant::kind(constant)) == 'j', "must have word kind"); |
181 assert(obj != NULL, "must have an object"); | 181 assert(obj != NULL, "must have an object"); |
182 assert(prim != 0, "must have a primitive value"); | 182 assert(prim != 0, "must have a primitive value"); |
183 | 183 |
184 record_metadata_reference(obj, prim, false, oop_recorder); | 184 record_metadata_reference(obj, prim, false, oop_recorder); |
185 } | 185 } |
193 second = NULL; | 193 second = NULL; |
194 if (value == Value::ILLEGAL()) { | 194 if (value == Value::ILLEGAL()) { |
195 return new LocationValue(Location::new_stk_loc(Location::invalid, 0)); | 195 return new LocationValue(Location::new_stk_loc(Location::invalid, 0)); |
196 } | 196 } |
197 | 197 |
198 oop lirKind = Value::lirKind(value); | 198 oop lirKind = AbstractValue::lirKind(value); |
199 oop platformKind = LIRKind::platformKind(lirKind); | 199 oop platformKind = LIRKind::platformKind(lirKind); |
200 jint referenceMask = LIRKind::referenceMask(lirKind); | 200 jint referenceMask = LIRKind::referenceMask(lirKind); |
201 assert(referenceMask == 0 || referenceMask == 1, "unexpected referenceMask"); | 201 assert(referenceMask == 0 || referenceMask == 1, "unexpected referenceMask"); |
202 bool reference = referenceMask == 1; | 202 bool reference = referenceMask == 1; |
203 | 203 |
272 ScopeValue* value = new LocationValue(Location::new_stk_loc(locationType, offset)); | 272 ScopeValue* value = new LocationValue(Location::new_stk_loc(locationType, offset)); |
273 if (type == T_DOUBLE || (type == T_LONG && !reference)) { | 273 if (type == T_DOUBLE || (type == T_LONG && !reference)) { |
274 second = value; | 274 second = value; |
275 } | 275 } |
276 return value; | 276 return value; |
277 } else if (value->is_a(Constant::klass())){ | 277 } else if (value->is_a(AbstractConstant::klass())){ |
278 record_metadata_in_constant(value, oop_recorder); | 278 record_metadata_in_constant(value, oop_recorder); |
279 if (value->is_a(PrimitiveConstant::klass())) { | 279 if (value->is_a(PrimitiveConstant::klass())) { |
280 assert(!reference, "unexpected primitive constant type"); | 280 assert(!reference, "unexpected primitive constant type"); |
281 if(value->is_a(RawConstant::klass())) { | 281 if(value->is_a(RawConstant::klass())) { |
282 jlong prim = PrimitiveConstant::primitive(value); | 282 jlong prim = PrimitiveConstant::primitive(value); |