< prev index next >

src/hotspot/share/ci/ciObjectFactory.cpp

Print this page

        

*** 237,247 **** // already been created, it is returned. Otherwise, a new ciObject // is created. ciObject* ciObjectFactory::get(oop key) { ASSERT_IN_VM; ! assert(Universe::heap()->is_in(key), "must be"); NonPermObject* &bucket = find_non_perm(key); if (bucket != NULL) { return bucket->object(); } --- 237,247 ---- // already been created, it is returned. Otherwise, a new ciObject // is created. ciObject* ciObjectFactory::get(oop key) { ASSERT_IN_VM; ! assert(Universe::heap()->is_in_reserved(key), "must be"); NonPermObject* &bucket = find_non_perm(key); if (bucket != NULL) { return bucket->object(); }
*** 250,260 **** // into the cache. Handle keyHandle(Thread::current(), key); ciObject* new_object = create_new_object(keyHandle()); assert(oopDesc::equals(keyHandle(), new_object->get_oop()), "must be properly recorded"); init_ident_of(new_object); ! assert(Universe::heap()->is_in(new_object->get_oop()), "must be"); // Not a perm-space object. insert_non_perm(bucket, keyHandle(), new_object); return new_object; } --- 250,260 ---- // into the cache. Handle keyHandle(Thread::current(), key); ciObject* new_object = create_new_object(keyHandle()); assert(oopDesc::equals(keyHandle(), new_object->get_oop()), "must be properly recorded"); init_ident_of(new_object); ! assert(Universe::heap()->is_in_reserved(new_object->get_oop()), "must be"); // Not a perm-space object. insert_non_perm(bucket, keyHandle(), new_object); return new_object; }
*** 642,652 **** // // Use a small hash table, hashed on the klass of the key. // If there is no entry in the cache corresponding to this oop, return // the null tail of the bucket into which the oop should be inserted. ciObjectFactory::NonPermObject* &ciObjectFactory::find_non_perm(oop key) { ! assert(Universe::heap()->is_in(key), "must be"); ciMetadata* klass = get_metadata(key->klass()); NonPermObject* *bp = &_non_perm_bucket[(unsigned) klass->hash() % NON_PERM_BUCKETS]; for (NonPermObject* p; (p = (*bp)) != NULL; bp = &p->next()) { if (is_equal(p, key)) break; } --- 642,652 ---- // // Use a small hash table, hashed on the klass of the key. // If there is no entry in the cache corresponding to this oop, return // the null tail of the bucket into which the oop should be inserted. ciObjectFactory::NonPermObject* &ciObjectFactory::find_non_perm(oop key) { ! assert(Universe::heap()->is_in_reserved(key), "must be"); ciMetadata* klass = get_metadata(key->klass()); NonPermObject* *bp = &_non_perm_bucket[(unsigned) klass->hash() % NON_PERM_BUCKETS]; for (NonPermObject* p; (p = (*bp)) != NULL; bp = &p->next()) { if (is_equal(p, key)) break; }
*** 670,680 **** // ------------------------------------------------------------------ // ciObjectFactory::insert_non_perm // // Insert a ciObject into the non-perm table. void ciObjectFactory::insert_non_perm(ciObjectFactory::NonPermObject* &where, oop key, ciObject* obj) { ! assert(Universe::heap()->is_in_or_null(key), "must be"); assert(&where != &emptyBucket, "must not try to fill empty bucket"); NonPermObject* p = new (arena()) NonPermObject(where, key, obj); assert(where == p && is_equal(p, key) && p->object() == obj, "entry must match"); assert(find_non_perm(key) == p, "must find the same spot"); ++_non_perm_count; --- 670,680 ---- // ------------------------------------------------------------------ // ciObjectFactory::insert_non_perm // // Insert a ciObject into the non-perm table. void ciObjectFactory::insert_non_perm(ciObjectFactory::NonPermObject* &where, oop key, ciObject* obj) { ! assert(Universe::heap()->is_in_reserved_or_null(key), "must be"); assert(&where != &emptyBucket, "must not try to fill empty bucket"); NonPermObject* p = new (arena()) NonPermObject(where, key, obj); assert(where == p && is_equal(p, key) && p->object() == obj, "entry must match"); assert(find_non_perm(key) == p, "must find the same spot"); ++_non_perm_count;
< prev index next >