Mercurial > hg > graal-compiler
diff src/share/vm/c1/c1_LIR.cpp @ 8860:46f6f063b272
7153771: array bound check elimination for c1
Summary: when possible optimize out array bound checks, inserting predicates when needed.
Reviewed-by: never, kvn, twisti
Contributed-by: thomaswue <thomas.wuerthinger@oracle.com>
author | roland |
---|---|
date | Thu, 21 Mar 2013 09:27:54 +0100 |
parents | 84a926fe53d0 |
children | acadb114c818 |
line wrap: on
line diff
--- a/src/share/vm/c1/c1_LIR.cpp Wed Mar 20 17:04:45 2013 -0700 +++ b/src/share/vm/c1/c1_LIR.cpp Thu Mar 21 09:27:54 2013 +0100 @@ -633,6 +633,7 @@ case lir_ushr: case lir_xadd: case lir_xchg: + case lir_assert: { assert(op->as_Op2() != NULL, "must be"); LIR_Op2* op2 = (LIR_Op2*)op; @@ -1112,6 +1113,11 @@ } } +#ifdef ASSERT +void LIR_OpAssert::emit_code(LIR_Assembler* masm) { + masm->emit_assert(this); +} +#endif void LIR_OpDelay::emit_code(LIR_Assembler* masm) { masm->emit_delay(this); @@ -1771,6 +1777,8 @@ case lir_cas_int: s = "cas_int"; break; // LIR_OpProfileCall case lir_profile_call: s = "profile_call"; break; + // LIR_OpAssert + case lir_assert: s = "assert"; break; case lir_none: ShouldNotReachHere();break; default: s = "illegal_op"; break; } @@ -2017,6 +2025,13 @@ out->print("[lbl:0x%x]", stub()->entry()); } +void LIR_OpAssert::print_instr(outputStream* out) const { + print_condition(out, condition()); out->print(" "); + in_opr1()->print(out); out->print(" "); + in_opr2()->print(out); out->print(", \""); + out->print(msg()); out->print("\""); +} + void LIR_OpDelay::print_instr(outputStream* out) const { _op->print_on(out);