src/share/vm/opto/compile.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/compile.hpp

Print this page
rev 6447 : 8043638: Multiple compilation attempts break LogCompulation, lead to confusing PrintInlining output
Summary: dumps inlining only for last compilation attempt. Fix LogCompilation tool so it handles multiple compilation attempts.
Reviewed-by:


 403   // Inlining may not happen in parse order which would make
 404   // PrintInlining output confusing. Keep track of PrintInlining
 405   // pieces in order.
 406   class PrintInliningBuffer : public ResourceObj {
 407    private:
 408     CallGenerator* _cg;
 409     stringStream* _ss;
 410 
 411    public:
 412     PrintInliningBuffer()
 413       : _cg(NULL) { _ss = new stringStream(); }
 414 
 415     stringStream* ss() const { return _ss; }
 416     CallGenerator* cg() const { return _cg; }
 417     void set_cg(CallGenerator* cg) { _cg = cg; }
 418   };
 419 
 420   stringStream* _print_inlining_stream;
 421   GrowableArray<PrintInliningBuffer>* _print_inlining_list;
 422   int _print_inlining_idx;

 423 
 424   // Only keep nodes in the expensive node list that need to be optimized
 425   void cleanup_expensive_nodes(PhaseIterGVN &igvn);
 426   // Use for sorting expensive nodes to bring similar nodes together
 427   static int cmp_expensive_nodes(Node** n1, Node** n2);
 428   // Expensive nodes list already sorted?
 429   bool expensive_nodes_sorted() const;
 430   // Remove the speculative part of types and clean up the graph
 431   void remove_speculative_types(PhaseIterGVN &igvn);
 432 
 433   // Are we within a PreserveJVMState block?
 434   int _preserve_jvm_state;
 435 
 436   void* _replay_inline_data; // Pointer to data loaded from file
 437 
 438   void print_inlining_init();
 439   void print_inlining_reinit();
 440   void print_inlining_commit();
 441   void print_inlining_push();
 442   PrintInliningBuffer& print_inlining_current();


 900   // Record this CallGenerator for inlining at the end of parsing.
 901   void              add_late_inline(CallGenerator* cg)        {
 902     _late_inlines.insert_before(_late_inlines_pos, cg);
 903     _late_inlines_pos++;
 904   }
 905 
 906   void              prepend_late_inline(CallGenerator* cg)    {
 907     _late_inlines.insert_before(0, cg);
 908   }
 909 
 910   void              add_string_late_inline(CallGenerator* cg) {
 911     _string_late_inlines.push(cg);
 912   }
 913 
 914   void              add_boxing_late_inline(CallGenerator* cg) {
 915     _boxing_late_inlines.push(cg);
 916   }
 917 
 918   void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Unique_Node_List &useful);
 919 
 920   void dump_inlining();

 921 
 922   bool over_inlining_cutoff() const {
 923     if (!inlining_incrementally()) {
 924       return unique() > (uint)NodeCountInliningCutoff;
 925     } else {
 926       return live_nodes() > (uint)LiveNodeCountInliningCutoff;
 927     }
 928   }
 929 
 930   void inc_number_of_mh_late_inlines() { _number_of_mh_late_inlines++; }
 931   void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }
 932   bool has_mh_late_inlines() const     { return _number_of_mh_late_inlines > 0; }
 933 
 934   void inline_incrementally_one(PhaseIterGVN& igvn);
 935   void inline_incrementally(PhaseIterGVN& igvn);
 936   void inline_string_calls(bool parse_time);
 937   void inline_boxing_calls(PhaseIterGVN& igvn);
 938 
 939   // Matching, CFG layout, allocation, code generation
 940   PhaseCFG*         cfg()                       { return _cfg; }




 403   // Inlining may not happen in parse order which would make
 404   // PrintInlining output confusing. Keep track of PrintInlining
 405   // pieces in order.
 406   class PrintInliningBuffer : public ResourceObj {
 407    private:
 408     CallGenerator* _cg;
 409     stringStream* _ss;
 410 
 411    public:
 412     PrintInliningBuffer()
 413       : _cg(NULL) { _ss = new stringStream(); }
 414 
 415     stringStream* ss() const { return _ss; }
 416     CallGenerator* cg() const { return _cg; }
 417     void set_cg(CallGenerator* cg) { _cg = cg; }
 418   };
 419 
 420   stringStream* _print_inlining_stream;
 421   GrowableArray<PrintInliningBuffer>* _print_inlining_list;
 422   int _print_inlining_idx;
 423   char* _print_inlining_output;
 424 
 425   // Only keep nodes in the expensive node list that need to be optimized
 426   void cleanup_expensive_nodes(PhaseIterGVN &igvn);
 427   // Use for sorting expensive nodes to bring similar nodes together
 428   static int cmp_expensive_nodes(Node** n1, Node** n2);
 429   // Expensive nodes list already sorted?
 430   bool expensive_nodes_sorted() const;
 431   // Remove the speculative part of types and clean up the graph
 432   void remove_speculative_types(PhaseIterGVN &igvn);
 433 
 434   // Are we within a PreserveJVMState block?
 435   int _preserve_jvm_state;
 436 
 437   void* _replay_inline_data; // Pointer to data loaded from file
 438 
 439   void print_inlining_init();
 440   void print_inlining_reinit();
 441   void print_inlining_commit();
 442   void print_inlining_push();
 443   PrintInliningBuffer& print_inlining_current();


 901   // Record this CallGenerator for inlining at the end of parsing.
 902   void              add_late_inline(CallGenerator* cg)        {
 903     _late_inlines.insert_before(_late_inlines_pos, cg);
 904     _late_inlines_pos++;
 905   }
 906 
 907   void              prepend_late_inline(CallGenerator* cg)    {
 908     _late_inlines.insert_before(0, cg);
 909   }
 910 
 911   void              add_string_late_inline(CallGenerator* cg) {
 912     _string_late_inlines.push(cg);
 913   }
 914 
 915   void              add_boxing_late_inline(CallGenerator* cg) {
 916     _boxing_late_inlines.push(cg);
 917   }
 918 
 919   void remove_useless_late_inlines(GrowableArray<CallGenerator*>* inlines, Unique_Node_List &useful);
 920 
 921   void process_print_inlining();
 922   void dump_print_inlining();
 923 
 924   bool over_inlining_cutoff() const {
 925     if (!inlining_incrementally()) {
 926       return unique() > (uint)NodeCountInliningCutoff;
 927     } else {
 928       return live_nodes() > (uint)LiveNodeCountInliningCutoff;
 929     }
 930   }
 931 
 932   void inc_number_of_mh_late_inlines() { _number_of_mh_late_inlines++; }
 933   void dec_number_of_mh_late_inlines() { assert(_number_of_mh_late_inlines > 0, "_number_of_mh_late_inlines < 0 !"); _number_of_mh_late_inlines--; }
 934   bool has_mh_late_inlines() const     { return _number_of_mh_late_inlines > 0; }
 935 
 936   void inline_incrementally_one(PhaseIterGVN& igvn);
 937   void inline_incrementally(PhaseIterGVN& igvn);
 938   void inline_string_calls(bool parse_time);
 939   void inline_boxing_calls(PhaseIterGVN& igvn);
 940 
 941   // Matching, CFG layout, allocation, code generation
 942   PhaseCFG*         cfg()                       { return _cfg; }


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