8145553: Fix warnings in AArch64 directory

Reviewed-by: kvn
This commit is contained in:
Andrew Haley 2015-12-16 13:21:19 +00:00
parent edb2af6a6d
commit 07512e7aec
5 changed files with 33 additions and 19 deletions

View File

@ -135,15 +135,10 @@ REGISTER_DECLARATION(Register, rlocals, r24);
// bytecode pointer // bytecode pointer
REGISTER_DECLARATION(Register, rbcp, r22); REGISTER_DECLARATION(Register, rbcp, r22);
// Dispatch table base // Dispatch table base
REGISTER_DECLARATION(Register, rdispatch, r21); REGISTER_DECLARATION(Register, rdispatch, r21);
// Java stack pointer // Java stack pointer
REGISTER_DECLARATION(Register, esp, r20); REGISTER_DECLARATION(Register, esp, r20);
// TODO : x86 uses rbp to save SP in method handle code
// we may need to do the same with fp
// JSR 292 fixed register usages:
//REGISTER_DECLARATION(Register, r_mh_SP_save, r29);
#define assert_cond(ARG1) assert(ARG1, #ARG1) #define assert_cond(ARG1) assert(ARG1, #ARG1)
namespace asm_util { namespace asm_util {
@ -551,6 +546,7 @@ class Address VALUE_OBJ_CLASS_SPEC {
size = 0; break; size = 0; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
size = 0; // unreachable
} }
} else { } else {
size = i->get(31, 31); size = i->get(31, 31);

View File

@ -173,6 +173,7 @@ static jlong as_long(LIR_Opr data) {
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
result = 0; // unreachable
} }
return result; return result;
} }
@ -720,6 +721,7 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
insn = &Assembler::str; // unreachable
} }
if (info) add_debug_info_for_null_check_here(info); if (info) add_debug_info_for_null_check_here(info);
@ -1110,6 +1112,7 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) {
case lir_cond_greaterEqual: acond = (is_unordered ? Assembler::HS : Assembler::GE); break; case lir_cond_greaterEqual: acond = (is_unordered ? Assembler::HS : Assembler::GE); break;
case lir_cond_greater: acond = (is_unordered ? Assembler::HI : Assembler::GT); break; case lir_cond_greater: acond = (is_unordered ? Assembler::HI : Assembler::GT); break;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
acond = Assembler::EQ; // unreachable
} }
} else { } else {
switch (op->cond()) { switch (op->cond()) {
@ -1121,7 +1124,8 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) {
case lir_cond_greater: acond = Assembler::GT; break; case lir_cond_greater: acond = Assembler::GT; break;
case lir_cond_belowEqual: acond = Assembler::LS; break; case lir_cond_belowEqual: acond = Assembler::LS; break;
case lir_cond_aboveEqual: acond = Assembler::HS; break; case lir_cond_aboveEqual: acond = Assembler::HS; break;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
acond = Assembler::EQ; // unreachable
} }
} }
__ br(acond,*(op->label())); __ br(acond,*(op->label()));
@ -1313,7 +1317,9 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
ciMethodData* md; ciMethodData* md;
ciProfileData* data; ciProfileData* data;
if (op->should_profile()) { const bool should_profile = op->should_profile();
if (should_profile) {
ciMethod* method = op->profiled_method(); ciMethod* method = op->profiled_method();
assert(method != NULL, "Should have method"); assert(method != NULL, "Should have method");
int bci = op->profiled_bci(); int bci = op->profiled_bci();
@ -1324,8 +1330,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
} }
Label profile_cast_success, profile_cast_failure; Label profile_cast_success, profile_cast_failure;
Label *success_target = op->should_profile() ? &profile_cast_success : success; Label *success_target = should_profile ? &profile_cast_success : success;
Label *failure_target = op->should_profile() ? &profile_cast_failure : failure; Label *failure_target = should_profile ? &profile_cast_failure : failure;
if (obj == k_RInfo) { if (obj == k_RInfo) {
k_RInfo = dst; k_RInfo = dst;
@ -1341,7 +1347,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
assert_different_registers(obj, k_RInfo, klass_RInfo); assert_different_registers(obj, k_RInfo, klass_RInfo);
if (op->should_profile()) { if (should_profile) {
Label not_null; Label not_null;
__ cbnz(obj, not_null); __ cbnz(obj, not_null);
// Object is null; update MDO and exit // Object is null; update MDO and exit
@ -1413,7 +1419,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
// successful cast, fall through to profile or jump // successful cast, fall through to profile or jump
} }
} }
if (op->should_profile()) { if (should_profile) {
Register mdo = klass_RInfo, recv = k_RInfo; Register mdo = klass_RInfo, recv = k_RInfo;
__ bind(profile_cast_success); __ bind(profile_cast_success);
__ mov_metadata(mdo, md->constant_encoding()); __ mov_metadata(mdo, md->constant_encoding());
@ -1438,6 +1444,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
const bool should_profile = op->should_profile();
LIR_Code code = op->code(); LIR_Code code = op->code();
if (code == lir_store_check) { if (code == lir_store_check) {
Register value = op->object()->as_register(); Register value = op->object()->as_register();
@ -1452,7 +1460,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
ciMethodData* md; ciMethodData* md;
ciProfileData* data; ciProfileData* data;
if (op->should_profile()) { if (should_profile) {
ciMethod* method = op->profiled_method(); ciMethod* method = op->profiled_method();
assert(method != NULL, "Should have method"); assert(method != NULL, "Should have method");
int bci = op->profiled_bci(); int bci = op->profiled_bci();
@ -1463,10 +1471,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
} }
Label profile_cast_success, profile_cast_failure, done; Label profile_cast_success, profile_cast_failure, done;
Label *success_target = op->should_profile() ? &profile_cast_success : &done; Label *success_target = should_profile ? &profile_cast_success : &done;
Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); Label *failure_target = should_profile ? &profile_cast_failure : stub->entry();
if (op->should_profile()) { if (should_profile) {
Label not_null; Label not_null;
__ cbnz(value, not_null); __ cbnz(value, not_null);
// Object is null; update MDO and exit // Object is null; update MDO and exit
@ -1502,7 +1510,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ cbzw(k_RInfo, *failure_target); __ cbzw(k_RInfo, *failure_target);
// fall through to the success case // fall through to the success case
if (op->should_profile()) { if (should_profile) {
Register mdo = klass_RInfo, recv = k_RInfo; Register mdo = klass_RInfo, recv = k_RInfo;
__ bind(profile_cast_success); __ bind(profile_cast_success);
__ mov_metadata(mdo, md->constant_encoding()); __ mov_metadata(mdo, md->constant_encoding());
@ -1621,9 +1629,10 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L
case lir_cond_lessEqual: acond = Assembler::LE; ncond = Assembler::GT; break; case lir_cond_lessEqual: acond = Assembler::LE; ncond = Assembler::GT; break;
case lir_cond_greaterEqual: acond = Assembler::GE; ncond = Assembler::LT; break; case lir_cond_greaterEqual: acond = Assembler::GE; ncond = Assembler::LT; break;
case lir_cond_greater: acond = Assembler::GT; ncond = Assembler::LE; break; case lir_cond_greater: acond = Assembler::GT; ncond = Assembler::LE; break;
case lir_cond_belowEqual: Unimplemented(); break; case lir_cond_belowEqual:
case lir_cond_aboveEqual: Unimplemented(); break; case lir_cond_aboveEqual:
default: ShouldNotReachHere(); default: ShouldNotReachHere();
acond = Assembler::EQ; ncond = Assembler::NE; // unreachable
} }
assert(result->is_single_cpu() || result->is_double_cpu(), assert(result->is_single_cpu() || result->is_double_cpu(),
@ -1724,6 +1733,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
c = 0; // unreachable
break; break;
} }
@ -1926,6 +1936,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2,
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
imm = 0; // unreachable
break; break;
} }
@ -3123,6 +3134,9 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
lda = &MacroAssembler::ldaxr;
add = &MacroAssembler::add;
stl = &MacroAssembler::stlxr; // unreachable
} }
switch (code) { switch (code) {

View File

@ -238,6 +238,7 @@ LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) {
} }
} else { } else {
ShouldNotReachHere(); ShouldNotReachHere();
r = NULL; // unreachable
} }
return r; return r;
} }

View File

@ -230,6 +230,7 @@ void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::Me
break; break;
default: default:
ShouldNotReachHere(); ShouldNotReachHere();
fn = NULL; // unreachable
} }
const int gpargs = 0, rtype = 3; const int gpargs = 0, rtype = 3;
__ mov(rscratch1, fn); __ mov(rscratch1, fn);

View File

@ -61,6 +61,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType 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;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
name = NULL; // unreachable
} }
ResourceMark rm; ResourceMark rm;
BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE); BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE);
@ -125,6 +126,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType 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;
default: ShouldNotReachHere(); default: ShouldNotReachHere();
slow_case_addr = NULL; // unreachable
} }
{ {