Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/c1_LIRAssembler_x86.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 | cd3d6a6b95d9 |
children | b800986664f4 |
comparison
equal
deleted
inserted
replaced
8780:98f3af397705 | 8860:46f6f063b272 |
---|---|
3753 } else { | 3753 } else { |
3754 ShouldNotReachHere(); | 3754 ShouldNotReachHere(); |
3755 } | 3755 } |
3756 } | 3756 } |
3757 | 3757 |
3758 #ifdef ASSERT | |
3759 // emit run-time assertion | |
3760 void LIR_Assembler::emit_assert(LIR_OpAssert* op) { | |
3761 assert(op->code() == lir_assert, "must be"); | |
3762 | |
3763 if (op->in_opr1()->is_valid()) { | |
3764 assert(op->in_opr2()->is_valid(), "both operands must be valid"); | |
3765 comp_op(op->condition(), op->in_opr1(), op->in_opr2(), op); | |
3766 } else { | |
3767 assert(op->in_opr2()->is_illegal(), "both operands must be illegal"); | |
3768 assert(op->condition() == lir_cond_always, "no other conditions allowed"); | |
3769 } | |
3770 | |
3771 Label ok; | |
3772 if (op->condition() != lir_cond_always) { | |
3773 Assembler::Condition acond = Assembler::zero; | |
3774 switch (op->condition()) { | |
3775 case lir_cond_equal: acond = Assembler::equal; break; | |
3776 case lir_cond_notEqual: acond = Assembler::notEqual; break; | |
3777 case lir_cond_less: acond = Assembler::less; break; | |
3778 case lir_cond_lessEqual: acond = Assembler::lessEqual; break; | |
3779 case lir_cond_greaterEqual: acond = Assembler::greaterEqual;break; | |
3780 case lir_cond_greater: acond = Assembler::greater; break; | |
3781 case lir_cond_belowEqual: acond = Assembler::belowEqual; break; | |
3782 case lir_cond_aboveEqual: acond = Assembler::aboveEqual; break; | |
3783 default: ShouldNotReachHere(); | |
3784 } | |
3785 __ jcc(acond, ok); | |
3786 } | |
3787 if (op->halt()) { | |
3788 const char* str = __ code_string(op->msg()); | |
3789 __ stop(str); | |
3790 } else { | |
3791 breakpoint(); | |
3792 } | |
3793 __ bind(ok); | |
3794 } | |
3795 #endif | |
3758 | 3796 |
3759 void LIR_Assembler::membar() { | 3797 void LIR_Assembler::membar() { |
3760 // QQQ sparc TSO uses this, | 3798 // QQQ sparc TSO uses this, |
3761 __ membar( Assembler::Membar_mask_bits(Assembler::StoreLoad)); | 3799 __ membar( Assembler::Membar_mask_bits(Assembler::StoreLoad)); |
3762 } | 3800 } |