< prev index next >

src/hotspot/share/opto/compile.cpp

Print this page

        

*** 403,417 **** Node* n = C->expensive_node(i); if (!useful.member(n)) { remove_expensive_node(n); } } ! for (int i = value_type_ptr_count() - 1; i >= 0; i--) { ! ValueTypePtrNode* vtptr = value_type_ptr(i); ! if (!useful.member(vtptr)) { ! remove_value_type_ptr(vtptr); ! } } // clean up the late inline lists remove_useless_late_inlines(&_string_late_inlines, useful); remove_useless_late_inlines(&_boxing_late_inlines, useful); remove_useless_late_inlines(&_late_inlines, useful); --- 403,415 ---- Node* n = C->expensive_node(i); if (!useful.member(n)) { remove_expensive_node(n); } } ! // Remove useless value type nodes ! if (_value_type_nodes != NULL) { ! _value_type_nodes->remove_useless_nodes(useful.member_set()); } // clean up the late inline lists remove_useless_late_inlines(&_string_late_inlines, useful); remove_useless_late_inlines(&_boxing_late_inlines, useful); remove_useless_late_inlines(&_late_inlines, useful);
*** 1183,1193 **** _intrinsics = NULL; _macro_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _predicate_opaqs = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _expensive_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _range_check_casts = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); ! _value_type_ptr_nodes = new(comp_arena()) GrowableArray<ValueTypePtrNode*>(comp_arena(), 8, 0, NULL); register_library_intrinsics(); } //---------------------------init_start---------------------------------------- // Install the StartNode on this compile object. --- 1181,1191 ---- _intrinsics = NULL; _macro_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _predicate_opaqs = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _expensive_nodes = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); _range_check_casts = new(comp_arena()) GrowableArray<Node*>(comp_arena(), 8, 0, NULL); ! _value_type_nodes = new (comp_arena()) Unique_Node_List(comp_arena()); register_library_intrinsics(); } //---------------------------init_start---------------------------------------- // Install the StartNode on this compile object.
*** 1969,1994 **** igvn.replace_node(cast, cast->in(1)); } assert(range_check_cast_count() == 0, "should be empty"); } ! void Compile::add_value_type_ptr(ValueTypePtrNode* n) { ! assert(can_add_value_type_ptr(), "too late"); ! assert(!_value_type_ptr_nodes->contains(n), "duplicate entry"); ! _value_type_ptr_nodes->append(n); ! } ! ! void Compile::process_value_type_ptr_nodes(PhaseIterGVN &igvn) { ! for (int i = value_type_ptr_count(); i > 0; i--) { ! ValueTypePtrNode* vtptr = value_type_ptr(i-1); ! // once all inlining is over otherwise debug info can get ! // inconsistent ! vtptr->make_scalar_in_safepoints(igvn.C->root(), &igvn); ! igvn.replace_node(vtptr, vtptr->get_oop()); } ! assert(value_type_ptr_count() == 0, "should be empty"); ! _value_type_ptr_nodes = NULL; igvn.optimize(); } // StringOpts and late inlining of string methods void Compile::inline_string_calls(bool parse_time) { --- 1967,2000 ---- igvn.replace_node(cast, cast->in(1)); } assert(range_check_cast_count() == 0, "should be empty"); } ! void Compile::add_value_type(Node* n) { ! assert(n->is_ValueTypeBase(), "unexpected node"); ! if (_value_type_nodes != NULL) { ! _value_type_nodes->push(n); ! } ! } ! ! void Compile::remove_value_type(Node* n) { ! assert(n->is_ValueTypeBase(), "unexpected node"); ! if (_value_type_nodes != NULL) { ! _value_type_nodes->remove(n); ! } ! } ! ! void Compile::process_value_types(PhaseIterGVN &igvn) { ! // Make value types scalar in safepoints ! while (_value_type_nodes->size() != 0) { ! ValueTypeBaseNode* vt = _value_type_nodes->pop()->as_ValueTypeBase(); ! vt->make_scalar_in_safepoints(igvn.C->root(), &igvn); ! if (vt->is_ValueTypePtr()) { ! igvn.replace_node(vt, vt->get_oop()); ! } } ! _value_type_nodes = NULL; igvn.optimize(); } // StringOpts and late inlining of string methods void Compile::inline_string_calls(bool parse_time) {
*** 2235,2246 **** set_for_igvn(&new_worklist); igvn = PhaseIterGVN(initial_gvn()); igvn.optimize(); } ! if (value_type_ptr_count() > 0) { ! process_value_type_ptr_nodes(igvn); } // Perform escape analysis if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) { if (has_loops()) { --- 2241,2253 ---- set_for_igvn(&new_worklist); igvn = PhaseIterGVN(initial_gvn()); igvn.optimize(); } ! if (_value_type_nodes->size() > 0) { ! // Do this once all inlining is over to avoid getting inconsistent debug info ! process_value_types(igvn); } // Perform escape analysis if (_do_escape_analysis && ConnectionGraph::has_candidates(this)) { if (has_loops()) {
*** 2383,2411 **** } print_method(PHASE_OPTIMIZE_FINISHED, 2); } - // Fixme remove - static void check_for_value_node(Node &n, void* C) { - if (n.is_ValueType()) { - #ifdef ASSERT - ((Compile*)C)->method()->print_short_name(); - tty->print_cr(""); - n.dump(-1); - assert(false, "Unable to match ValueTypeNode"); - #endif - ((Compile*)C)->record_failure("Unable to match ValueTypeNode"); - } - } - //------------------------------Code_Gen--------------------------------------- // Given a graph, generate code for it void Compile::Code_Gen() { - // FIXME remove - root()->walk(Node::nop, check_for_value_node, this); - if (failing()) { return; } // Perform instruction selection. You might think we could reclaim Matcher --- 2390,2402 ----
*** 3380,3401 **** } } } break; } case Op_ValueType: { ! ValueTypeNode* vt = n->as_ValueType(); ! vt->make_scalar_in_safepoints(root(), NULL); ! if (vt->outcnt() == 0) { ! vt->disconnect_inputs(NULL, this); ! } ! break; ! } ! case Op_ValueTypePtr: { ! ShouldNotReachHere(); break; } default: assert( !n->is_Call(), "" ); assert( !n->is_Mem(), "" ); assert( nop != Op_ProfileBoolean, "should be eliminated during IGVN"); break; --- 3371,3388 ---- } } } break; } + #ifdef ASSERT + case Op_ValueTypePtr: case Op_ValueType: { ! n->dump(-1); ! assert(false, "value type node was not removed"); break; } + #endif default: assert( !n->is_Call(), "" ); assert( !n->is_Mem(), "" ); assert( nop != Op_ProfileBoolean, "should be eliminated during IGVN"); break;
< prev index next >