comparison src/share/vm/oops/constantPool.cpp @ 12288:a7609ec351d6

Merge
author dcubed
date Fri, 20 Sep 2013 18:19:07 -0700
parents 7c29904fdfa2 b2e698d2276c
children 084b21cd0228
comparison
equal deleted inserted replaced
12286:df03413ad1a9 12288:a7609ec351d6
384 } 384 }
385 385
386 386
387 Klass* ConstantPool::klass_ref_at_if_loaded(constantPoolHandle this_oop, int which) { 387 Klass* ConstantPool::klass_ref_at_if_loaded(constantPoolHandle this_oop, int which) {
388 return klass_at_if_loaded(this_oop, this_oop->klass_ref_index_at(which)); 388 return klass_at_if_loaded(this_oop, this_oop->klass_ref_index_at(which));
389 }
390
391
392 // This is an interface for the compiler that allows accessing non-resolved entries
393 // in the constant pool - but still performs the validations tests. Must be used
394 // in a pre-parse of the compiler - to determine what it can do and not do.
395 // Note: We cannot update the ConstantPool from the vm_thread.
396 Klass* ConstantPool::klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int index, TRAPS) {
397 int which = this_oop->klass_ref_index_at(index);
398 CPSlot entry = this_oop->slot_at(which);
399 if (entry.is_resolved()) {
400 assert(entry.get_klass()->is_klass(), "must be");
401 return entry.get_klass();
402 } else {
403 assert(entry.is_unresolved(), "must be either symbol or klass");
404 Symbol* name = entry.get_symbol();
405 oop loader = this_oop->pool_holder()->class_loader();
406 oop protection_domain = this_oop->pool_holder()->protection_domain();
407 Handle h_loader(THREAD, loader);
408 Handle h_prot (THREAD, protection_domain);
409 KlassHandle k(THREAD, SystemDictionary::find(name, h_loader, h_prot, THREAD));
410
411 // Do access check for klasses
412 if( k.not_null() ) verify_constant_pool_resolve(this_oop, k, CHECK_NULL);
413 return k();
414 }
415 } 389 }
416 390
417 391
418 Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool, 392 Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool,
419 int which) { 393 int which) {