c1_IR.cpp revision 1819
5655N/A * or visit www.oracle.com if you need additional information or have any
5655N/A assert(s.count() == method->exception_table_length(), "exception table lengths inconsistent");
5655N/A if (!type_is_exact) {
5655N/A assert(entry_block() == other->entry_block(), "entry_block must be equal when entry_pco is equal");
IRScope::IRScope(Compilation* compilation, IRScope* caller, int caller_bci, ciMethod* method, int osr_bci, bool create_graph)
_number_of_locks = 0;
int callee_max = 0;
for (int i = 0; i < number_of_callees(); i++) {
, _is_method_handle_invoke(false) {
_scope_debug_info->record_debug_info(recorder, pc_offset, true/*topmost*/, _is_method_handle_invoke);
, _num_loops(0) {
if (DoCEE) {
#ifndef PRODUCT
if (EliminateBlocks) {
#ifndef PRODUCT
if (EliminateNullChecks) {
#ifndef PRODUCT
for (int i = 0; i < nos; i++) {
void split_edges() {
#ifndef PRODUCT
uses_do(n);
(*n)->_use_count++;
int depth;
depth++;
(*n)->input_values_do(this);
(*n)->state_values_do(this);
depth--;
depth = 0;
if (!t->is_pinned()) {
uses_do(&t);
t->pin();
UseCountComputer() {
depth = 0;
#ifndef PRODUCT
code; \
void set_visited(BlockBegin* b) { assert(!is_visited(b), "already set"); _visited_blocks.set_bit(b->block_id()); }
void set_active(BlockBegin* b) { assert(!is_active(b), "already set"); _active_blocks.set_bit(b->block_id()); }
void clear_active(BlockBegin* b) { assert(is_active(b), "not already"); _active_blocks.clear_bit(b->block_id()); }
void inc_forward_branches(BlockBegin* b) { _forward_branches.at_put(b->block_id(), _forward_branches.at(b->block_id()) + 1); }
int dec_forward_branches(BlockBegin* b) { _forward_branches.at_put(b->block_id(), _forward_branches.at(b->block_id()) - 1); return _forward_branches.at(b->block_id()); }
bool is_block_in_loop (int loop_idx, BlockBegin* b) const { return _loop_map.at(loop_idx, b->block_id()); }
void set_block_in_loop (int loop_idx, BlockBegin* b) { _loop_map.set_bit(loop_idx, b->block_id()); }
void mark_loops();
bool compute_dominators_iter();
void compute_dominators();
_num_blocks(0),
_num_loops(0),
_iterative_dominators(false),
_compilation(c)
init_visited();
if (_num_loops > 0) {
mark_loops();
TRACE_LINEAR_SCAN(3, tty->print_cr("Enter count_edges for block B%d coming from B%d", cur->block_id(), parent != NULL ? parent->block_id() : -1));
_iterative_dominators = true;
_num_blocks++;
TRACE_LINEAR_SCAN(3, tty->print_cr("Block B%d is loop header of loop %d", cur->block_id(), _num_loops));
_num_loops++;
TRACE_LINEAR_SCAN(3, tty->print_cr("Processing loop from B%d to B%d (loop %d):", loop_start->block_id(), loop_end->block_id(), loop_idx));
assert(loop_start->is_set(BlockBegin::linear_scan_loop_header_flag), "loop header flag must be set");
_iterative_dominators = true;
init_visited();
int loop_depth = 0;
loop_depth++;
min_loop_idx = i;
while (a != NULL) {
a = a->dominator();
b = b->dominator();
TRACE_LINEAR_SCAN(4, tty->print_cr("DOM: initializing dominator of B%d to B%d", cur->block_id(), parent->block_id()));
} else if (!(cur->is_set(BlockBegin::linear_scan_loop_header_flag) && parent->is_set(BlockBegin::linear_scan_loop_end_flag))) {
TRACE_LINEAR_SCAN(4, tty->print_cr("DOM: computing dominator of B%d: common dominator of B%d and B%d is B%d", cur->block_id(), parent->block_id(), cur->dominator()->block_id(), common_dominator(cur->dominator(), parent)->block_id()));
INC_WEIGHT_IF(cur->end()->as_Throw() == NULL && (single_sux == NULL || single_sux->end()->as_Throw() == NULL));
INC_WEIGHT_IF(cur->end()->as_Return() == NULL && (single_sux == NULL || single_sux->end()->as_Return() == NULL));
return weight;
assert(_linear_scan_order->index_of(cur) == -1, "block already processed (block can be ready only once)");
assert(_work_list.index_of(cur) == -1, "block already in work-list (block can be ready only once)");
#ifndef PRODUCT
if (StressLinearScan) {
insert_idx--;
TRACE_LINEAR_SCAN(3, for (int i = 0; i < _work_list.length(); i++) tty->print_cr("%8d B%2d weight:%6x", i, _work_list.at(i)->block_id(), _work_list.at(i)->linear_scan_number()));
#ifdef ASSERT
assert(i == 0 || _work_list.at(i - 1)->linear_scan_number() <= _work_list.at(i)->linear_scan_number(), "incorrect order in worklist");
TRACE_LINEAR_SCAN(3, tty->print_cr("appending block B%d (weight 0x%6x) to linear-scan order", cur->block_id(), cur->linear_scan_number()));
assert(osr_entry->sux_at(0)->number_of_preds() >= 2, "sucessor of osr entry must have two predecessors (otherwise it is not present in normal control flow");
_iterative_dominators = true;
assert(false, "the std_entry must be ready for processing (otherwise, the method has no start block)");
for (i = 0; i < num_sux; i++) {
for (i = 0; i < num_sux; i++) {
bool changed = false;
TRACE_LINEAR_SCAN(4, tty->print_cr("DOM: updating dominator of B%d from B%d to B%d", block->block_id(), block->dominator()->block_id(), dominator->block_id()));
changed = true;
return changed;
TRACE_LINEAR_SCAN(3, tty->print_cr("----- computing dominators (iterative computation reqired: %d)", _iterative_dominators));
if (_iterative_dominators) {
} while (compute_dominators_iter());
#ifndef PRODUCT
tty->print("%4d: B%2d loop: %2d depth: %2d", cur->linear_scan_number(), cur->block_id(), cur->loop_index(), cur->loop_depth());
#ifdef ASSERT
if (StressLinearScan) {
assert(cur->linear_scan_number() >= 0 && cur->linear_scan_number() == _linear_scan_order->index_of(cur), "incorrect linear_scan_number");
assert(sux->linear_scan_number() >= 0 && sux->linear_scan_number() == _linear_scan_order->index_of(sux), "incorrect linear_scan_number");
assert(cur->loop_index() == sux->loop_index() || sux->is_set(BlockBegin::linear_scan_loop_header_flag), "successing blocks with same loop depth must have same loop index");
assert(pred->linear_scan_number() >= 0 && pred->linear_scan_number() == _linear_scan_order->index_of(pred), "incorrect linear_scan_number");
assert(cur->loop_index() == pred->loop_index() || cur->is_set(BlockBegin::linear_scan_loop_header_flag), "successing blocks with same loop depth must have same loop index");
assert(cur->dominator()->linear_scan_number() <= cur->pred_at(j)->linear_scan_number(), "dominator must be before predecessors");
assert(cur->number_of_preds() != 1 || cur->dominator() == cur->pred_at(0), "Single predecessor must also be dominator");
int block_idx = 0;
assert(!is_block_in_loop(loop_idx, _linear_scan_order->at(block_idx)), "the first block must not be present in any loop");
block_idx++;
block_idx++;
assert(!is_block_in_loop(loop_idx, _linear_scan_order->at(block_idx)), "loop not continuous in linear-scan order");
block_idx++;
for (int i = 0; i < num_blocks; i++) {
#ifndef PRODUCT
bool _cfg_only;
bool _live_only;
if (_cfg_only) {
if (is_valid()) {
#ifdef ASSERT
if (v0) {
#ifdef ASSERT
if (v0) {
n->values_do(this);
if (n->subst() != n) {
last = n;
#ifdef ASSERT