383 }
384 if (resolved_klass->is_instance_klass()) {
385 return (Reflection::verify_class_access(accessing_klass->get_Klass(),
386 InstanceKlass::cast(resolved_klass),
387 true) == Reflection::ACCESS_OK);
388 }
389 return true;
390 }
391
392 // ------------------------------------------------------------------
393 // ciEnv::get_klass_by_name_impl
394 ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
395 const constantPoolHandle& cpool,
396 ciSymbol* name,
397 bool require_local) {
398 ASSERT_IN_VM;
399 EXCEPTION_CONTEXT;
400
401 // Now we need to check the SystemDictionary
402 Symbol* sym = name->get_symbol();
403 if ((sym->char_at(0) == 'L' || sym->char_at(0) == 'Q') &&
404 sym->char_at(sym->utf8_length()-1) == ';') {
405 // This is a name from a signature. Strip off the trimmings.
406 // Call recursive to keep scope of strippedsym.
407 TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
408 sym->utf8_length()-2,
409 KILL_COMPILE_ON_FATAL_(_unloaded_ciinstance_klass));
410 ciSymbol* strippedname = get_symbol(strippedsym);
411 return get_klass_by_name_impl(accessing_klass, cpool, strippedname, require_local);
412 }
413
414 // Check for prior unloaded klass. The SystemDictionary's answers
415 // can vary over time but the compiler needs consistency.
416 ciKlass* unloaded_klass = check_get_unloaded_klass(accessing_klass, name);
417 if (unloaded_klass != NULL) {
418 if (require_local) return NULL;
419 return unloaded_klass;
420 }
421
422 Handle loader(THREAD, (oop)NULL);
423 Handle domain(THREAD, (oop)NULL);
424 if (accessing_klass != NULL) {
|
383 }
384 if (resolved_klass->is_instance_klass()) {
385 return (Reflection::verify_class_access(accessing_klass->get_Klass(),
386 InstanceKlass::cast(resolved_klass),
387 true) == Reflection::ACCESS_OK);
388 }
389 return true;
390 }
391
392 // ------------------------------------------------------------------
393 // ciEnv::get_klass_by_name_impl
394 ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
395 const constantPoolHandle& cpool,
396 ciSymbol* name,
397 bool require_local) {
398 ASSERT_IN_VM;
399 EXCEPTION_CONTEXT;
400
401 // Now we need to check the SystemDictionary
402 Symbol* sym = name->get_symbol();
403 if ((sym->starts_with('L') || sym->starts_with('Q')) &&
404 sym->ends_with(';')) {
405 // This is a name from a signature. Strip off the trimmings.
406 // Call recursive to keep scope of strippedsym.
407 TempNewSymbol strippedsym = SymbolTable::new_symbol(sym->as_utf8()+1,
408 sym->utf8_length()-2,
409 KILL_COMPILE_ON_FATAL_(_unloaded_ciinstance_klass));
410 ciSymbol* strippedname = get_symbol(strippedsym);
411 return get_klass_by_name_impl(accessing_klass, cpool, strippedname, require_local);
412 }
413
414 // Check for prior unloaded klass. The SystemDictionary's answers
415 // can vary over time but the compiler needs consistency.
416 ciKlass* unloaded_klass = check_get_unloaded_klass(accessing_klass, name);
417 if (unloaded_klass != NULL) {
418 if (require_local) return NULL;
419 return unloaded_klass;
420 }
421
422 Handle loader(THREAD, (oop)NULL);
423 Handle domain(THREAD, (oop)NULL);
424 if (accessing_klass != NULL) {
|