< prev index next >

src/share/vm/ci/ciObjectFactory.cpp

Print this page




 225 void ciObjectFactory::remove_symbols() {
 226   for (int i = 0; i < _symbols->length(); i++) {
 227     ciSymbol* s = _symbols->at(i);
 228     s->get_symbol()->decrement_refcount();
 229   }
 230   // Since _symbols is resource allocated we're not allowed to delete it
 231   // but it'll go away just the same.
 232 }
 233 
 234 // ------------------------------------------------------------------
 235 // ciObjectFactory::get
 236 //
 237 // Get the ciObject corresponding to some oop.  If the ciObject has
 238 // already been created, it is returned.  Otherwise, a new ciObject
 239 // is created.
 240 ciObject* ciObjectFactory::get(oop key) {
 241   ASSERT_IN_VM;
 242 
 243   assert(Universe::heap()->is_in_reserved(key), "must be");
 244 




 245   NonPermObject* &bucket = find_non_perm(key);
 246   if (bucket != NULL) {
 247     return bucket->object();
 248   }
 249 
 250   // The ciObject does not yet exist.  Create it and insert it
 251   // into the cache.
 252   Handle keyHandle(key);
 253   ciObject* new_object = create_new_object(keyHandle());
 254   assert(keyHandle() == new_object->get_oop(), "must be properly recorded");
 255   init_ident_of(new_object);
 256   assert(Universe::heap()->is_in_reserved(new_object->get_oop()), "must be");
 257 
 258   // Not a perm-space object.
 259   insert_non_perm(bucket, keyHandle(), new_object);
 260   return new_object;
 261 }
 262 
 263 // ------------------------------------------------------------------
 264 // ciObjectFactory::get_metadata




 225 void ciObjectFactory::remove_symbols() {
 226   for (int i = 0; i < _symbols->length(); i++) {
 227     ciSymbol* s = _symbols->at(i);
 228     s->get_symbol()->decrement_refcount();
 229   }
 230   // Since _symbols is resource allocated we're not allowed to delete it
 231   // but it'll go away just the same.
 232 }
 233 
 234 // ------------------------------------------------------------------
 235 // ciObjectFactory::get
 236 //
 237 // Get the ciObject corresponding to some oop.  If the ciObject has
 238 // already been created, it is returned.  Otherwise, a new ciObject
 239 // is created.
 240 ciObject* ciObjectFactory::get(oop key) {
 241   ASSERT_IN_VM;
 242 
 243   assert(Universe::heap()->is_in_reserved(key), "must be");
 244 
 245   // In Shenandoah we need to make sure that nobody forwards the key elsewhere
 246   // under our hood.
 247   key = oopDesc::bs()->write_barrier(key);
 248 
 249   NonPermObject* &bucket = find_non_perm(key);
 250   if (bucket != NULL) {
 251     return bucket->object();
 252   }
 253 
 254   // The ciObject does not yet exist.  Create it and insert it
 255   // into the cache.
 256   Handle keyHandle(key);
 257   ciObject* new_object = create_new_object(keyHandle());
 258   assert(keyHandle() == new_object->get_oop(), "must be properly recorded");
 259   init_ident_of(new_object);
 260   assert(Universe::heap()->is_in_reserved(new_object->get_oop()), "must be");
 261 
 262   // Not a perm-space object.
 263   insert_non_perm(bucket, keyHandle(), new_object);
 264   return new_object;
 265 }
 266 
 267 // ------------------------------------------------------------------
 268 // ciObjectFactory::get_metadata


< prev index next >