提交 3d7376d3 编写于 作者: C csahu

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

Reviewed-by: stuefe, coleenp, roland
上级 626e7c23
...@@ -514,6 +514,7 @@ uintptr_t search_symbol(struct symtab* symtab, uintptr_t base, ...@@ -514,6 +514,7 @@ uintptr_t search_symbol(struct symtab* symtab, uintptr_t base,
return (uintptr_t)NULL; return (uintptr_t)NULL;
item.key = (char*) strdup(sym_name); item.key = (char*) strdup(sym_name);
item.data = NULL;
hsearch_r(item, FIND, &ret, symtab->hash_table); hsearch_r(item, FIND, &ret, symtab->hash_table);
if (ret) { if (ret) {
struct elf_symbol * sym = (struct elf_symbol *)(ret->data); struct elf_symbol * sym = (struct elf_symbol *)(ret->data);
......
...@@ -1714,8 +1714,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L ...@@ -1714,8 +1714,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
Register Rtmp1 = noreg; Register Rtmp1 = noreg;
// check if it needs to be profiled // check if it needs to be profiled
ciMethodData* md; ciMethodData* md = NULL;
ciProfileData* data; ciProfileData* data = NULL;
if (op->should_profile()) { if (op->should_profile()) {
ciMethod* method = op->profiled_method(); ciMethod* method = op->profiled_method();
...@@ -1874,8 +1874,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { ...@@ -1874,8 +1874,8 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
CodeStub* stub = op->stub(); CodeStub* stub = op->stub();
// check if it needs to be profiled // check if it needs to be profiled
ciMethodData* md; ciMethodData* md = NULL;
ciProfileData* data; ciProfileData* data = NULL;
if (op->should_profile()) { if (op->should_profile()) {
ciMethod* method = op->profiled_method(); ciMethod* method = op->profiled_method();
...@@ -2052,7 +2052,8 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L ...@@ -2052,7 +2052,8 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L
case lir_cond_greater: acond = Assembler::greater; ncond = Assembler::lessEqual; break; case lir_cond_greater: acond = Assembler::greater; ncond = Assembler::lessEqual; break;
case lir_cond_belowEqual: acond = Assembler::belowEqual; ncond = Assembler::above; break; case lir_cond_belowEqual: acond = Assembler::belowEqual; ncond = Assembler::above; break;
case lir_cond_aboveEqual: acond = Assembler::aboveEqual; ncond = Assembler::below; break; case lir_cond_aboveEqual: acond = Assembler::aboveEqual; ncond = Assembler::below; break;
default: ShouldNotReachHere(); default: acond = Assembler::equal; ncond = Assembler::notEqual;
ShouldNotReachHere();
} }
if (opr1->is_cpu_register()) { if (opr1->is_cpu_register()) {
...@@ -3237,27 +3238,23 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { ...@@ -3237,27 +3238,23 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
assert(default_type != NULL && default_type->is_array_klass() && default_type->is_loaded(), "must be true at this point"); assert(default_type != NULL && default_type->is_array_klass() && default_type->is_loaded(), "must be true at this point");
int elem_size = type2aelembytes(basic_type); int elem_size = type2aelembytes(basic_type);
int shift_amount;
Address::ScaleFactor scale; Address::ScaleFactor scale;
switch (elem_size) { switch (elem_size) {
case 1 : case 1 :
shift_amount = 0;
scale = Address::times_1; scale = Address::times_1;
break; break;
case 2 : case 2 :
shift_amount = 1;
scale = Address::times_2; scale = Address::times_2;
break; break;
case 4 : case 4 :
shift_amount = 2;
scale = Address::times_4; scale = Address::times_4;
break; break;
case 8 : case 8 :
shift_amount = 3;
scale = Address::times_8; scale = Address::times_8;
break; break;
default: default:
scale = Address::no_scale;
ShouldNotReachHere(); ShouldNotReachHere();
} }
......
...@@ -195,7 +195,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o ...@@ -195,7 +195,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
LIR_Opr r; LIR_Opr r = NULL;
if (type == T_LONG) { if (type == T_LONG) {
r = LIR_OprFact::longConst(x); r = LIR_OprFact::longConst(x);
} else if (type == T_INT) { } else if (type == T_INT) {
...@@ -484,7 +484,7 @@ void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) { ...@@ -484,7 +484,7 @@ void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
__ cmp(lir_cond_equal, right.result(), LIR_OprFact::longConst(0)); __ cmp(lir_cond_equal, right.result(), LIR_OprFact::longConst(0));
__ branch(lir_cond_equal, T_LONG, new DivByZeroStub(info)); __ branch(lir_cond_equal, T_LONG, new DivByZeroStub(info));
address entry; address entry = NULL;
switch (x->op()) { switch (x->op()) {
case Bytecodes::_lrem: case Bytecodes::_lrem:
entry = CAST_FROM_FN_PTR(address, SharedRuntime::lrem); entry = CAST_FROM_FN_PTR(address, SharedRuntime::lrem);
...@@ -1024,7 +1024,7 @@ LIR_Opr fixed_register_for(BasicType type) { ...@@ -1024,7 +1024,7 @@ LIR_Opr fixed_register_for(BasicType type) {
void LIRGenerator::do_Convert(Convert* x) { void LIRGenerator::do_Convert(Convert* x) {
// flags that vary for the different operations and different SSE-settings // flags that vary for the different operations and different SSE-settings
bool fixed_input, fixed_result, round_result, needs_stub; bool fixed_input = false, fixed_result = false, round_result = false, needs_stub = false;
switch (x->op()) { switch (x->op()) {
case Bytecodes::_i2l: // fall through case Bytecodes::_i2l: // fall through
......
...@@ -48,7 +48,7 @@ GetDoubleField_t JNI_FastGetField::jni_fast_GetDoubleField_fp; ...@@ -48,7 +48,7 @@ GetDoubleField_t JNI_FastGetField::jni_fast_GetDoubleField_fp;
// between loads, which is much more efficient than lfence. // between loads, which is much more efficient than lfence.
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
const char *name; const char *name = NULL;
switch (type) { switch (type) {
case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break; case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
case T_BYTE: name = "jni_fast_GetByteField"; break; case T_BYTE: name = "jni_fast_GetByteField"; break;
...@@ -122,7 +122,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { ...@@ -122,7 +122,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
slowcase_entry_pclist[count++] = __ pc(); slowcase_entry_pclist[count++] = __ pc();
__ bind (slow); __ bind (slow);
address slow_case_addr; address slow_case_addr = NULL;
switch (type) { switch (type) {
case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break; case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break; case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break;
...@@ -256,7 +256,7 @@ address JNI_FastGetField::generate_fast_get_long_field() { ...@@ -256,7 +256,7 @@ address JNI_FastGetField::generate_fast_get_long_field() {
} }
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
const char *name; const char *name = NULL;
switch (type) { switch (type) {
case T_FLOAT: name = "jni_fast_GetFloatField"; break; case T_FLOAT: name = "jni_fast_GetFloatField"; break;
case T_DOUBLE: name = "jni_fast_GetDoubleField"; break; case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
...@@ -337,7 +337,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { ...@@ -337,7 +337,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
slowcase_entry_pclist[count++] = __ pc(); slowcase_entry_pclist[count++] = __ pc();
__ bind (slow); __ bind (slow);
address slow_case_addr; address slow_case_addr = NULL;
switch (type) { switch (type) {
case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break; case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break;
case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break; case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break;
......
...@@ -51,7 +51,7 @@ static const Register rcounter_addr = r11; ...@@ -51,7 +51,7 @@ static const Register rcounter_addr = r11;
// since that may scratch r10! // since that may scratch r10!
address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
const char *name; const char *name = NULL;
switch (type) { switch (type) {
case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break; case T_BOOLEAN: name = "jni_fast_GetBooleanField"; break;
case T_BYTE: name = "jni_fast_GetByteField"; break; case T_BYTE: name = "jni_fast_GetByteField"; break;
...@@ -111,7 +111,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { ...@@ -111,7 +111,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
slowcase_entry_pclist[count++] = __ pc(); slowcase_entry_pclist[count++] = __ pc();
__ bind (slow); __ bind (slow);
address slow_case_addr; address slow_case_addr = NULL;
switch (type) { switch (type) {
case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break; case T_BOOLEAN: slow_case_addr = jni_GetBooleanField_addr(); break;
case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break; case T_BYTE: slow_case_addr = jni_GetByteField_addr(); break;
...@@ -153,7 +153,7 @@ address JNI_FastGetField::generate_fast_get_long_field() { ...@@ -153,7 +153,7 @@ address JNI_FastGetField::generate_fast_get_long_field() {
} }
address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
const char *name; const char *name = NULL;
switch (type) { switch (type) {
case T_FLOAT: name = "jni_fast_GetFloatField"; break; case T_FLOAT: name = "jni_fast_GetFloatField"; break;
case T_DOUBLE: name = "jni_fast_GetDoubleField"; break; case T_DOUBLE: name = "jni_fast_GetDoubleField"; break;
...@@ -206,7 +206,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { ...@@ -206,7 +206,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
slowcase_entry_pclist[count++] = __ pc(); slowcase_entry_pclist[count++] = __ pc();
__ bind (slow); __ bind (slow);
address slow_case_addr; address slow_case_addr = NULL;
switch (type) { switch (type) {
case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break; case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break;
case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr();
......
...@@ -2755,7 +2755,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info ...@@ -2755,7 +2755,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info
int os::Linux::sched_getcpu_syscall(void) { int os::Linux::sched_getcpu_syscall(void) {
unsigned int cpu; unsigned int cpu = 0;
int retval = -1; int retval = -1;
#if defined(IA32) #if defined(IA32)
...@@ -4263,8 +4263,8 @@ static bool call_chained_handler(struct sigaction *actp, int sig, ...@@ -4263,8 +4263,8 @@ static bool call_chained_handler(struct sigaction *actp, int sig,
sigaddset(&(actp->sa_mask), sig); sigaddset(&(actp->sa_mask), sig);
} }
sa_handler_t hand; sa_handler_t hand = NULL;
sa_sigaction_t sa; sa_sigaction_t sa = NULL;
bool siginfo_flag_set = (actp->sa_flags & SA_SIGINFO) != 0; bool siginfo_flag_set = (actp->sa_flags & SA_SIGINFO) != 0;
// retrieve the chained handler // retrieve the chained handler
if (siginfo_flag_set) { if (siginfo_flag_set) {
...@@ -4469,7 +4469,7 @@ jlong os::Linux::fast_thread_cpu_time(clockid_t clockid) { ...@@ -4469,7 +4469,7 @@ jlong os::Linux::fast_thread_cpu_time(clockid_t clockid) {
static const char* get_signal_handler_name(address handler, static const char* get_signal_handler_name(address handler,
char* buf, int buflen) { char* buf, int buflen) {
int offset; int offset = 0;
bool found = os::dll_address_to_library_name(handler, buf, buflen, &offset); bool found = os::dll_address_to_library_name(handler, buf, buflen, &offset);
if (found) { if (found) {
// skip directory names // skip directory names
......
...@@ -30,7 +30,7 @@ static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { ...@@ -30,7 +30,7 @@ static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
(void)memmove(to, from, count * HeapWordSize); (void)memmove(to, from, count * HeapWordSize);
#else #else
// Includes a zero-count check. // Includes a zero-count check.
intx temp; intx temp = 0;
__asm__ volatile(" testl %6,%6 ;" __asm__ volatile(" testl %6,%6 ;"
" jz 7f ;" " jz 7f ;"
" cmpl %4,%5 ;" " cmpl %4,%5 ;"
...@@ -88,7 +88,7 @@ static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) { ...@@ -88,7 +88,7 @@ static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
} }
#else #else
// Includes a zero-count check. // Includes a zero-count check.
intx temp; intx temp = 0;
__asm__ volatile(" testl %6,%6 ;" __asm__ volatile(" testl %6,%6 ;"
" jz 3f ;" " jz 3f ;"
" cmpl $32,%6 ;" " cmpl $32,%6 ;"
...@@ -145,7 +145,7 @@ static void pd_conjoint_bytes(void* from, void* to, size_t count) { ...@@ -145,7 +145,7 @@ static void pd_conjoint_bytes(void* from, void* to, size_t count) {
(void)memmove(to, from, count); (void)memmove(to, from, count);
#else #else
// Includes a zero-count check. // Includes a zero-count check.
intx temp; intx temp = 0;
__asm__ volatile(" testl %6,%6 ;" __asm__ volatile(" testl %6,%6 ;"
" jz 13f ;" " jz 13f ;"
" cmpl %4,%5 ;" " cmpl %4,%5 ;"
......
...@@ -639,7 +639,7 @@ void Canonicalizer::do_If(If* x) { ...@@ -639,7 +639,7 @@ void Canonicalizer::do_If(If* x) {
if (l == r && !lt->is_float_kind()) { if (l == r && !lt->is_float_kind()) {
// pattern: If (a cond a) => simplify to Goto // pattern: If (a cond a) => simplify to Goto
BlockBegin* sux; BlockBegin* sux = NULL;
switch (x->cond()) { switch (x->cond()) {
case If::eql: sux = x->sux_for(true); break; case If::eql: sux = x->sux_for(true); break;
case If::neq: sux = x->sux_for(false); break; case If::neq: sux = x->sux_for(false); break;
...@@ -647,6 +647,7 @@ void Canonicalizer::do_If(If* x) { ...@@ -647,6 +647,7 @@ void Canonicalizer::do_If(If* x) {
case If::leq: sux = x->sux_for(true); break; case If::leq: sux = x->sux_for(true); break;
case If::gtr: sux = x->sux_for(false); break; case If::gtr: sux = x->sux_for(false); break;
case If::geq: sux = x->sux_for(true); break; case If::geq: sux = x->sux_for(true); break;
default: ShouldNotReachHere();
} }
// If is a safepoint then the debug information should come from the state_before of the If. // If is a safepoint then the debug information should come from the state_before of the If.
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux)));
...@@ -684,7 +685,7 @@ void Canonicalizer::do_If(If* x) { ...@@ -684,7 +685,7 @@ void Canonicalizer::do_If(If* x) {
} else { } else {
// two successors differ and two successors are the same => simplify to: If (x cmp y) // two successors differ and two successors are the same => simplify to: If (x cmp y)
// determine new condition & successors // determine new condition & successors
If::Condition cond; If::Condition cond = If::eql;
BlockBegin* tsux = NULL; BlockBegin* tsux = NULL;
BlockBegin* fsux = NULL; BlockBegin* fsux = NULL;
if (lss_sux == eql_sux) { cond = If::leq; tsux = lss_sux; fsux = gtr_sux; } if (lss_sux == eql_sux) { cond = If::leq; tsux = lss_sux; fsux = gtr_sux; }
......
...@@ -3921,8 +3921,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode ...@@ -3921,8 +3921,8 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, Bytecode
caller_state->truncate_stack(args_base); caller_state->truncate_stack(args_base);
assert(callee_state->stack_size() == 0, "callee stack must be empty"); assert(callee_state->stack_size() == 0, "callee stack must be empty");
Value lock; Value lock = NULL;
BlockBegin* sync_handler; BlockBegin* sync_handler = NULL;
// Inline the locking of the receiver if the callee is synchronized // Inline the locking of the receiver if the callee is synchronized
if (callee->is_synchronized()) { if (callee->is_synchronized()) {
......
...@@ -3347,7 +3347,7 @@ void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { ...@@ -3347,7 +3347,7 @@ void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) {
} }
void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool backedge) { void LIRGenerator::increment_event_counter(CodeEmitInfo* info, int bci, bool backedge) {
int freq_log; int freq_log = 0;
int level = compilation()->env()->comp_level(); int level = compilation()->env()->comp_level();
if (level == CompLevel_limited_profile) { if (level == CompLevel_limited_profile) {
freq_log = (backedge ? Tier2BackedgeNotifyFreqLog : Tier2InvokeNotifyFreqLog); freq_log = (backedge ? Tier2BackedgeNotifyFreqLog : Tier2InvokeNotifyFreqLog);
...@@ -3368,7 +3368,7 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, ...@@ -3368,7 +3368,7 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info,
assert(level > CompLevel_simple, "Shouldn't be here"); assert(level > CompLevel_simple, "Shouldn't be here");
int offset = -1; int offset = -1;
LIR_Opr counter_holder; LIR_Opr counter_holder = NULL;
if (level == CompLevel_limited_profile) { if (level == CompLevel_limited_profile) {
MethodCounters* counters_adr = method->ensure_method_counters(); MethodCounters* counters_adr = method->ensure_method_counters();
if (counters_adr == NULL) { if (counters_adr == NULL) {
......
...@@ -410,7 +410,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { ...@@ -410,7 +410,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
} }
static LIR_Condition lir_cond(If::Condition cond) { static LIR_Condition lir_cond(If::Condition cond) {
LIR_Condition l; LIR_Condition l = lir_cond_unknown;
switch (cond) { switch (cond) {
case If::eql: l = lir_cond_equal; break; case If::eql: l = lir_cond_equal; break;
case If::neq: l = lir_cond_notEqual; break; case If::neq: l = lir_cond_notEqual; break;
...@@ -420,6 +420,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { ...@@ -420,6 +420,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
case If::gtr: l = lir_cond_greater; break; case If::gtr: l = lir_cond_greater; break;
case If::aeq: l = lir_cond_aboveEqual; break; case If::aeq: l = lir_cond_aboveEqual; break;
case If::beq: l = lir_cond_belowEqual; break; case If::beq: l = lir_cond_belowEqual; break;
default: fatal("You must pass valid If::Condition");
}; };
return l; return l;
} }
......
...@@ -413,6 +413,7 @@ void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) { ...@@ -413,6 +413,7 @@ void ciObjectFactory::ensure_metadata_alive(ciMetadata* m) {
metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder(); metadata_owner_klass = m->as_method()->get_Method()->constants()->pool_holder();
} else { } else {
fatal("Not implemented for other types of metadata"); fatal("Not implemented for other types of metadata");
return;
} }
oop metadata_holder = metadata_owner_klass->klass_holder(); oop metadata_holder = metadata_owner_klass->klass_holder();
......
...@@ -3190,19 +3190,19 @@ void ClassFileParser::layout_fields(Handle class_loader, ...@@ -3190,19 +3190,19 @@ void ClassFileParser::layout_fields(Handle class_loader,
// Field size and offset computation // Field size and offset computation
int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size(); int nonstatic_field_size = _super_klass() == NULL ? 0 : _super_klass()->nonstatic_field_size();
int next_static_oop_offset; int next_static_oop_offset = 0;
int next_static_double_offset; int next_static_double_offset = 0;
int next_static_word_offset; int next_static_word_offset = 0;
int next_static_short_offset; int next_static_short_offset = 0;
int next_static_byte_offset; int next_static_byte_offset = 0;
int next_nonstatic_oop_offset; int next_nonstatic_oop_offset = 0;
int next_nonstatic_double_offset; int next_nonstatic_double_offset = 0;
int next_nonstatic_word_offset; int next_nonstatic_word_offset = 0;
int next_nonstatic_short_offset; int next_nonstatic_short_offset = 0;
int next_nonstatic_byte_offset; int next_nonstatic_byte_offset = 0;
int first_nonstatic_oop_offset; int first_nonstatic_oop_offset = 0;
int next_nonstatic_field_offset; int next_nonstatic_field_offset = 0;
int next_nonstatic_padded_offset; int next_nonstatic_padded_offset = 0;
// Count the contended fields by type. // Count the contended fields by type.
// //
...@@ -3355,14 +3355,14 @@ void ClassFileParser::layout_fields(Handle class_loader, ...@@ -3355,14 +3355,14 @@ void ClassFileParser::layout_fields(Handle class_loader,
ShouldNotReachHere(); ShouldNotReachHere();
} }
int nonstatic_oop_space_count = 0; int nonstatic_oop_space_count = 0;
int nonstatic_word_space_count = 0; int nonstatic_word_space_count = 0;
int nonstatic_short_space_count = 0; int nonstatic_short_space_count = 0;
int nonstatic_byte_space_count = 0; int nonstatic_byte_space_count = 0;
int nonstatic_oop_space_offset; int nonstatic_oop_space_offset = 0;
int nonstatic_word_space_offset; int nonstatic_word_space_offset = 0;
int nonstatic_short_space_offset; int nonstatic_short_space_offset = 0;
int nonstatic_byte_space_offset; int nonstatic_byte_space_offset = 0;
// Try to squeeze some of the fields into the gaps due to // Try to squeeze some of the fields into the gaps due to
// long/double alignment. // long/double alignment.
...@@ -3434,7 +3434,7 @@ void ClassFileParser::layout_fields(Handle class_loader, ...@@ -3434,7 +3434,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
// contended instance fields are handled below // contended instance fields are handled below
if (fs.is_contended() && !fs.access_flags().is_static()) continue; if (fs.is_contended() && !fs.access_flags().is_static()) continue;
int real_offset; int real_offset = 0;
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type(); FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
// pack the rest of the fields // pack the rest of the fields
...@@ -3567,7 +3567,7 @@ void ClassFileParser::layout_fields(Handle class_loader, ...@@ -3567,7 +3567,7 @@ void ClassFileParser::layout_fields(Handle class_loader,
// handle statics below // handle statics below
if (fs.access_flags().is_static()) continue; if (fs.access_flags().is_static()) continue;
int real_offset; int real_offset = 0;
FieldAllocationType atype = (FieldAllocationType) fs.allocation_type(); FieldAllocationType atype = (FieldAllocationType) fs.allocation_type();
switch (atype) { switch (atype) {
......
...@@ -220,7 +220,7 @@ class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> { ...@@ -220,7 +220,7 @@ class PlaceholderEntry : public HashtableEntry<Symbol*, mtClass> {
} }
SeenThread* actionToQueue(PlaceholderTable::classloadAction action) { SeenThread* actionToQueue(PlaceholderTable::classloadAction action) {
SeenThread* queuehead; SeenThread* queuehead = NULL;
switch (action) { switch (action) {
case PlaceholderTable::LOAD_INSTANCE: case PlaceholderTable::LOAD_INSTANCE:
queuehead = _loadInstanceThreadQ; queuehead = _loadInstanceThreadQ;
......
...@@ -75,8 +75,8 @@ public: ...@@ -75,8 +75,8 @@ public:
// Constructors // Constructors
OopMapValue () { set_value(0); set_content_reg(VMRegImpl::Bad()); } OopMapValue () { set_value(0); set_content_reg(VMRegImpl::Bad()); }
OopMapValue (VMReg reg, oop_types t) { set_reg_type(reg,t); } OopMapValue (VMReg reg, oop_types t) { set_reg_type(reg, t); set_content_reg(VMRegImpl::Bad()); }
OopMapValue (VMReg reg, oop_types t, VMReg reg2) { set_reg_type(reg,t); set_content_reg(reg2); } OopMapValue (VMReg reg, oop_types t, VMReg reg2) { set_reg_type(reg, t); set_content_reg(reg2); }
OopMapValue (CompressedReadStream* stream) { read_from(stream); } OopMapValue (CompressedReadStream* stream) { read_from(stream); }
// Archiving // Archiving
...@@ -89,7 +89,7 @@ public: ...@@ -89,7 +89,7 @@ public:
void read_from(CompressedReadStream* stream) { void read_from(CompressedReadStream* stream) {
set_value(stream->read_int()); set_value(stream->read_int());
if(is_callee_saved() || is_derived_oop()) { if (is_callee_saved() || is_derived_oop()) {
set_content_reg(VMRegImpl::as_VMReg(stream->read_int(), true)); set_content_reg(VMRegImpl::as_VMReg(stream->read_int(), true));
} }
} }
......
...@@ -2288,7 +2288,7 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus ...@@ -2288,7 +2288,7 @@ void CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Caus
} }
// Used for PrintGC // Used for PrintGC
size_t prev_used; size_t prev_used = 0;
if (PrintGC && Verbose) { if (PrintGC && Verbose) {
prev_used = _cmsGen->used(); // XXXPERM prev_used = _cmsGen->used(); // XXXPERM
} }
...@@ -8624,7 +8624,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc, ...@@ -8624,7 +8624,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc,
HeapWord* const fc_addr = (HeapWord*) fc; HeapWord* const fc_addr = (HeapWord*) fc;
bool coalesce; bool coalesce = false;
const size_t left = pointer_delta(fc_addr, freeFinger()); const size_t left = pointer_delta(fc_addr, freeFinger());
const size_t right = chunkSize; const size_t right = chunkSize;
switch (FLSCoalescePolicy) { switch (FLSCoalescePolicy) {
......
...@@ -572,7 +572,7 @@ PerRegionTable* OtherRegionsTable::delete_region_table() { ...@@ -572,7 +572,7 @@ PerRegionTable* OtherRegionsTable::delete_region_table() {
assert(_n_fine_entries == _max_fine_entries, "Precondition"); assert(_n_fine_entries == _max_fine_entries, "Precondition");
PerRegionTable* max = NULL; PerRegionTable* max = NULL;
jint max_occ = 0; jint max_occ = 0;
PerRegionTable** max_prev; PerRegionTable** max_prev = NULL;
size_t max_ind; size_t max_ind;
size_t i = _fine_eviction_start; size_t i = _fine_eviction_start;
...@@ -608,6 +608,7 @@ PerRegionTable* OtherRegionsTable::delete_region_table() { ...@@ -608,6 +608,7 @@ PerRegionTable* OtherRegionsTable::delete_region_table() {
} }
guarantee(max != NULL, "Since _n_fine_entries > 0"); guarantee(max != NULL, "Since _n_fine_entries > 0");
guarantee(max_prev != NULL, "Since max != NULL.");
// Set the corresponding coarse bit. // Set the corresponding coarse bit.
size_t max_hrm_index = (size_t) max->hr()->hrm_index(); size_t max_hrm_index = (size_t) max->hr()->hrm_index();
...@@ -1168,7 +1169,7 @@ void HeapRegionRemSet::print_event(outputStream* str, Event evnt) { ...@@ -1168,7 +1169,7 @@ void HeapRegionRemSet::print_event(outputStream* str, Event evnt) {
void HeapRegionRemSet::print_recorded() { void HeapRegionRemSet::print_recorded() {
int cur_evnt = 0; int cur_evnt = 0;
Event cur_evnt_kind; Event cur_evnt_kind = Event_illegal;
int cur_evnt_ind = 0; int cur_evnt_ind = 0;
if (_n_recorded_events > 0) { if (_n_recorded_events > 0) {
cur_evnt_kind = _recorded_events[cur_evnt]; cur_evnt_kind = _recorded_events[cur_evnt];
......
...@@ -232,7 +232,7 @@ class HeapRegionRemSet : public CHeapObj<mtGC> { ...@@ -232,7 +232,7 @@ class HeapRegionRemSet : public CHeapObj<mtGC> {
public: public:
enum Event { enum Event {
Event_EvacStart, Event_EvacEnd, Event_RSUpdateEnd Event_EvacStart, Event_EvacEnd, Event_RSUpdateEnd, Event_illegal
}; };
private: private:
......
...@@ -513,7 +513,7 @@ void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState t ...@@ -513,7 +513,7 @@ void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState t
if (StopInterpreterAt > 0) stop_interpreter_at(); if (StopInterpreterAt > 0) stop_interpreter_at();
__ verify_FPU(1, t->tos_in()); __ verify_FPU(1, t->tos_in());
#endif // !PRODUCT #endif // !PRODUCT
int step; int step = 0;
if (!t->does_dispatch()) { if (!t->does_dispatch()) {
step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode()); step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode());
if (tos_out == ilgl) tos_out = t->tos_out(); if (tos_out == ilgl) tos_out = t->tos_out();
......
...@@ -83,7 +83,7 @@ void MetaspaceObj::print_address_on(outputStream* st) const { ...@@ -83,7 +83,7 @@ void MetaspaceObj::print_address_on(outputStream* st) const {
} }
void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() { void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
address res; address res = NULL;
switch (type) { switch (type) {
case C_HEAP: case C_HEAP:
res = (address)AllocateHeap(size, flags, CALLER_PC); res = (address)AllocateHeap(size, flags, CALLER_PC);
...@@ -105,8 +105,8 @@ void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS f ...@@ -105,8 +105,8 @@ void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS f
void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant, void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant,
allocation_type type, MEMFLAGS flags) throw() { allocation_type type, MEMFLAGS flags) throw() {
//should only call this with std::nothrow, use other operator new() otherwise // should only call this with std::nothrow, use other operator new() otherwise
address res; address res = NULL;
switch (type) { switch (type) {
case C_HEAP: case C_HEAP:
res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL); res = (address)AllocateHeap(size, flags, CALLER_PC, AllocFailStrategy::RETURN_NULL);
......
...@@ -658,7 +658,7 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) { ...@@ -658,7 +658,7 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) {
&exact_receiver); &exact_receiver);
SafePointNode* slow_map = NULL; SafePointNode* slow_map = NULL;
JVMState* slow_jvms; JVMState* slow_jvms = NULL;
{ PreserveJVMState pjvms(&kit); { PreserveJVMState pjvms(&kit);
kit.set_control(slow_ctl); kit.set_control(slow_ctl);
if (!kit.stopped()) { if (!kit.stopped()) {
......
...@@ -3712,7 +3712,7 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) { ...@@ -3712,7 +3712,7 @@ void Compile::ConstantTable::emit(CodeBuffer& cb) {
MacroAssembler _masm(&cb); MacroAssembler _masm(&cb);
for (int i = 0; i < _constants.length(); i++) { for (int i = 0; i < _constants.length(); i++) {
Constant con = _constants.at(i); Constant con = _constants.at(i);
address constant_addr; address constant_addr = NULL;
switch (con.type()) { switch (con.type()) {
case T_LONG: constant_addr = _masm.long_constant( con.get_jlong() ); break; case T_LONG: constant_addr = _masm.long_constant( con.get_jlong() ); break;
case T_FLOAT: constant_addr = _masm.float_constant( con.get_jfloat() ); break; case T_FLOAT: constant_addr = _masm.float_constant( con.get_jfloat() ); break;
......
...@@ -273,7 +273,7 @@ void GraphKit::gen_stub(address C_function, ...@@ -273,7 +273,7 @@ void GraphKit::gen_stub(address C_function,
//----------------------------- //-----------------------------
// If this is a normal subroutine return, issue the return and be done. // If this is a normal subroutine return, issue the return and be done.
Node *ret; Node *ret = NULL;
switch( is_fancy_jump ) { switch( is_fancy_jump ) {
case 0: // Make a return instruction case 0: // Make a return instruction
// Return to caller, free any space for return address // Return to caller, free any space for return address
......
...@@ -675,7 +675,7 @@ uint PhaseCFG::sched_call(Block* block, uint node_cnt, Node_List& worklist, Grow ...@@ -675,7 +675,7 @@ uint PhaseCFG::sched_call(Block* block, uint node_cnt, Node_List& worklist, Grow
block->insert_node(proj, node_cnt++); block->insert_node(proj, node_cnt++);
// Select the right register save policy. // Select the right register save policy.
const char * save_policy; const char *save_policy = NULL;
switch (op) { switch (op) {
case Op_CallRuntime: case Op_CallRuntime:
case Op_CallLeaf: case Op_CallLeaf:
......
...@@ -1635,7 +1635,7 @@ Node* LibraryCallKit::round_double_node(Node* n) { ...@@ -1635,7 +1635,7 @@ Node* LibraryCallKit::round_double_node(Node* n) {
// public static double Math.log10(double) // public static double Math.log10(double)
bool LibraryCallKit::inline_math(vmIntrinsics::ID id) { bool LibraryCallKit::inline_math(vmIntrinsics::ID id) {
Node* arg = round_double_node(argument(0)); Node* arg = round_double_node(argument(0));
Node* n; Node* n = NULL;
switch (id) { switch (id) {
case vmIntrinsics::_dabs: n = new (C) AbsDNode( arg); break; case vmIntrinsics::_dabs: n = new (C) AbsDNode( arg); break;
case vmIntrinsics::_dsqrt: n = new (C) SqrtDNode(C, control(), arg); break; case vmIntrinsics::_dsqrt: n = new (C) SqrtDNode(C, control(), arg); break;
...@@ -2376,7 +2376,7 @@ inline Node* LibraryCallKit::make_unsafe_address(Node* base, Node* offset) { ...@@ -2376,7 +2376,7 @@ inline Node* LibraryCallKit::make_unsafe_address(Node* base, Node* offset) {
// inline long Long.reverseBytes(long) // inline long Long.reverseBytes(long)
bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) { bool LibraryCallKit::inline_number_methods(vmIntrinsics::ID id) {
Node* arg = argument(0); Node* arg = argument(0);
Node* n; Node* n = NULL;
switch (id) { switch (id) {
case vmIntrinsics::_numberOfLeadingZeros_i: n = new (C) CountLeadingZerosINode( arg); break; case vmIntrinsics::_numberOfLeadingZeros_i: n = new (C) CountLeadingZerosINode( arg); break;
case vmIntrinsics::_numberOfLeadingZeros_l: n = new (C) CountLeadingZerosLNode( arg); break; case vmIntrinsics::_numberOfLeadingZeros_l: n = new (C) CountLeadingZerosLNode( arg); break;
...@@ -2971,7 +2971,7 @@ bool LibraryCallKit::inline_unsafe_load_store(BasicType type, LoadStoreKind kind ...@@ -2971,7 +2971,7 @@ bool LibraryCallKit::inline_unsafe_load_store(BasicType type, LoadStoreKind kind
// For now, we handle only those cases that actually exist: ints, // For now, we handle only those cases that actually exist: ints,
// longs, and Object. Adding others should be straightforward. // longs, and Object. Adding others should be straightforward.
Node* load_store; Node* load_store = NULL;
switch(type) { switch(type) {
case T_INT: case T_INT:
if (kind == LS_xadd) { if (kind == LS_xadd) {
...@@ -3891,7 +3891,7 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) { ...@@ -3891,7 +3891,7 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) {
Node* end = is_copyOfRange? argument(2): argument(1); Node* end = is_copyOfRange? argument(2): argument(1);
Node* array_type_mirror = is_copyOfRange? argument(3): argument(2); Node* array_type_mirror = is_copyOfRange? argument(3): argument(2);
Node* newcopy; Node* newcopy = NULL;
// Set the original stack and the reexecute bit for the interpreter to reexecute // Set the original stack and the reexecute bit for the interpreter to reexecute
// the bytecode that invokes Arrays.copyOf if deoptimization happens. // the bytecode that invokes Arrays.copyOf if deoptimization happens.
...@@ -4279,7 +4279,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() { ...@@ -4279,7 +4279,7 @@ bool LibraryCallKit::inline_native_Reflection_getCallerClass() {
bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) { bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) {
Node* arg = argument(0); Node* arg = argument(0);
Node* result; Node* result = NULL;
switch (id) { switch (id) {
case vmIntrinsics::_floatToRawIntBits: result = new (C) MoveF2INode(arg); break; case vmIntrinsics::_floatToRawIntBits: result = new (C) MoveF2INode(arg); break;
...@@ -6164,7 +6164,7 @@ Node * LibraryCallKit::load_field_from_object(Node * fromObj, const char * field ...@@ -6164,7 +6164,7 @@ Node * LibraryCallKit::load_field_from_object(Node * fromObj, const char * field
//------------------------------inline_aescrypt_Block----------------------- //------------------------------inline_aescrypt_Block-----------------------
bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) { bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) {
address stubAddr; address stubAddr = NULL;
const char *stubName; const char *stubName;
assert(UseAES, "need AES instruction support"); assert(UseAES, "need AES instruction support");
...@@ -6230,8 +6230,8 @@ bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) { ...@@ -6230,8 +6230,8 @@ bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) {
//------------------------------inline_cipherBlockChaining_AESCrypt----------------------- //------------------------------inline_cipherBlockChaining_AESCrypt-----------------------
bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) { bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) {
address stubAddr; address stubAddr = NULL;
const char *stubName; const char *stubName = NULL;
assert(UseAES, "need AES instruction support"); assert(UseAES, "need AES instruction support");
......
...@@ -693,10 +693,10 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray <Sa ...@@ -693,10 +693,10 @@ bool PhaseMacroExpand::scalar_replacement(AllocateNode *alloc, GrowableArray <Sa
ciKlass* klass = NULL; ciKlass* klass = NULL;
ciInstanceKlass* iklass = NULL; ciInstanceKlass* iklass = NULL;
int nfields = 0; int nfields = 0;
int array_base; int array_base = 0;
int element_size; int element_size = 0;
BasicType basic_elem_type; BasicType basic_elem_type = T_ILLEGAL;
ciType* elem_type; ciType* elem_type = NULL;
Node* res = alloc->result_cast(); Node* res = alloc->result_cast();
assert(res == NULL || res->is_CheckCastPP(), "unexpected AllocateNode result"); assert(res == NULL || res->is_CheckCastPP(), "unexpected AllocateNode result");
...@@ -1177,10 +1177,10 @@ void PhaseMacroExpand::expand_allocate_common( ...@@ -1177,10 +1177,10 @@ void PhaseMacroExpand::expand_allocate_common(
// We need a Region and corresponding Phi's to merge the slow-path and fast-path results. // We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
// they will not be used if "always_slow" is set // they will not be used if "always_slow" is set
enum { slow_result_path = 1, fast_result_path = 2 }; enum { slow_result_path = 1, fast_result_path = 2 };
Node *result_region; Node *result_region = NULL;
Node *result_phi_rawmem; Node *result_phi_rawmem = NULL;
Node *result_phi_rawoop; Node *result_phi_rawoop = NULL;
Node *result_phi_i_o; Node *result_phi_i_o = NULL;
// The initial slow comparison is a size check, the comparison // The initial slow comparison is a size check, the comparison
// we want to do is a BoolTest::gt // we want to do is a BoolTest::gt
......
...@@ -105,7 +105,7 @@ Node *Parse::fetch_interpreter_state(int index, ...@@ -105,7 +105,7 @@ Node *Parse::fetch_interpreter_state(int index,
// Very similar to LoadNode::make, except we handle un-aligned longs and // Very similar to LoadNode::make, except we handle un-aligned longs and
// doubles on Sparc. Intel can handle them just fine directly. // doubles on Sparc. Intel can handle them just fine directly.
Node *l; Node *l = NULL;
switch (bt) { // Signature is flattened switch (bt) { // Signature is flattened
case T_INT: l = new (C) LoadINode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInt::INT, MemNode::unordered); break; case T_INT: l = new (C) LoadINode(ctl, mem, adr, TypeRawPtr::BOTTOM, TypeInt::INT, MemNode::unordered); break;
case T_FLOAT: l = new (C) LoadFNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::FLOAT, MemNode::unordered); break; case T_FLOAT: l = new (C) LoadFNode(ctl, mem, adr, TypeRawPtr::BOTTOM, Type::FLOAT, MemNode::unordered); break;
...@@ -1862,7 +1862,7 @@ PhiNode *Parse::ensure_phi(int idx, bool nocreate) { ...@@ -1862,7 +1862,7 @@ PhiNode *Parse::ensure_phi(int idx, bool nocreate) {
// Now use a Phi here for merging // Now use a Phi here for merging
assert(!nocreate, "Cannot build a phi for a block already parsed."); assert(!nocreate, "Cannot build a phi for a block already parsed.");
const JVMState* jvms = map->jvms(); const JVMState* jvms = map->jvms();
const Type* t; const Type* t = NULL;
if (jvms->is_loc(idx)) { if (jvms->is_loc(idx)) {
t = block()->local_type_at(idx - jvms->locoff()); t = block()->local_type_at(idx - jvms->locoff());
} else if (jvms->is_stk(idx)) { } else if (jvms->is_stk(idx)) {
......
...@@ -451,8 +451,8 @@ void PhaseIdealLoop::do_split_if( Node *iff ) { ...@@ -451,8 +451,8 @@ void PhaseIdealLoop::do_split_if( Node *iff ) {
// Replace both uses of 'new_iff' with Regions merging True/False // Replace both uses of 'new_iff' with Regions merging True/False
// paths. This makes 'new_iff' go dead. // paths. This makes 'new_iff' go dead.
Node *old_false, *old_true; Node *old_false = NULL, *old_true = NULL;
Node *new_false, *new_true; Node *new_false = NULL, *new_true = NULL;
for (DUIterator_Last j2min, j2 = iff->last_outs(j2min); j2 >= j2min; --j2) { for (DUIterator_Last j2min, j2 = iff->last_outs(j2min); j2 >= j2min; --j2) {
Node *ifp = iff->last_out(j2); Node *ifp = iff->last_out(j2);
assert( ifp->Opcode() == Op_IfFalse || ifp->Opcode() == Op_IfTrue, "" ); assert( ifp->Opcode() == Op_IfFalse || ifp->Opcode() == Op_IfTrue, "" );
......
...@@ -631,8 +631,8 @@ static jvmtiError JNICALL ...@@ -631,8 +631,8 @@ static jvmtiError JNICALL
jint trace_flags = JvmtiTrace::trace_flags(</xsl:text> jint trace_flags = JvmtiTrace::trace_flags(</xsl:text>
<xsl:value-of select="@num"/> <xsl:value-of select="@num"/>
<xsl:text>); <xsl:text>);
const char *func_name; const char *func_name = NULL;
const char *curr_thread_name; const char *curr_thread_name = NULL;
if (trace_flags) { if (trace_flags) {
func_name = JvmtiTrace::function_name(</xsl:text> func_name = JvmtiTrace::function_name(</xsl:text>
<xsl:value-of select="@num"/> <xsl:value-of select="@num"/>
......
...@@ -3010,7 +3010,7 @@ JvmtiEnv::RawMonitorEnter(JvmtiRawMonitor * rmonitor) { ...@@ -3010,7 +3010,7 @@ JvmtiEnv::RawMonitorEnter(JvmtiRawMonitor * rmonitor) {
// in thread.cpp. // in thread.cpp.
JvmtiPendingMonitors::enter(rmonitor); JvmtiPendingMonitors::enter(rmonitor);
} else { } else {
int r; int r = 0;
Thread* thread = Thread::current(); Thread* thread = Thread::current();
if (thread->is_Java_thread()) { if (thread->is_Java_thread()) {
...@@ -3073,7 +3073,7 @@ JvmtiEnv::RawMonitorExit(JvmtiRawMonitor * rmonitor) { ...@@ -3073,7 +3073,7 @@ JvmtiEnv::RawMonitorExit(JvmtiRawMonitor * rmonitor) {
err = JVMTI_ERROR_NOT_MONITOR_OWNER; err = JVMTI_ERROR_NOT_MONITOR_OWNER;
} }
} else { } else {
int r; int r = 0;
Thread* thread = Thread::current(); Thread* thread = Thread::current();
if (thread->is_Java_thread()) { if (thread->is_Java_thread()) {
...@@ -3107,7 +3107,7 @@ JvmtiEnv::RawMonitorExit(JvmtiRawMonitor * rmonitor) { ...@@ -3107,7 +3107,7 @@ JvmtiEnv::RawMonitorExit(JvmtiRawMonitor * rmonitor) {
// rmonitor - pre-checked for validity // rmonitor - pre-checked for validity
jvmtiError jvmtiError
JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) { JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) {
int r; int r = 0;
Thread* thread = Thread::current(); Thread* thread = Thread::current();
if (thread->is_Java_thread()) { if (thread->is_Java_thread()) {
...@@ -3166,7 +3166,7 @@ JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) { ...@@ -3166,7 +3166,7 @@ JvmtiEnv::RawMonitorWait(JvmtiRawMonitor * rmonitor, jlong millis) {
// rmonitor - pre-checked for validity // rmonitor - pre-checked for validity
jvmtiError jvmtiError
JvmtiEnv::RawMonitorNotify(JvmtiRawMonitor * rmonitor) { JvmtiEnv::RawMonitorNotify(JvmtiRawMonitor * rmonitor) {
int r; int r = 0;
Thread* thread = Thread::current(); Thread* thread = Thread::current();
if (thread->is_Java_thread()) { if (thread->is_Java_thread()) {
...@@ -3197,7 +3197,7 @@ JvmtiEnv::RawMonitorNotify(JvmtiRawMonitor * rmonitor) { ...@@ -3197,7 +3197,7 @@ JvmtiEnv::RawMonitorNotify(JvmtiRawMonitor * rmonitor) {
// rmonitor - pre-checked for validity // rmonitor - pre-checked for validity
jvmtiError jvmtiError
JvmtiEnv::RawMonitorNotifyAll(JvmtiRawMonitor * rmonitor) { JvmtiEnv::RawMonitorNotifyAll(JvmtiRawMonitor * rmonitor) {
int r; int r = 0;
Thread* thread = Thread::current(); Thread* thread = Thread::current();
if (thread->is_Java_thread()) { if (thread->is_Java_thread()) {
......
...@@ -511,7 +511,7 @@ JvmtiEnvBase::is_thread_fully_suspended(JavaThread* thr, bool wait_for_suspend, ...@@ -511,7 +511,7 @@ JvmtiEnvBase::is_thread_fully_suspended(JavaThread* thr, bool wait_for_suspend,
// mean much better out of memory handling // mean much better out of memory handling
unsigned char * unsigned char *
JvmtiEnvBase::jvmtiMalloc(jlong size) { JvmtiEnvBase::jvmtiMalloc(jlong size) {
unsigned char* mem; unsigned char* mem = NULL;
jvmtiError result = allocate(size, &mem); jvmtiError result = allocate(size, &mem);
assert(result == JVMTI_ERROR_NONE, "Allocate failed"); assert(result == JVMTI_ERROR_NONE, "Allocate failed");
return mem; return mem;
...@@ -1038,7 +1038,7 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec ...@@ -1038,7 +1038,7 @@ JvmtiEnvBase::get_object_monitor_usage(JavaThread* calling_thread, jobject objec
// implied else: entry_count == 0 // implied else: entry_count == 0
} }
int nWant,nWait; int nWant = 0, nWait = 0;
if (mon != NULL) { if (mon != NULL) {
// this object has a heavyweight monitor // this object has a heavyweight monitor
nWant = mon->contentions(); // # of threads contending for monitor nWant = mon->contentions(); // # of threads contending for monitor
......
...@@ -332,7 +332,7 @@ void VM_RedefineClasses::append_entry(constantPoolHandle scratch_cp, ...@@ -332,7 +332,7 @@ void VM_RedefineClasses::append_entry(constantPoolHandle scratch_cp,
int new_name_and_type_ref_i = find_or_append_indirect_entry(scratch_cp, name_and_type_ref_i, int new_name_and_type_ref_i = find_or_append_indirect_entry(scratch_cp, name_and_type_ref_i,
merge_cp_p, merge_cp_length_p, THREAD); merge_cp_p, merge_cp_length_p, THREAD);
const char *entry_name; const char *entry_name = NULL;
switch (scratch_cp->tag_at(scratch_i).value()) { switch (scratch_cp->tag_at(scratch_i).value()) {
case JVM_CONSTANT_Fieldref: case JVM_CONSTANT_Fieldref:
entry_name = "Fieldref"; entry_name = "Fieldref";
......
...@@ -855,7 +855,7 @@ static void getBaseAndScale(int& base, int& scale, jclass acls, TRAPS) { ...@@ -855,7 +855,7 @@ static void getBaseAndScale(int& base, int& scale, jclass acls, TRAPS) {
UNSAFE_ENTRY(jint, Unsafe_ArrayBaseOffset(JNIEnv *env, jobject unsafe, jclass acls)) UNSAFE_ENTRY(jint, Unsafe_ArrayBaseOffset(JNIEnv *env, jobject unsafe, jclass acls))
UnsafeWrapper("Unsafe_ArrayBaseOffset"); UnsafeWrapper("Unsafe_ArrayBaseOffset");
int base, scale; int base = 0, scale = 0;
getBaseAndScale(base, scale, acls, CHECK_0); getBaseAndScale(base, scale, acls, CHECK_0);
return field_offset_from_byte_offset(base); return field_offset_from_byte_offset(base);
UNSAFE_END UNSAFE_END
...@@ -863,7 +863,7 @@ UNSAFE_END ...@@ -863,7 +863,7 @@ UNSAFE_END
UNSAFE_ENTRY(jint, Unsafe_ArrayIndexScale(JNIEnv *env, jobject unsafe, jclass acls)) UNSAFE_ENTRY(jint, Unsafe_ArrayIndexScale(JNIEnv *env, jobject unsafe, jclass acls))
UnsafeWrapper("Unsafe_ArrayIndexScale"); UnsafeWrapper("Unsafe_ArrayIndexScale");
int base, scale; int base = 0, scale = 0;
getBaseAndScale(base, scale, acls, CHECK_0); getBaseAndScale(base, scale, acls, CHECK_0);
// This VM packs both fields and array elements down to the byte. // This VM packs both fields and array elements down to the byte.
// But watch out: If this changes, so that array references for // But watch out: If this changes, so that array references for
......
...@@ -142,7 +142,7 @@ void SafepointSynchronize::begin() { ...@@ -142,7 +142,7 @@ void SafepointSynchronize::begin() {
// Save the starting time, so that it can be compared to see if this has taken // Save the starting time, so that it can be compared to see if this has taken
// too long to complete. // too long to complete.
jlong safepoint_limit_time; jlong safepoint_limit_time = 0;
timeout_error_printed = false; timeout_error_printed = false;
// PrintSafepointStatisticsTimeout can be specified separately. When // PrintSafepointStatisticsTimeout can be specified separately. When
...@@ -925,7 +925,7 @@ void ThreadSafepointState::restart() { ...@@ -925,7 +925,7 @@ void ThreadSafepointState::restart() {
void ThreadSafepointState::print_on(outputStream *st) const { void ThreadSafepointState::print_on(outputStream *st) const {
const char *s; const char *s = NULL;
switch(_type) { switch(_type) {
case _running : s = "_running"; break; case _running : s = "_running"; break;
......
...@@ -425,12 +425,12 @@ class JavaThreadStatusChanger : public StackObj { ...@@ -425,12 +425,12 @@ class JavaThreadStatusChanger : public StackObj {
} }
JavaThreadStatusChanger(JavaThread* java_thread, JavaThreadStatusChanger(JavaThread* java_thread,
java_lang_Thread::ThreadStatus state) { java_lang_Thread::ThreadStatus state) : _old_state(java_lang_Thread::NEW) {
save_old_state(java_thread); save_old_state(java_thread);
set_thread_status(state); set_thread_status(state);
} }
JavaThreadStatusChanger(JavaThread* java_thread) { JavaThreadStatusChanger(JavaThread* java_thread) : _old_state(java_lang_Thread::NEW) {
save_old_state(java_thread); save_old_state(java_thread);
} }
...@@ -527,7 +527,7 @@ class JavaThreadBlockedOnMonitorEnterState : public JavaThreadStatusChanger { ...@@ -527,7 +527,7 @@ class JavaThreadBlockedOnMonitorEnterState : public JavaThreadStatusChanger {
// Current thread is the notifying thread which holds the monitor. // Current thread is the notifying thread which holds the monitor.
static bool wait_reenter_begin(JavaThread *java_thread, ObjectMonitor *obj_m) { static bool wait_reenter_begin(JavaThread *java_thread, ObjectMonitor *obj_m) {
assert((java_thread != NULL), "Java thread should not be null here"); assert((java_thread != NULL), "Java thread should not be null here");
bool active = false; bool active = false;
if (is_alive(java_thread) && ServiceUtil::visible_oop((oop)obj_m->object())) { if (is_alive(java_thread) && ServiceUtil::visible_oop((oop)obj_m->object())) {
active = contended_enter_begin(java_thread); active = contended_enter_begin(java_thread);
} }
...@@ -542,7 +542,7 @@ class JavaThreadBlockedOnMonitorEnterState : public JavaThreadStatusChanger { ...@@ -542,7 +542,7 @@ class JavaThreadBlockedOnMonitorEnterState : public JavaThreadStatusChanger {
} }
JavaThreadBlockedOnMonitorEnterState(JavaThread *java_thread, ObjectMonitor *obj_m) : JavaThreadBlockedOnMonitorEnterState(JavaThread *java_thread, ObjectMonitor *obj_m) :
JavaThreadStatusChanger(java_thread) { _stat(NULL), _active(false), JavaThreadStatusChanger(java_thread) {
assert((java_thread != NULL), "Java thread should not be null here"); assert((java_thread != NULL), "Java thread should not be null here");
// Change thread status and collect contended enter stats for monitor contended // Change thread status and collect contended enter stats for monitor contended
// enter done for external java world objects and it is contended. All other cases // enter done for external java world objects and it is contended. All other cases
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册