Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/ci/ciObjectFactory.cpp
          +++ new/src/share/vm/ci/ciObjectFactory.cpp
↓ open down ↓ 366 lines elided ↑ open up ↑
 367  367  //------------------------------------------------------------------
 368  368  // ciObjectFactory::get_unloaded_method
 369  369  //
 370  370  // Get the ciMethod representing an unloaded/unfound method.
 371  371  //
 372  372  // Implementation note: unloaded methods are currently stored in
 373  373  // an unordered array, requiring a linear-time lookup for each
 374  374  // unloaded method.  This may need to change.
 375  375  ciMethod* ciObjectFactory::get_unloaded_method(ciInstanceKlass* holder,
 376  376                                                 ciSymbol*        name,
 377      -                                               ciSymbol*        signature) {
 378      -  for (int i=0; i<_unloaded_methods->length(); i++) {
      377 +                                               ciSymbol*        signature,
      378 +                                               ciInstanceKlass* accessor) {
      379 +  ciSignature* that = NULL;
      380 +  for (int i = 0; i < _unloaded_methods->length(); i++) {
 379  381      ciMethod* entry = _unloaded_methods->at(i);
 380  382      if (entry->holder()->equals(holder) &&
 381  383          entry->name()->equals(name) &&
 382  384          entry->signature()->as_symbol()->equals(signature)) {
 383      -      // We've found a match.
 384      -      return entry;
      385 +      // Short-circuit slow resolve.
      386 +      if (entry->signature()->accessing_klass() == accessor) {
      387 +        // We've found a match.
      388 +        return entry;
      389 +      } else {
      390 +        // Lazily create ciSignature
      391 +        if (that == NULL)  that = new (arena()) ciSignature(accessor, constantPoolHandle(), signature);
      392 +        if (entry->signature()->equals(that)) {
      393 +          // We've found a match.
      394 +          return entry;
      395 +        }
      396 +      }
 385  397      }
 386  398    }
 387  399  
 388  400    // This is a new unloaded method.  Create it and stick it in
 389  401    // the cache.
 390      -  ciMethod* new_method = new (arena()) ciMethod(holder, name, signature);
      402 +  ciMethod* new_method = new (arena()) ciMethod(holder, name, signature, accessor);
 391  403  
 392  404    init_ident_of(new_method);
 393  405    _unloaded_methods->append(new_method);
 394  406  
 395  407    return new_method;
 396  408  }
 397  409  
 398  410  //------------------------------------------------------------------
 399  411  // ciObjectFactory::get_unloaded_klass
 400  412  //
↓ open down ↓ 348 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX