src/share/vm/classfile/javaClasses.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8087315.01 Cdiff src/share/vm/classfile/javaClasses.cpp

src/share/vm/classfile/javaClasses.cpp

Print this page

        

*** 1466,1475 **** --- 1466,1488 ---- _index++; } }; + Symbol* get_source_file_name(InstanceKlass* holder, int version) { + // Find the specific ik version that contains this source_file_name_index + // via the previous versions list, but use the current version's + // constant pool to look it up. The previous version's index has been + // merged for the current constant pool. + InstanceKlass* ik = holder->get_klass_version(version); + // This version has been cleaned up. + if (ik == NULL) return NULL; + int source_file_name_index = ik->source_file_name_index(); + return (source_file_name_index == 0) ? + (Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index); + } + // Print stack trace element to resource allocated buffer char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror, int method_id, int version, int bci, int cpref) { // Get strings and string lengths
*** 1482,1503 **** // The method can be NULL if the requested class version is gone Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref); char* method_name = sym->as_C_string(); buf_len += (int)strlen(method_name); - // Use specific ik version as a holder since the mirror might - // refer to version that is now obsolete and no longer accessible - // via the previous versions list. - holder = holder->get_klass_version(version); char* source_file_name = NULL; ! if (holder != NULL) { ! Symbol* source = holder->source_file_name(); if (source != NULL) { source_file_name = source->as_C_string(); buf_len += (int)strlen(source_file_name); } - } // Allocate temporary buffer with extra space for formatting and line number char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64); // Print stack trace line in buffer --- 1495,1510 ---- // The method can be NULL if the requested class version is gone Symbol* sym = (method != NULL) ? method->name() : holder->constants()->symbol_at(cpref); char* method_name = sym->as_C_string(); buf_len += (int)strlen(method_name); char* source_file_name = NULL; ! Symbol* source = get_source_file_name(holder, version); if (source != NULL) { source_file_name = source->as_C_string(); buf_len += (int)strlen(source_file_name); } // Allocate temporary buffer with extra space for formatting and line number char* buf = NEW_RESOURCE_ARRAY(char, buf_len + 64); // Print stack trace line in buffer
*** 1907,1922 **** // The method was redefined, accurate line number information isn't available java_lang_StackTraceElement::set_fileName(element(), NULL); java_lang_StackTraceElement::set_lineNumber(element(), -1); } else { // Fill in source file name and line number. ! // Use specific ik version as a holder since the mirror might ! // refer to version that is now obsolete and no longer accessible ! // via the previous versions list. ! holder = holder->get_klass_version(version); ! assert(holder != NULL, "sanity check"); ! Symbol* source = holder->source_file_name(); if (ShowHiddenFrames && source == NULL) source = vmSymbols::unknown_class_name(); oop filename = StringTable::intern(source, CHECK_0); java_lang_StackTraceElement::set_fileName(element(), filename); --- 1914,1924 ---- // The method was redefined, accurate line number information isn't available java_lang_StackTraceElement::set_fileName(element(), NULL); java_lang_StackTraceElement::set_lineNumber(element(), -1); } else { // Fill in source file name and line number. ! Symbol* source = get_source_file_name(holder, version); if (ShowHiddenFrames && source == NULL) source = vmSymbols::unknown_class_name(); oop filename = StringTable::intern(source, CHECK_0); java_lang_StackTraceElement::set_fileName(element(), filename);
src/share/vm/classfile/javaClasses.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File