c1_Optimizer.cpp revision 3037
1472N/A * or visit www.oracle.com if you need additional information or have any
1879N/A#include "precompiled.hpp"
1879N/A#include "c1/c1_Canonicalizer.hpp"
1879N/A#include "c1/c1_Optimizer.hpp"
1879N/A#include "c1/c1_ValueMap.hpp"
1879N/A#include "c1/c1_ValueSet.hpp"
1879N/A#include "c1/c1_ValueStack.hpp"
1879N/A#include "utilities/bitMap.inline.hpp"
0N/A int _has_substitution;
0N/A _has_substitution = false;
0N/A if (_has_substitution) {
1819N/A if (sux_phi == NULL || sux_phi->as_Phi() == NULL || sux_phi->as_Phi()->block() != sux) return;
1819N/A Goto* goto_ = new Goto(sux, state_before, if_->is_safepoint() || t_goto->is_safepoint() || f_goto->is_safepoint());
1819N/A _has_substitution = true;
1819N/A tty->print_cr("%d. CEE in B%d (B%d B%d)", cee_count(), block->block_id(), t_block->block_id(), f_block->block_id());
1819N/AValue CE_Eliminator::make_ifop(Value x, Instruction::Condition cond, Value y, Value tval, Value fval) {
1819N/A if (!OptimizeIfOps) {
2459N/A if (t_compare_res != Constant::not_comparable && f_compare_res != Constant::not_comparable) {
0N/A , _merge_count(0)
0N/A _merge_count++;
0N/A if (PrintBlockElimination) {
0N/A _merge_count++;
0N/A if (PrintBlockElimination) {
0N/A tty->print_cr("%d. replaced If and IfOp at end of B%d with single If", _merge_count, block->block_id());
0N/Aclass NullCheckEliminator;
0N/A NullCheckVisitor() {}
0N/A void clear_visitable_state() {
0N/A void iterate_all();
0N/A void set_state_for (BlockBegin* block, ValueSet* stack) { _block_states[block->block_id()] = stack; }
0N/A return _last_explicit_null_check;
0N/Avoid NullCheckVisitor::do_ArithmeticOp (ArithmeticOp* x) { if (x->can_trap()) nce()->clear_last_explicit_null_check(); }
2617N/Avoid NullCheckVisitor::do_CheckCast (CheckCast* x) { nce()->clear_last_explicit_null_check(); }
0N/Avoid NullCheckVisitor::do_ExceptionObject(ExceptionObject* x) { nce()->handle_ExceptionObject(x); }
0N/Avoid NullCheckVisitor::do_ProfileCall (ProfileCall* x) { nce()->clear_last_explicit_null_check(); }
1504N/A mark_visited(*p);
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A for (i = 0; i < e->number_of_sux(); i++) {
0N/A iterate_all();
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A x->set_needs_null_check(true);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A x->set_needs_null_check(true);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A tty->print_cr("StoreIndexed %d of value %d proves value to be non-null", x->id(), array->id());
0N/A x->set_needs_null_check(true);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_can_trap(false);
0N/A x->set_can_trap(true);
0N/A if (PrintNullCheckElimination) {
0N/A if (!x->has_receiver()) {
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A if (!x->has_receiver()) {
2293N/A for (int i = 0; i < x->number_of_arguments(); i++) {
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(false);
0N/A if (PrintNullCheckElimination) {
0N/A x->set_needs_null_check(true);
0N/A bool all_non_null = true;
0N/A if (x->is_illegal()) {
0N/A all_non_null = false;
0N/A for (i = 0; i < x->operand_count(); i++) {
0N/A all_non_null = false;
0N/A if (all_non_null) {
0N/A if (PrintNullCheckElimination) {
0N/A tty->print_cr("Eliminated Phi %d's null check for phifun because all inputs are non-null", x->id());
0N/A x->set_needs_null_check(false);
0N/A } else if (set_contains(x)) {
0N/A set_remove(x);
0N/A if (PrintNullCheckElimination) {
0N/A for (int e = b->number_of_exception_handlers(); e-- > 0; ) {
0N/A if (PrintNullCheckElimination) {