src/share/vm/opto/compile.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/share/vm/opto/compile.cpp	Mon May  6 18:14:20 2013
--- new/src/share/vm/opto/compile.cpp	Mon May  6 18:14:19 2013

*** 416,425 **** --- 416,426 ---- remove_expensive_node(n); } } // 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); debug_only(verify_graph_edges(true/*check for no_dead_code*/);) } //------------------------------frame_size_in_words-----------------------------
*** 483,492 **** --- 484,499 ---- // Recompiling without escape analysis tty->print_cr("*********************************************************"); tty->print_cr("** Bailout: Recompile without escape analysis **"); tty->print_cr("*********************************************************"); } + if (_eliminate_boxing != EliminateAutoBox && PrintOpto) { + // Recompiling without boxing elimination + tty->print_cr("*********************************************************"); + tty->print_cr("** Bailout: Recompile without boxing elimination **"); + tty->print_cr("*********************************************************"); + } if (env()->break_at_compile()) { // Open the debugger when compiling this method. tty->print("### Breaking when compiling: "); method()->print_short_name(); tty->cr();
*** 599,609 **** --- 606,617 ---- // Compile a method. entry_bci is -1 for normal compilations and indicates // the continuation bci for on stack replacement. - Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr_bci, bool subsume_loads, bool do_escape_analysis ) + bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing ) : Phase(Compiler), _env(ci_env), _log(ci_env->log()), _compile_id(ci_env->compile_id()), _save_argument_registers(false),
*** 615,624 **** --- 623,633 ---- _initial_gvn(NULL), _for_igvn(NULL), _warm_calls(NULL), _subsume_loads(subsume_loads), _do_escape_analysis(do_escape_analysis), + _eliminate_boxing(eliminate_boxing), _failure_reason(NULL), _code_buffer("Compile::Fill_buffer"), _orig_pc_slot(0), _orig_pc_slot_offset_in_bytes(0), _has_method_handle_invokes(false),
*** 636,645 **** --- 645,655 ---- _printer(IdealGraphPrinter::printer()), #endif _congraph(NULL), _late_inlines(comp_arena(), 2, 0, NULL), _string_late_inlines(comp_arena(), 2, 0, NULL), + _boxing_late_inlines(comp_arena(), 2, 0, NULL), _late_inlines_pos(0), _number_of_mh_late_inlines(0), _inlining_progress(false), _inlining_incrementally(false), _print_inlining_list(NULL),
*** 904,913 **** --- 914,924 ---- _warm_calls(NULL), _orig_pc_slot(0), _orig_pc_slot_offset_in_bytes(0), _subsume_loads(true), _do_escape_analysis(false), + _eliminate_boxing(false), _failure_reason(NULL), _code_buffer("Compile::Fill_buffer"), _has_method_handle_invokes(false), _mach_constant_base_node(NULL), _node_bundling_limit(0),
*** 1014,1023 **** --- 1025,1035 ---- _fixed_slots = 0; set_has_split_ifs(false); set_has_loops(has_method() && method()->has_loops()); // first approximation set_has_stringbuilder(false); + set_has_boxed_value(false); _trap_can_recompile = false; // no traps emitted yet _major_progress = true; // start out assuming good things will happen set_has_unsafe_access(false); set_max_vector_size(0); Copy::zero_to_bytes(_trap_hist, sizeof(_trap_hist));
*** 1805,1814 **** --- 1817,1858 ---- if (failing()) return; } _string_late_inlines.trunc_to(0); } + // Late inlining of boxing methods + void Compile::inline_boxing_calls(PhaseIterGVN& igvn) { + if (_boxing_late_inlines.length() > 0) { + assert(has_boxed_value(), "inconsistent"); + + PhaseGVN* gvn = initial_gvn(); + set_inlining_incrementally(true); + + assert( igvn._worklist.size() == 0, "should be done with igvn" ); + for_igvn()->clear(); + gvn->replace_with(&igvn); + + while (_boxing_late_inlines.length() > 0) { + CallGenerator* cg = _boxing_late_inlines.pop(); + cg->do_late_inline(); + if (failing()) return; + } + _boxing_late_inlines.trunc_to(0); + + { + ResourceMark rm; + PhaseRemoveUseless pru(gvn, for_igvn()); + } + + igvn = PhaseIterGVN(gvn); + igvn.optimize(); + + set_inlining_progress(false); + set_inlining_incrementally(false); + } + } + void Compile::inline_incrementally_one(PhaseIterGVN& igvn) { assert(IncrementalInline, "incremental inlining should be on"); PhaseGVN* gvn = initial_gvn(); set_inlining_progress(false);
*** 1829,1839 **** --- 1873,1883 ---- } _late_inlines.trunc_to(j); { ResourceMark rm; ! PhaseRemoveUseless pru(C->initial_gvn(), C->for_igvn()); ! PhaseRemoveUseless pru(gvn, for_igvn()); } igvn = PhaseIterGVN(gvn); }
*** 1927,1942 **** --- 1971,1999 ---- print_method("Iter GVN 1", 2); if (failing()) return; + { + NOT_PRODUCT( TracePhase t2("incrementalInline", &_t_incrInline, TimeCompiler); ) inline_incrementally(igvn); + } print_method("Incremental Inline", 2); if (failing()) return; + if (eliminate_boxing()) { + NOT_PRODUCT( TracePhase t2("incrementalInline", &_t_incrInline, TimeCompiler); ) + // Inline valueOf() methods now. + inline_boxing_calls(igvn); + + print_method("Incremental Boxing Inline", 2); + + if (failing()) return; + } + // No more new expensive nodes will be added to the list from here // so keep only the actual candidates for optimizations. cleanup_expensive_nodes(igvn); // Perform escape analysis
*** 2894,2903 **** --- 2951,2961 ---- in2->disconnect_inputs(NULL, this); } } break; case Op_MemBarStoreStore: + case Op_MemBarRelease: // Break the link with AllocateNode: it is no longer useful and // confuses register allocation. if (n->req() > MemBarNode::Precedent) { n->set_req(MemBarNode::Precedent, top()); }

src/share/vm/opto/compile.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File