Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/constantPool.cpp @ 12264:b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
Summary: Enhance method resolution and resulting data structures, plus some refactoring.
Reviewed-by: twisti, acorn, jrose
author | drchase |
---|---|
date | Fri, 13 Sep 2013 22:38:02 -0400 |
parents | e0c9a1d29eb4 |
children | a7609ec351d6 |
comparison
equal
deleted
inserted
replaced
12261:2c98370f2611 | 12264:b2e698d2276c |
---|---|
391 } | 391 } |
392 | 392 |
393 | 393 |
394 Klass* ConstantPool::klass_ref_at_if_loaded(constantPoolHandle this_oop, int which) { | 394 Klass* ConstantPool::klass_ref_at_if_loaded(constantPoolHandle this_oop, int which) { |
395 return klass_at_if_loaded(this_oop, this_oop->klass_ref_index_at(which)); | 395 return klass_at_if_loaded(this_oop, this_oop->klass_ref_index_at(which)); |
396 } | |
397 | |
398 | |
399 // This is an interface for the compiler that allows accessing non-resolved entries | |
400 // in the constant pool - but still performs the validations tests. Must be used | |
401 // in a pre-parse of the compiler - to determine what it can do and not do. | |
402 // Note: We cannot update the ConstantPool from the vm_thread. | |
403 Klass* ConstantPool::klass_ref_at_if_loaded_check(constantPoolHandle this_oop, int index, TRAPS) { | |
404 int which = this_oop->klass_ref_index_at(index); | |
405 CPSlot entry = this_oop->slot_at(which); | |
406 if (entry.is_resolved()) { | |
407 assert(entry.get_klass()->is_klass(), "must be"); | |
408 return entry.get_klass(); | |
409 } else { | |
410 assert(entry.is_unresolved(), "must be either symbol or klass"); | |
411 Symbol* name = entry.get_symbol(); | |
412 oop loader = this_oop->pool_holder()->class_loader(); | |
413 oop protection_domain = this_oop->pool_holder()->protection_domain(); | |
414 Handle h_loader(THREAD, loader); | |
415 Handle h_prot (THREAD, protection_domain); | |
416 KlassHandle k(THREAD, SystemDictionary::find(name, h_loader, h_prot, THREAD)); | |
417 | |
418 // Do access check for klasses | |
419 if( k.not_null() ) verify_constant_pool_resolve(this_oop, k, CHECK_NULL); | |
420 return k(); | |
421 } | |
422 } | 396 } |
423 | 397 |
424 | 398 |
425 Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool, | 399 Method* ConstantPool::method_at_if_loaded(constantPoolHandle cpool, |
426 int which) { | 400 int which) { |