src/share/vm/oops/constantPoolOop.cpp

changeset 2982
ddd894528dbc
parent 2742
ed69575596ac
child 3156
f08d439fab8c
     1.1 --- a/src/share/vm/oops/constantPoolOop.cpp	Wed Jun 22 14:45:37 2011 -0700
     1.2 +++ b/src/share/vm/oops/constantPoolOop.cpp	Thu Jun 23 17:14:06 2011 -0700
     1.3 @@ -266,6 +266,29 @@
     1.4  }
     1.5  
     1.6  
     1.7 +methodOop constantPoolOopDesc::method_at_if_loaded(constantPoolHandle cpool,
     1.8 +                                                   int which, Bytecodes::Code invoke_code) {
     1.9 +  assert(!constantPoolCacheOopDesc::is_secondary_index(which), "no indy instruction here");
    1.10 +  if (cpool->cache() == NULL)  return false;  // nothing to load yet
    1.11 +  int cache_index = which - CPCACHE_INDEX_TAG;
    1.12 +  if (!(cache_index >= 0 && cache_index < cpool->cache()->length())) {
    1.13 +    if (PrintMiscellaneous && (Verbose||WizardMode)) {
    1.14 +      tty->print_cr("bad operand %d for %d in:", which, invoke_code); cpool->print();
    1.15 +    }
    1.16 +    return NULL;
    1.17 +  }
    1.18 +  ConstantPoolCacheEntry* e = cpool->cache()->entry_at(cache_index);
    1.19 +  if (invoke_code != Bytecodes::_illegal)
    1.20 +    return e->get_method_if_resolved(invoke_code, cpool);
    1.21 +  Bytecodes::Code bc;
    1.22 +  if ((bc = e->bytecode_1()) != (Bytecodes::Code)0)
    1.23 +    return e->get_method_if_resolved(bc, cpool);
    1.24 +  if ((bc = e->bytecode_2()) != (Bytecodes::Code)0)
    1.25 +    return e->get_method_if_resolved(bc, cpool);
    1.26 +  return NULL;
    1.27 +}
    1.28 +
    1.29 +
    1.30  Symbol* constantPoolOopDesc::impl_name_ref_at(int which, bool uncached) {
    1.31    int name_index = name_ref_index_at(impl_name_and_type_ref_index_at(which, uncached));
    1.32    return symbol_at(name_index);

mercurial