8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux

Reviewed-by: stuefe, coleenp, roland
This commit is contained in:
Goetz Lindenmaier 2015-10-22 13:07:10 -04:00
parent f21d1afd70
commit 83b3b21342
40 changed files with 129 additions and 124 deletions

View file

@ -3211,19 +3211,19 @@ void ClassFileParser::layout_fields(Handle class_loader,
// Field size and offset computation
int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size();
int next_static_oop_offset;
int next_static_double_offset;
int next_static_word_offset;
int next_static_short_offset;
int next_static_byte_offset;
int next_nonstatic_oop_offset;
int next_nonstatic_double_offset;
int next_nonstatic_word_offset;
int next_nonstatic_short_offset;
int next_nonstatic_byte_offset;
int first_nonstatic_oop_offset;
int next_nonstatic_field_offset;
int next_nonstatic_padded_offset;
int next_static_oop_offset = 0;
int next_static_double_offset = 0;
int next_static_word_offset = 0;
int next_static_short_offset = 0;
int next_static_byte_offset = 0;
int next_nonstatic_oop_offset = 0;
int next_nonstatic_double_offset = 0;
int next_nonstatic_word_offset = 0;
int next_nonstatic_short_offset = 0;
int next_nonstatic_byte_offset = 0;
int first_nonstatic_oop_offset = 0;
int next_nonstatic_field_offset = 0;
int next_nonstatic_padded_offset = 0;
// Count the contended fields by type.
//
@ -3376,14 +3376,14 @@ void ClassFileParser::layout_fields(Handle class_loader,
ShouldNotReachHere();
}
int nonstatic_oop_space_count = 0;
int nonstatic_word_space_count = 0;
int nonstatic_short_space_count = 0;
int nonstatic_byte_space_count = 0;
int nonstatic_oop_space_offset;
int nonstatic_word_space_offset;
int nonstatic_short_space_offset;
int nonstatic_byte_space_offset;
int nonstatic_oop_space_count = 0;
int nonstatic_word_space_count = 0;
int nonstatic_short_space_count = 0;
int nonstatic_byte_space_count = 0;
int nonstatic_oop_space_offset = 0;
int nonstatic_word_space_offset = 0;
int nonstatic_short_space_offset = 0;
int nonstatic_byte_space_offset = 0;
// Try to squeeze some of the fields into the gaps due to
// long/double alignment.
@ -3455,7 +3455,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
// contended instance fields are handled below
if (fs.is_contended() && !fs.access_flags().is_static()) continue;
int real_offset;
int real_offset = 0;
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
// pack the rest of the fields
@ -3589,7 +3589,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
// handle statics below
if (fs.access_flags().is_static()) continue;
int real_offset;
int real_offset = 0;
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
switch (atype) {