comparison src/share/vm/oops/constantPoolOop.cpp @ 773:47ffceb239d0

6839599: JVM crash while profiling Tomcat and Liferay Summary: constantPoolOopDesc::copy_cpool_bytes() - do the brute-force search search through 'tbl' when SymbolTable::lookup_only() returns NULL Reviewed-by: kamg
author thurka
date Wed, 20 May 2009 09:36:53 +0200
parents be93aad57795
children 389049f3f393
comparison
equal deleted inserted replaced
765:c55be0c7bd32 773:47ffceb239d0
1179 } 1179 }
1180 case JVM_CONSTANT_String: { 1180 case JVM_CONSTANT_String: {
1181 unsigned int hash; 1181 unsigned int hash;
1182 char *str = string_at_noresolve(idx); 1182 char *str = string_at_noresolve(idx);
1183 symbolOop sym = SymbolTable::lookup_only(str, (int) strlen(str), hash); 1183 symbolOop sym = SymbolTable::lookup_only(str, (int) strlen(str), hash);
1184 idx1 = tbl->symbol_to_value(sym); 1184 if (sym == NULL) {
1185 // sym can be NULL if string refers to incorrectly encoded JVM_CONSTANT_Utf8
1186 // this can happen with JVM TI; see CR 6839599 for more details
1187 oop string = *(obj_at_addr(idx));
1188 assert(java_lang_String::is_instance(string),"Not a String");
1189 DBG(printf("Error #%03hd tag=%03hd\n", idx, tag));
1190 idx1 = 0;
1191 for (int j = 0; j < tbl->table_size() && idx1 == 0; j++) {
1192 for (SymbolHashMapEntry* cur = tbl->bucket(j); cur != NULL; cur = cur->next()) {
1193 int length;
1194 sym = cur->symbol();
1195 jchar* chars = sym->as_unicode(length);
1196 if (java_lang_String::equals(string, chars, length)) {
1197 idx1 = cur->value();
1198 DBG(printf("Index found: %d\n",idx1));
1199 break;
1200 }
1201 }
1202 }
1203 } else {
1204 idx1 = tbl->symbol_to_value(sym);
1205 }
1185 assert(idx1 != 0, "Have not found a hashtable entry"); 1206 assert(idx1 != 0, "Have not found a hashtable entry");
1186 Bytes::put_Java_u2((address) (bytes+1), idx1); 1207 Bytes::put_Java_u2((address) (bytes+1), idx1);
1187 DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, str)); 1208 DBG(printf("JVM_CONSTANT_String: idx=#%03hd, %s", idx1, str));
1188 break; 1209 break;
1189 } 1210 }