comparison src/share/vm/ci/ciEnv.cpp @ 1338:f5dd08ad65df

6932480: Fix crash in CompilerThread/Parser. Unloaded array klass? Summary: Restore code deleted in 6626217 Reviewed-by: asaha, kevinw
author acorn
date Mon, 15 Mar 2010 15:51:36 -0400
parents 0c3f888b7636
children 09ac706c2623
comparison
equal deleted inserted replaced
1337:3d531bbe5917 1338:f5dd08ad65df
366 KILL_COMPILE_ON_FATAL_(fail_type)); 366 KILL_COMPILE_ON_FATAL_(fail_type));
367 } else { 367 } else {
368 found_klass = 368 found_klass =
369 SystemDictionary::find_instance_or_array_klass(sym, loader, domain, 369 SystemDictionary::find_instance_or_array_klass(sym, loader, domain,
370 KILL_COMPILE_ON_FATAL_(fail_type)); 370 KILL_COMPILE_ON_FATAL_(fail_type));
371 }
372
373 // If we fail to find an array klass, look again for its element type.
374 // The element type may be available either locally or via constraints.
375 // In either case, if we can find the element type in the system dictionary,
376 // we must build an array type around it. The CI requires array klasses
377 // to be loaded if their element klasses are loaded, except when memory
378 // is exhausted.
379 if (sym->byte_at(0) == '[' &&
380 (sym->byte_at(1) == '[' || sym->byte_at(1) == 'L')) {
381 // We have an unloaded array.
382 // Build it on the fly if the element class exists.
383 symbolOop elem_sym = oopFactory::new_symbol(sym->as_utf8()+1,
384 sym->utf8_length()-1,
385 KILL_COMPILE_ON_FATAL_(fail_type));
386 // Get element ciKlass recursively.
387 ciKlass* elem_klass =
388 get_klass_by_name_impl(accessing_klass,
389 get_object(elem_sym)->as_symbol(),
390 require_local);
391 if (elem_klass != NULL && elem_klass->is_loaded()) {
392 // Now make an array for it
393 return ciObjArrayKlass::make_impl(elem_klass);
394 }
371 } 395 }
372 396
373 if (found_klass != NULL) { 397 if (found_klass != NULL) {
374 // Found it. Build a CI handle. 398 // Found it. Build a CI handle.
375 return get_object(found_klass)->as_klass(); 399 return get_object(found_klass)->as_klass();