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

src/share/vm/ci/ciObjectFactory.cpp

Print this page




 357   } else if (o->is_constantPoolCache()) {
 358     constantPoolCacheHandle h_cpc(THREAD, (constantPoolCacheOop) o);
 359     return new (arena()) ciCPCache(h_cpc);
 360   }
 361 
 362   // The oop is of some type not supported by the compiler interface.
 363   ShouldNotReachHere();
 364   return NULL;
 365 }
 366 
 367 //------------------------------------------------------------------
 368 // ciObjectFactory::get_unloaded_method
 369 //
 370 // Get the ciMethod representing an unloaded/unfound method.
 371 //
 372 // Implementation note: unloaded methods are currently stored in
 373 // an unordered array, requiring a linear-time lookup for each
 374 // unloaded method.  This may need to change.
 375 ciMethod* ciObjectFactory::get_unloaded_method(ciInstanceKlass* holder,
 376                                                ciSymbol*        name,
 377                                                ciSymbol*        signature) {
 378   for (int i=0; i<_unloaded_methods->length(); i++) {


 379     ciMethod* entry = _unloaded_methods->at(i);
 380     if (entry->holder()->equals(holder) &&
 381         entry->name()->equals(name) &&
 382         entry->signature()->as_symbol()->equals(signature)) {








 383       // We've found a match.
 384       return entry;
 385     }
 386   }


 387 
 388   // This is a new unloaded method.  Create it and stick it in
 389   // the cache.
 390   ciMethod* new_method = new (arena()) ciMethod(holder, name, signature);
 391 
 392   init_ident_of(new_method);
 393   _unloaded_methods->append(new_method);
 394 
 395   return new_method;
 396 }
 397 
 398 //------------------------------------------------------------------
 399 // ciObjectFactory::get_unloaded_klass
 400 //
 401 // Get a ciKlass representing an unloaded klass.
 402 //
 403 // Implementation note: unloaded klasses are currently stored in
 404 // an unordered array, requiring a linear-time lookup for each
 405 // unloaded klass.  This may need to change.
 406 ciKlass* ciObjectFactory::get_unloaded_klass(ciKlass* accessing_klass,
 407                                              ciSymbol* name,
 408                                              bool create_if_not_found) {
 409   EXCEPTION_CONTEXT;
 410   oop loader = NULL;




 357   } else if (o->is_constantPoolCache()) {
 358     constantPoolCacheHandle h_cpc(THREAD, (constantPoolCacheOop) o);
 359     return new (arena()) ciCPCache(h_cpc);
 360   }
 361 
 362   // The oop is of some type not supported by the compiler interface.
 363   ShouldNotReachHere();
 364   return NULL;
 365 }
 366 
 367 //------------------------------------------------------------------
 368 // ciObjectFactory::get_unloaded_method
 369 //
 370 // Get the ciMethod representing an unloaded/unfound method.
 371 //
 372 // Implementation note: unloaded methods are currently stored in
 373 // an unordered array, requiring a linear-time lookup for each
 374 // unloaded method.  This may need to change.
 375 ciMethod* ciObjectFactory::get_unloaded_method(ciInstanceKlass* holder,
 376                                                ciSymbol*        name,
 377                                                ciSymbol*        signature,
 378                                                ciInstanceKlass* accessor) {
 379   ciSignature* that = NULL;
 380   for (int i = 0; i < _unloaded_methods->length(); i++) {
 381     ciMethod* entry = _unloaded_methods->at(i);
 382     if (entry->holder()->equals(holder) &&
 383         entry->name()->equals(name) &&
 384         entry->signature()->as_symbol()->equals(signature)) {
 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       }
 397     }
 398   }
 399 
 400   // This is a new unloaded method.  Create it and stick it in
 401   // the cache.
 402   ciMethod* new_method = new (arena()) ciMethod(holder, name, signature, accessor);
 403 
 404   init_ident_of(new_method);
 405   _unloaded_methods->append(new_method);
 406 
 407   return new_method;
 408 }
 409 
 410 //------------------------------------------------------------------
 411 // ciObjectFactory::get_unloaded_klass
 412 //
 413 // Get a ciKlass representing an unloaded klass.
 414 //
 415 // Implementation note: unloaded klasses are currently stored in
 416 // an unordered array, requiring a linear-time lookup for each
 417 // unloaded klass.  This may need to change.
 418 ciKlass* ciObjectFactory::get_unloaded_klass(ciKlass* accessing_klass,
 419                                              ciSymbol* name,
 420                                              bool create_if_not_found) {
 421   EXCEPTION_CONTEXT;
 422   oop loader = NULL;


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