Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCompiler.cpp @ 10770:4e6d6122c558
solaris-fastdebug build fixes.
author | twisti |
---|---|
date | Thu, 11 Jul 2013 10:31:16 -0700 |
parents | e7d07c9bb779 |
children | e1309fc4d17f |
comparison
equal
deleted
inserted
replaced
10710:cd28ead65a53 | 10770:4e6d6122c558 |
---|---|
201 // If the field is a pointer type, get the klass of the | 201 // If the field is a pointer type, get the klass of the |
202 // field. | 202 // field. |
203 if (field_type == T_OBJECT || field_type == T_ARRAY) { | 203 if (field_type == T_OBJECT || field_type == T_ARRAY) { |
204 KlassHandle handle = GraalEnv::get_klass_by_name(loading_klass, signature, false); | 204 KlassHandle handle = GraalEnv::get_klass_by_name(loading_klass, signature, false); |
205 if (handle.is_null()) { | 205 if (handle.is_null()) { |
206 return get_JavaType(signature, CHECK_NULL); | 206 return get_JavaType(signature, CHECK_NH); |
207 } else { | 207 } else { |
208 return get_JavaType(handle, CHECK_NULL); | 208 return get_JavaType(handle, CHECK_NH); |
209 } | 209 } |
210 } else { | 210 } else { |
211 return VMToCompiler::createPrimitiveJavaType(field_type, CHECK_NULL); | 211 return VMToCompiler::createPrimitiveJavaType(field_type, CHECK_NH); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 Handle GraalCompiler::get_JavaType(constantPoolHandle cp, int index, KlassHandle loading_klass, TRAPS) { | 215 Handle GraalCompiler::get_JavaType(constantPoolHandle cp, int index, KlassHandle loading_klass, TRAPS) { |
216 bool is_accessible = false; | 216 bool is_accessible = false; |
227 ObjectLocker ol(cplock, THREAD, cplock != NULL); | 227 ObjectLocker ol(cplock, THREAD, cplock != NULL); |
228 constantTag tag = cp->tag_at(index); | 228 constantTag tag = cp->tag_at(index); |
229 if (tag.is_klass()) { | 229 if (tag.is_klass()) { |
230 // The klass has been inserted into the constant pool | 230 // The klass has been inserted into the constant pool |
231 // very recently. | 231 // very recently. |
232 return GraalCompiler::get_JavaType(cp->resolved_klass_at(index), CHECK_NULL); | 232 return GraalCompiler::get_JavaType(cp->resolved_klass_at(index), CHECK_NH); |
233 } else if (tag.is_symbol()) { | 233 } else if (tag.is_symbol()) { |
234 klass_name = cp->symbol_at(index); | 234 klass_name = cp->symbol_at(index); |
235 } else { | 235 } else { |
236 assert(cp->tag_at(index).is_unresolved_klass(), "wrong tag"); | 236 assert(cp->tag_at(index).is_unresolved_klass(), "wrong tag"); |
237 klass_name = cp->unresolved_klass_at(index); | 237 klass_name = cp->unresolved_klass_at(index); |
238 } | 238 } |
239 } | 239 } |
240 return GraalCompiler::get_JavaType(klass_name, CHECK_NULL); | 240 return GraalCompiler::get_JavaType(klass_name, CHECK_NH); |
241 } else { | 241 } else { |
242 return GraalCompiler::get_JavaType(klass, CHECK_NULL); | 242 return GraalCompiler::get_JavaType(klass, CHECK_NH); |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
246 Handle GraalCompiler::get_JavaTypeFromClass(Handle java_class, TRAPS) { | 246 Handle GraalCompiler::get_JavaTypeFromClass(Handle java_class, TRAPS) { |
247 oop graal_mirror = java_lang_Class::graal_mirror(java_class()); | 247 oop graal_mirror = java_lang_Class::graal_mirror(java_class()); |
252 if (java_lang_Class::is_primitive(java_class())) { | 252 if (java_lang_Class::is_primitive(java_class())) { |
253 BasicType basicType = java_lang_Class::primitive_type(java_class()); | 253 BasicType basicType = java_lang_Class::primitive_type(java_class()); |
254 return VMToCompiler::createPrimitiveJavaType((int) basicType, THREAD); | 254 return VMToCompiler::createPrimitiveJavaType((int) basicType, THREAD); |
255 } else { | 255 } else { |
256 KlassHandle klass = java_lang_Class::as_Klass(java_class()); | 256 KlassHandle klass = java_lang_Class::as_Klass(java_class()); |
257 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL); | 257 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NH); |
258 return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NULL); | 258 return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NH); |
259 } | 259 } |
260 } | 260 } |
261 | 261 |
262 Handle GraalCompiler::get_JavaType(KlassHandle klass, TRAPS) { | 262 Handle GraalCompiler::get_JavaType(KlassHandle klass, TRAPS) { |
263 Handle name = java_lang_String::create_from_symbol(klass->name(), THREAD); | 263 Handle name = java_lang_String::create_from_symbol(klass->name(), THREAD); |
264 return createHotSpotResolvedObjectType(klass, name, CHECK_NULL); | 264 return createHotSpotResolvedObjectType(klass, name, CHECK_NH); |
265 } | 265 } |
266 | 266 |
267 Handle GraalCompiler::get_JavaField(int offset, int flags, Symbol* field_name, Handle field_holder, Handle field_type, TRAPS) { | 267 Handle GraalCompiler::get_JavaField(int offset, int flags, Symbol* field_name, Handle field_holder, Handle field_type, TRAPS) { |
268 Handle name = java_lang_String::create_from_symbol(field_name, CHECK_NULL); | 268 Handle name = java_lang_String::create_from_symbol(field_name, CHECK_NH); |
269 return VMToCompiler::createJavaField(field_holder, name, field_type, offset, flags, false, CHECK_NULL); | 269 return VMToCompiler::createJavaField(field_holder, name, field_type, offset, flags, false, CHECK_NH); |
270 } | 270 } |
271 | 271 |
272 Handle GraalCompiler::createHotSpotResolvedObjectType(methodHandle method, TRAPS) { | 272 Handle GraalCompiler::createHotSpotResolvedObjectType(methodHandle method, TRAPS) { |
273 KlassHandle klass = method->method_holder(); | 273 KlassHandle klass = method->method_holder(); |
274 oop java_class = klass->java_mirror(); | 274 oop java_class = klass->java_mirror(); |
275 oop graal_mirror = java_lang_Class::graal_mirror(java_class); | 275 oop graal_mirror = java_lang_Class::graal_mirror(java_class); |
276 if (graal_mirror != NULL) { | 276 if (graal_mirror != NULL) { |
277 assert(graal_mirror->is_a(HotSpotResolvedObjectType::klass()), "unexpected class..."); | 277 assert(graal_mirror->is_a(HotSpotResolvedObjectType::klass()), "unexpected class..."); |
278 return graal_mirror; | 278 return graal_mirror; |
279 } | 279 } |
280 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL); | 280 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NH); |
281 return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NULL); | 281 return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NH); |
282 } | 282 } |
283 | 283 |
284 Handle GraalCompiler::createHotSpotResolvedObjectType(KlassHandle klass, Handle name, TRAPS) { | 284 Handle GraalCompiler::createHotSpotResolvedObjectType(KlassHandle klass, Handle name, TRAPS) { |
285 oop java_class = klass->java_mirror(); | 285 oop java_class = klass->java_mirror(); |
286 oop graal_mirror = java_lang_Class::graal_mirror(java_class); | 286 oop graal_mirror = java_lang_Class::graal_mirror(java_class); |
291 | 291 |
292 Handle simpleName = name; | 292 Handle simpleName = name; |
293 if (klass->oop_is_instance()) { | 293 if (klass->oop_is_instance()) { |
294 ResourceMark rm; | 294 ResourceMark rm; |
295 InstanceKlass* ik = (InstanceKlass*) klass(); | 295 InstanceKlass* ik = (InstanceKlass*) klass(); |
296 name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NULL); | 296 name = java_lang_String::create_from_str(ik->signature_name(), CHECK_NH); |
297 } | 297 } |
298 | 298 |
299 int sizeOrSpecies; | 299 int sizeOrSpecies; |
300 if (klass->is_interface()) { | 300 if (klass->is_interface()) { |
301 sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedObjectType.INTERFACE_SPECIES_VALUE | 301 sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedObjectType.INTERFACE_SPECIES_VALUE |
306 if (!InstanceKlass::cast(klass())->can_be_fastpath_allocated()) { | 306 if (!InstanceKlass::cast(klass())->can_be_fastpath_allocated()) { |
307 sizeOrSpecies = -sizeOrSpecies; | 307 sizeOrSpecies = -sizeOrSpecies; |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 return VMToCompiler::createResolvedJavaType(klass(), name, simpleName, java_class, sizeOrSpecies, CHECK_NULL); | 311 return VMToCompiler::createResolvedJavaType(klass(), name, simpleName, java_class, sizeOrSpecies, CHECK_NH); |
312 } | 312 } |
313 | 313 |
314 BasicType GraalCompiler::kindToBasicType(jchar ch) { | 314 BasicType GraalCompiler::kindToBasicType(jchar ch) { |
315 switch(ch) { | 315 switch(ch) { |
316 case 'z': return T_BOOLEAN; | 316 case 'z': return T_BOOLEAN; |