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