1.1 --- a/src/share/vm/ci/ciObjectFactory.cpp Sun Aug 09 17:03:51 2009 -0700 1.2 +++ b/src/share/vm/ci/ciObjectFactory.cpp Tue Aug 11 23:24:41 2009 -0700 1.3 @@ -219,24 +219,27 @@ 1.4 ASSERT_IN_VM; 1.5 1.6 #ifdef ASSERT 1.7 - oop last = NULL; 1.8 - for (int j = 0; j< _ci_objects->length(); j++) { 1.9 - oop o = _ci_objects->at(j)->get_oop(); 1.10 - assert(last < o, "out of order"); 1.11 - last = o; 1.12 + if (CIObjectFactoryVerify) { 1.13 + oop last = NULL; 1.14 + for (int j = 0; j< _ci_objects->length(); j++) { 1.15 + oop o = _ci_objects->at(j)->get_oop(); 1.16 + assert(last < o, "out of order"); 1.17 + last = o; 1.18 + } 1.19 } 1.20 #endif // ASSERT 1.21 int len = _ci_objects->length(); 1.22 int index = find(key, _ci_objects); 1.23 #ifdef ASSERT 1.24 - for (int i=0; i<_ci_objects->length(); i++) { 1.25 - if (_ci_objects->at(i)->get_oop() == key) { 1.26 - assert(index == i, " bad lookup"); 1.27 + if (CIObjectFactoryVerify) { 1.28 + for (int i=0; i<_ci_objects->length(); i++) { 1.29 + if (_ci_objects->at(i)->get_oop() == key) { 1.30 + assert(index == i, " bad lookup"); 1.31 + } 1.32 } 1.33 } 1.34 #endif 1.35 if (!is_found_at(index, key, _ci_objects)) { 1.36 - 1.37 // Check in the non-perm area before putting it in the list. 1.38 NonPermObject* &bucket = find_non_perm(key); 1.39 if (bucket != NULL) { 1.40 @@ -539,11 +542,13 @@ 1.41 objects->at_put(index, obj); 1.42 } 1.43 #ifdef ASSERT 1.44 - oop last = NULL; 1.45 - for (int j = 0; j< objects->length(); j++) { 1.46 - oop o = objects->at(j)->get_oop(); 1.47 - assert(last < o, "out of order"); 1.48 - last = o; 1.49 + if (CIObjectFactoryVerify) { 1.50 + oop last = NULL; 1.51 + for (int j = 0; j< objects->length(); j++) { 1.52 + oop o = objects->at(j)->get_oop(); 1.53 + assert(last < o, "out of order"); 1.54 + last = o; 1.55 + } 1.56 } 1.57 #endif // ASSERT 1.58 }