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

src/share/vm/opto/compile.hpp

Print this page




 295 
 296   int                   _major_progress;        // Count of something big happening
 297   bool                  _inlining_progress;     // progress doing incremental inlining?
 298   bool                  _inlining_incrementally;// Are we doing incremental inlining (post parse)
 299   bool                  _has_loops;             // True if the method _may_ have some loops
 300   bool                  _has_split_ifs;         // True if the method _may_ have some split-if
 301   bool                  _has_unsafe_access;     // True if the method _may_ produce faults in unsafe loads or stores.
 302   bool                  _has_stringbuilder;     // True StringBuffers or StringBuilders are allocated
 303   bool                  _has_boxed_value;       // True if a boxed object is allocated
 304   int                   _max_vector_size;       // Maximum size of generated vectors
 305   uint                  _trap_hist[trapHistLength];  // Cumulative traps
 306   bool                  _trap_can_recompile;    // Have we emitted a recompiling trap?
 307   uint                  _decompile_count;       // Cumulative decompilation counts.
 308   bool                  _do_inlining;           // True if we intend to do inlining
 309   bool                  _do_scheduling;         // True if we intend to do scheduling
 310   bool                  _do_freq_based_layout;  // True if we intend to do frequency based block layout
 311   bool                  _do_count_invocations;  // True if we generate code to count invocations
 312   bool                  _do_method_data_update; // True if we generate code to update MethodData*s
 313   int                   _AliasLevel;            // Locally-adjusted version of AliasLevel flag.
 314   bool                  _print_assembly;        // True if we should dump assembly code for this compilation


 315 #ifndef PRODUCT
 316   bool                  _trace_opto_output;
 317   bool                  _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
 318 #endif
 319 
 320   // JSR 292
 321   bool                  _has_method_handle_invokes; // True if this method has MethodHandle invokes.
 322 
 323   // Compilation environment.
 324   Arena                 _comp_arena;            // Arena with lifetime equivalent to Compile
 325   ciEnv*                _env;                   // CI interface
 326   CompileLog*           _log;                   // from CompilerThread
 327   const char*           _failure_reason;        // for record_failure/failing pattern
 328   GrowableArray<CallGenerator*>* _intrinsics;   // List of intrinsics.
 329   GrowableArray<Node*>* _macro_nodes;           // List of nodes which need to be expanded before matching.
 330   GrowableArray<Node*>* _predicate_opaqs;       // List of Opaque1 nodes for the loop predicates.
 331   GrowableArray<Node*>* _expensive_nodes;       // List of nodes that are expensive to compute and that we'd better not let the GVN freely common
 332   ConnectionGraph*      _congraph;
 333 #ifndef PRODUCT
 334   IdealGraphPrinter*    _printer;


 397 
 398 
 399   // Inlining may not happen in parse order which would make
 400   // PrintInlining output confusing. Keep track of PrintInlining
 401   // pieces in order.
 402   class PrintInliningBuffer : public ResourceObj {
 403    private:
 404     CallGenerator* _cg;
 405     stringStream* _ss;
 406 
 407    public:
 408     PrintInliningBuffer()
 409       : _cg(NULL) { _ss = new stringStream(); }
 410 
 411     stringStream* ss() const { return _ss; }
 412     CallGenerator* cg() const { return _cg; }
 413     void set_cg(CallGenerator* cg) { _cg = cg; }
 414   };
 415 
 416   GrowableArray<PrintInliningBuffer>* _print_inlining_list;
 417   int _print_inlining;
 418 
 419   // Only keep nodes in the expensive node list that need to be optimized
 420   void cleanup_expensive_nodes(PhaseIterGVN &igvn);
 421   // Use for sorting expensive nodes to bring similar nodes together
 422   static int cmp_expensive_nodes(Node** n1, Node** n2);
 423   // Expensive nodes list already sorted?
 424   bool expensive_nodes_sorted() const;
 425 
 426  public:
 427 
 428   outputStream* print_inlining_stream() const {
 429     return _print_inlining_list->at(_print_inlining).ss();
 430   }
 431 
 432   void print_inlining_skip(CallGenerator* cg) {
 433     if (PrintInlining) {
 434       _print_inlining_list->at(_print_inlining).set_cg(cg);
 435       _print_inlining++;
 436       _print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer());
 437     }
 438   }
 439 
 440   void print_inlining_insert(CallGenerator* cg) {
 441     if (PrintInlining) {
 442       for (int i = 0; i < _print_inlining_list->length(); i++) {
 443         if (_print_inlining_list->at(i).cg() == cg) {
 444           _print_inlining_list->insert_before(i+1, PrintInliningBuffer());
 445           _print_inlining = i+1;
 446           _print_inlining_list->at(i).set_cg(NULL);
 447           return;
 448         }
 449       }
 450       ShouldNotReachHere();
 451     }
 452   }
 453 
 454   void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
 455     stringStream ss;
 456     CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
 457     print_inlining_stream()->print(ss.as_string());
 458   }
 459 
 460  private:
 461   // Matching, CFG layout, allocation, code generation
 462   PhaseCFG*             _cfg;                   // Results of CFG finding
 463   bool                  _select_24_bit_instr;   // We selected an instruction with a 24-bit result
 464   bool                  _in_24_bit_fp_mode;     // We are emitting instructions with 24-bit results
 465   int                   _java_calls;            // Number of java calls in the method
 466   int                   _inner_loops;           // Number of inner loops in the method


 555   void          set_trap_count(uint r, uint c)  { assert(r < trapHistLength, "oob");        _trap_hist[r] = c; }
 556   uint              trap_count(uint r) const    { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }
 557   bool              trap_can_recompile() const  { return _trap_can_recompile; }
 558   void          set_trap_can_recompile(bool z)  { _trap_can_recompile = z; }
 559   uint              decompile_count() const     { return _decompile_count; }
 560   void          set_decompile_count(uint c)     { _decompile_count = c; }
 561   bool              allow_range_check_smearing() const;
 562   bool              do_inlining() const         { return _do_inlining; }
 563   void          set_do_inlining(bool z)         { _do_inlining = z; }
 564   bool              do_scheduling() const       { return _do_scheduling; }
 565   void          set_do_scheduling(bool z)       { _do_scheduling = z; }
 566   bool              do_freq_based_layout() const{ return _do_freq_based_layout; }
 567   void          set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }
 568   bool              do_count_invocations() const{ return _do_count_invocations; }
 569   void          set_do_count_invocations(bool z){ _do_count_invocations = z; }
 570   bool              do_method_data_update() const { return _do_method_data_update; }
 571   void          set_do_method_data_update(bool z) { _do_method_data_update = z; }
 572   int               AliasLevel() const          { return _AliasLevel; }
 573   bool              print_assembly() const       { return _print_assembly; }
 574   void          set_print_assembly(bool z)       { _print_assembly = z; }




 575   // check the CompilerOracle for special behaviours for this compile
 576   bool          method_has_option(const char * option) {
 577     return method() != NULL && method()->has_option(option);
 578   }
 579 #ifndef PRODUCT
 580   bool          trace_opto_output() const       { return _trace_opto_output; }
 581   bool              parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
 582   void          set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
 583 #endif
 584 
 585   // JSR 292
 586   bool              has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 587   void          set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 588 
 589   jlong _latest_stage_start_counter;
 590 
 591   void begin_method() {
 592 #ifndef PRODUCT
 593     if (_printer) _printer->begin_method(this);
 594 #endif




 295 
 296   int                   _major_progress;        // Count of something big happening
 297   bool                  _inlining_progress;     // progress doing incremental inlining?
 298   bool                  _inlining_incrementally;// Are we doing incremental inlining (post parse)
 299   bool                  _has_loops;             // True if the method _may_ have some loops
 300   bool                  _has_split_ifs;         // True if the method _may_ have some split-if
 301   bool                  _has_unsafe_access;     // True if the method _may_ produce faults in unsafe loads or stores.
 302   bool                  _has_stringbuilder;     // True StringBuffers or StringBuilders are allocated
 303   bool                  _has_boxed_value;       // True if a boxed object is allocated
 304   int                   _max_vector_size;       // Maximum size of generated vectors
 305   uint                  _trap_hist[trapHistLength];  // Cumulative traps
 306   bool                  _trap_can_recompile;    // Have we emitted a recompiling trap?
 307   uint                  _decompile_count;       // Cumulative decompilation counts.
 308   bool                  _do_inlining;           // True if we intend to do inlining
 309   bool                  _do_scheduling;         // True if we intend to do scheduling
 310   bool                  _do_freq_based_layout;  // True if we intend to do frequency based block layout
 311   bool                  _do_count_invocations;  // True if we generate code to count invocations
 312   bool                  _do_method_data_update; // True if we generate code to update MethodData*s
 313   int                   _AliasLevel;            // Locally-adjusted version of AliasLevel flag.
 314   bool                  _print_assembly;        // True if we should dump assembly code for this compilation
 315   bool                  _print_inlining;        // True if we should print inlining for this compilation
 316   bool                  _print_intrinsics;      // True if we should print intrinsics for this compilation
 317 #ifndef PRODUCT
 318   bool                  _trace_opto_output;
 319   bool                  _parsed_irreducible_loop; // True if ciTypeFlow detected irreducible loops during parsing
 320 #endif
 321 
 322   // JSR 292
 323   bool                  _has_method_handle_invokes; // True if this method has MethodHandle invokes.
 324 
 325   // Compilation environment.
 326   Arena                 _comp_arena;            // Arena with lifetime equivalent to Compile
 327   ciEnv*                _env;                   // CI interface
 328   CompileLog*           _log;                   // from CompilerThread
 329   const char*           _failure_reason;        // for record_failure/failing pattern
 330   GrowableArray<CallGenerator*>* _intrinsics;   // List of intrinsics.
 331   GrowableArray<Node*>* _macro_nodes;           // List of nodes which need to be expanded before matching.
 332   GrowableArray<Node*>* _predicate_opaqs;       // List of Opaque1 nodes for the loop predicates.
 333   GrowableArray<Node*>* _expensive_nodes;       // List of nodes that are expensive to compute and that we'd better not let the GVN freely common
 334   ConnectionGraph*      _congraph;
 335 #ifndef PRODUCT
 336   IdealGraphPrinter*    _printer;


 399 
 400 
 401   // Inlining may not happen in parse order which would make
 402   // PrintInlining output confusing. Keep track of PrintInlining
 403   // pieces in order.
 404   class PrintInliningBuffer : public ResourceObj {
 405    private:
 406     CallGenerator* _cg;
 407     stringStream* _ss;
 408 
 409    public:
 410     PrintInliningBuffer()
 411       : _cg(NULL) { _ss = new stringStream(); }
 412 
 413     stringStream* ss() const { return _ss; }
 414     CallGenerator* cg() const { return _cg; }
 415     void set_cg(CallGenerator* cg) { _cg = cg; }
 416   };
 417 
 418   GrowableArray<PrintInliningBuffer>* _print_inlining_list;
 419   int _print_inlining_idx;
 420 
 421   // Only keep nodes in the expensive node list that need to be optimized
 422   void cleanup_expensive_nodes(PhaseIterGVN &igvn);
 423   // Use for sorting expensive nodes to bring similar nodes together
 424   static int cmp_expensive_nodes(Node** n1, Node** n2);
 425   // Expensive nodes list already sorted?
 426   bool expensive_nodes_sorted() const;
 427 
 428  public:
 429 
 430   outputStream* print_inlining_stream() const {
 431     return _print_inlining_list->adr_at(_print_inlining_idx)->ss();
 432   }
 433 
 434   void print_inlining_skip(CallGenerator* cg) {
 435     if (_print_inlining) {
 436       _print_inlining_list->adr_at(_print_inlining_idx)->set_cg(cg);
 437       _print_inlining_idx++;
 438       _print_inlining_list->insert_before(_print_inlining_idx, PrintInliningBuffer());
 439     }
 440   }
 441 
 442   void print_inlining_insert(CallGenerator* cg) {
 443     if (_print_inlining) {
 444       for (int i = 0; i < _print_inlining_list->length(); i++) {
 445         if (_print_inlining_list->adr_at(i)->cg() == cg) {
 446           _print_inlining_list->insert_before(i+1, PrintInliningBuffer());
 447           _print_inlining_idx = i+1;
 448           _print_inlining_list->adr_at(i)->set_cg(NULL);
 449           return;
 450         }
 451       }
 452       ShouldNotReachHere();
 453     }
 454   }
 455 
 456   void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
 457     stringStream ss;
 458     CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
 459     print_inlining_stream()->print(ss.as_string());
 460   }
 461 
 462  private:
 463   // Matching, CFG layout, allocation, code generation
 464   PhaseCFG*             _cfg;                   // Results of CFG finding
 465   bool                  _select_24_bit_instr;   // We selected an instruction with a 24-bit result
 466   bool                  _in_24_bit_fp_mode;     // We are emitting instructions with 24-bit results
 467   int                   _java_calls;            // Number of java calls in the method
 468   int                   _inner_loops;           // Number of inner loops in the method


 557   void          set_trap_count(uint r, uint c)  { assert(r < trapHistLength, "oob");        _trap_hist[r] = c; }
 558   uint              trap_count(uint r) const    { assert(r < trapHistLength, "oob"); return _trap_hist[r]; }
 559   bool              trap_can_recompile() const  { return _trap_can_recompile; }
 560   void          set_trap_can_recompile(bool z)  { _trap_can_recompile = z; }
 561   uint              decompile_count() const     { return _decompile_count; }
 562   void          set_decompile_count(uint c)     { _decompile_count = c; }
 563   bool              allow_range_check_smearing() const;
 564   bool              do_inlining() const         { return _do_inlining; }
 565   void          set_do_inlining(bool z)         { _do_inlining = z; }
 566   bool              do_scheduling() const       { return _do_scheduling; }
 567   void          set_do_scheduling(bool z)       { _do_scheduling = z; }
 568   bool              do_freq_based_layout() const{ return _do_freq_based_layout; }
 569   void          set_do_freq_based_layout(bool z){ _do_freq_based_layout = z; }
 570   bool              do_count_invocations() const{ return _do_count_invocations; }
 571   void          set_do_count_invocations(bool z){ _do_count_invocations = z; }
 572   bool              do_method_data_update() const { return _do_method_data_update; }
 573   void          set_do_method_data_update(bool z) { _do_method_data_update = z; }
 574   int               AliasLevel() const          { return _AliasLevel; }
 575   bool              print_assembly() const       { return _print_assembly; }
 576   void          set_print_assembly(bool z)       { _print_assembly = z; }
 577   bool              print_inlining() const       { return _print_inlining; }
 578   void          set_print_inlining(bool z)       { _print_inlining = z; }
 579   bool              print_intrinsics() const     { return _print_intrinsics; }
 580   void          set_print_intrinsics(bool z)     { _print_intrinsics = z; }
 581   // check the CompilerOracle for special behaviours for this compile
 582   bool          method_has_option(const char * option) {
 583     return method() != NULL && method()->has_option(option);
 584   }
 585 #ifndef PRODUCT
 586   bool          trace_opto_output() const       { return _trace_opto_output; }
 587   bool              parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
 588   void          set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
 589 #endif
 590 
 591   // JSR 292
 592   bool              has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 593   void          set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 594 
 595   jlong _latest_stage_start_counter;
 596 
 597   void begin_method() {
 598 #ifndef PRODUCT
 599     if (_printer) _printer->begin_method(this);
 600 #endif


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