提交 6bb3e708 编写于 作者: J jcoomes

6866585: debug code in ciObjectFactory too slow for large objects

Reviewed-by: ysr, never, kvn
上级 58b99338
...@@ -219,24 +219,27 @@ ciObject* ciObjectFactory::get(oop key) { ...@@ -219,24 +219,27 @@ ciObject* ciObjectFactory::get(oop key) {
ASSERT_IN_VM; ASSERT_IN_VM;
#ifdef ASSERT #ifdef ASSERT
oop last = NULL; if (CIObjectFactoryVerify) {
for (int j = 0; j< _ci_objects->length(); j++) { oop last = NULL;
oop o = _ci_objects->at(j)->get_oop(); for (int j = 0; j< _ci_objects->length(); j++) {
assert(last < o, "out of order"); oop o = _ci_objects->at(j)->get_oop();
last = o; assert(last < o, "out of order");
last = o;
}
} }
#endif // ASSERT #endif // ASSERT
int len = _ci_objects->length(); int len = _ci_objects->length();
int index = find(key, _ci_objects); int index = find(key, _ci_objects);
#ifdef ASSERT #ifdef ASSERT
for (int i=0; i<_ci_objects->length(); i++) { if (CIObjectFactoryVerify) {
if (_ci_objects->at(i)->get_oop() == key) { for (int i=0; i<_ci_objects->length(); i++) {
assert(index == i, " bad lookup"); if (_ci_objects->at(i)->get_oop() == key) {
assert(index == i, " bad lookup");
}
} }
} }
#endif #endif
if (!is_found_at(index, key, _ci_objects)) { if (!is_found_at(index, key, _ci_objects)) {
// Check in the non-perm area before putting it in the list. // Check in the non-perm area before putting it in the list.
NonPermObject* &bucket = find_non_perm(key); NonPermObject* &bucket = find_non_perm(key);
if (bucket != NULL) { if (bucket != NULL) {
...@@ -539,11 +542,13 @@ void ciObjectFactory::insert(int index, ciObject* obj, GrowableArray<ciObject*>* ...@@ -539,11 +542,13 @@ void ciObjectFactory::insert(int index, ciObject* obj, GrowableArray<ciObject*>*
objects->at_put(index, obj); objects->at_put(index, obj);
} }
#ifdef ASSERT #ifdef ASSERT
oop last = NULL; if (CIObjectFactoryVerify) {
for (int j = 0; j< objects->length(); j++) { oop last = NULL;
oop o = objects->at(j)->get_oop(); for (int j = 0; j< objects->length(); j++) {
assert(last < o, "out of order"); oop o = objects->at(j)->get_oop();
last = o; assert(last < o, "out of order");
last = o;
}
} }
#endif // ASSERT #endif // ASSERT
} }
......
...@@ -3034,6 +3034,9 @@ class CommandLineFlags { ...@@ -3034,6 +3034,9 @@ class CommandLineFlags {
"Wait for this many CI accesses to occur in all compiles before " \ "Wait for this many CI accesses to occur in all compiles before " \
"beginning to throw OutOfMemoryErrors in each compile") \ "beginning to throw OutOfMemoryErrors in each compile") \
\ \
notproduct(bool, CIObjectFactoryVerify, false, \
"enable potentially expensive verification in ciObjectFactory") \
\
/* Priorities */ \ /* Priorities */ \
product_pd(bool, UseThreadPriorities, "Use native thread priorities") \ product_pd(bool, UseThreadPriorities, "Use native thread priorities") \
\ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册