src/share/vm/ci/ciObjectFactory.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/ci/ciObjectFactory.cpp	Wed Oct 12 04:37:42 2011
--- new/src/share/vm/ci/ciObjectFactory.cpp	Wed Oct 12 04:37:41 2011

*** 372,395 **** --- 372,407 ---- // Implementation note: unloaded methods are currently stored in // an unordered array, requiring a linear-time lookup for each // unloaded method. This may need to change. ciMethod* ciObjectFactory::get_unloaded_method(ciInstanceKlass* holder, ciSymbol* name, ! ciSymbol* signature) { ! for (int i=0; i<_unloaded_methods->length(); i++) { ! ciSymbol* signature, ! ciInstanceKlass* accessor) { + ciSignature* that = NULL; + for (int i = 0; i < _unloaded_methods->length(); i++) { ciMethod* entry = _unloaded_methods->at(i); if (entry->holder()->equals(holder) && entry->name()->equals(name) && entry->signature()->as_symbol()->equals(signature)) { + // Short-circuit slow resolve. + if (entry->signature()->accessing_klass() == accessor) { + // We've found a match. + return entry; + } else { + // Lazily create ciSignature + if (that == NULL) that = new (arena()) ciSignature(accessor, constantPoolHandle(), signature); + if (entry->signature()->equals(that)) { // We've found a match. return entry; } } + } + } // This is a new unloaded method. Create it and stick it in // the cache. ! ciMethod* new_method = new (arena()) ciMethod(holder, name, signature, accessor); init_ident_of(new_method); _unloaded_methods->append(new_method); return new_method;

src/share/vm/ci/ciObjectFactory.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File