Mercurial > hg > truffle
comparison src/share/vm/ci/ciObjectFactory.cpp @ 909:b32a809aab08
6866585: debug code in ciObjectFactory too slow for large objects
Reviewed-by: ysr, never, kvn
author | jcoomes |
---|---|
date | Tue, 11 Aug 2009 23:24:41 -0700 |
parents | d1605aabd0a1 |
children | 89e0543e1737 148e5441d916 |
comparison
equal
deleted
inserted
replaced
908:b1773b9a2ca1 | 909:b32a809aab08 |
---|---|
217 // is created. | 217 // is created. |
218 ciObject* ciObjectFactory::get(oop key) { | 218 ciObject* ciObjectFactory::get(oop key) { |
219 ASSERT_IN_VM; | 219 ASSERT_IN_VM; |
220 | 220 |
221 #ifdef ASSERT | 221 #ifdef ASSERT |
222 oop last = NULL; | 222 if (CIObjectFactoryVerify) { |
223 for (int j = 0; j< _ci_objects->length(); j++) { | 223 oop last = NULL; |
224 oop o = _ci_objects->at(j)->get_oop(); | 224 for (int j = 0; j< _ci_objects->length(); j++) { |
225 assert(last < o, "out of order"); | 225 oop o = _ci_objects->at(j)->get_oop(); |
226 last = o; | 226 assert(last < o, "out of order"); |
227 last = o; | |
228 } | |
227 } | 229 } |
228 #endif // ASSERT | 230 #endif // ASSERT |
229 int len = _ci_objects->length(); | 231 int len = _ci_objects->length(); |
230 int index = find(key, _ci_objects); | 232 int index = find(key, _ci_objects); |
231 #ifdef ASSERT | 233 #ifdef ASSERT |
232 for (int i=0; i<_ci_objects->length(); i++) { | 234 if (CIObjectFactoryVerify) { |
233 if (_ci_objects->at(i)->get_oop() == key) { | 235 for (int i=0; i<_ci_objects->length(); i++) { |
234 assert(index == i, " bad lookup"); | 236 if (_ci_objects->at(i)->get_oop() == key) { |
237 assert(index == i, " bad lookup"); | |
238 } | |
235 } | 239 } |
236 } | 240 } |
237 #endif | 241 #endif |
238 if (!is_found_at(index, key, _ci_objects)) { | 242 if (!is_found_at(index, key, _ci_objects)) { |
239 | |
240 // Check in the non-perm area before putting it in the list. | 243 // Check in the non-perm area before putting it in the list. |
241 NonPermObject* &bucket = find_non_perm(key); | 244 NonPermObject* &bucket = find_non_perm(key); |
242 if (bucket != NULL) { | 245 if (bucket != NULL) { |
243 return bucket->object(); | 246 return bucket->object(); |
244 } | 247 } |
537 objects->at_put(pos+1,objects->at(pos)); | 540 objects->at_put(pos+1,objects->at(pos)); |
538 } | 541 } |
539 objects->at_put(index, obj); | 542 objects->at_put(index, obj); |
540 } | 543 } |
541 #ifdef ASSERT | 544 #ifdef ASSERT |
542 oop last = NULL; | 545 if (CIObjectFactoryVerify) { |
543 for (int j = 0; j< objects->length(); j++) { | 546 oop last = NULL; |
544 oop o = objects->at(j)->get_oop(); | 547 for (int j = 0; j< objects->length(); j++) { |
545 assert(last < o, "out of order"); | 548 oop o = objects->at(j)->get_oop(); |
546 last = o; | 549 assert(last < o, "out of order"); |
550 last = o; | |
551 } | |
547 } | 552 } |
548 #endif // ASSERT | 553 #endif // ASSERT |
549 } | 554 } |
550 | 555 |
551 static ciObjectFactory::NonPermObject* emptyBucket = NULL; | 556 static ciObjectFactory::NonPermObject* emptyBucket = NULL; |