src/share/vm/opto/compile.hpp

Print this page
rev 5685 : 8028128: Add a type safe alternative for working with counter based data
Reviewed-by:


  25 #ifndef SHARE_VM_OPTO_COMPILE_HPP
  26 #define SHARE_VM_OPTO_COMPILE_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "ci/compilerInterface.hpp"
  30 #include "code/debugInfoRec.hpp"
  31 #include "code/exceptionHandlerTable.hpp"
  32 #include "compiler/compilerOracle.hpp"
  33 #include "compiler/compileBroker.hpp"
  34 #include "libadt/dict.hpp"
  35 #include "libadt/port.hpp"
  36 #include "libadt/vectset.hpp"
  37 #include "memory/resourceArea.hpp"
  38 #include "opto/idealGraphPrinter.hpp"
  39 #include "opto/phasetype.hpp"
  40 #include "opto/phase.hpp"
  41 #include "opto/regmask.hpp"
  42 #include "runtime/deoptimization.hpp"
  43 #include "runtime/vmThread.hpp"
  44 #include "trace/tracing.hpp"

  45 
  46 class Block;
  47 class Bundle;
  48 class C2Compiler;
  49 class CallGenerator;
  50 class ConnectionGraph;
  51 class InlineTree;
  52 class Int_Array;
  53 class Matcher;
  54 class MachConstantNode;
  55 class MachConstantBaseNode;
  56 class MachNode;
  57 class MachOper;
  58 class MachSafePointNode;
  59 class Node;
  60 class Node_Array;
  61 class Node_Notes;
  62 class OptoReg;
  63 class PhaseCFG;
  64 class PhaseGVN;


 580   bool              print_assembly() const       { return _print_assembly; }
 581   void          set_print_assembly(bool z)       { _print_assembly = z; }
 582   bool              print_inlining() const       { return _print_inlining; }
 583   void          set_print_inlining(bool z)       { _print_inlining = z; }
 584   bool              print_intrinsics() const     { return _print_intrinsics; }
 585   void          set_print_intrinsics(bool z)     { _print_intrinsics = z; }
 586   // check the CompilerOracle for special behaviours for this compile
 587   bool          method_has_option(const char * option) {
 588     return method() != NULL && method()->has_option(option);
 589   }
 590 #ifndef PRODUCT
 591   bool          trace_opto_output() const       { return _trace_opto_output; }
 592   bool              parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
 593   void          set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
 594 #endif
 595 
 596   // JSR 292
 597   bool              has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 598   void          set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 599 
 600   jlong _latest_stage_start_counter;
 601 
 602   void begin_method() {
 603 #ifndef PRODUCT
 604     if (_printer) _printer->begin_method(this);
 605 #endif
 606     C->_latest_stage_start_counter = os::elapsed_counter();
 607   }
 608 
 609   void print_method(CompilerPhaseType cpt, int level = 1) {
 610     EventCompilerPhase event(UNTIMED);
 611     if (event.should_commit()) {
 612       event.set_starttime(C->_latest_stage_start_counter);
 613       event.set_endtime(os::elapsed_counter());
 614       event.set_phase((u1) cpt);
 615       event.set_compileID(C->_compile_id);
 616       event.set_phaseLevel(level);
 617       event.commit();
 618     }
 619 
 620 
 621 #ifndef PRODUCT
 622     if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
 623 #endif
 624     C->_latest_stage_start_counter = os::elapsed_counter();
 625   }
 626 
 627   void end_method(int level = 1) {
 628     EventCompilerPhase event(UNTIMED);
 629     if (event.should_commit()) {
 630       event.set_starttime(C->_latest_stage_start_counter);
 631       event.set_endtime(os::elapsed_counter());
 632       event.set_phase((u1) PHASE_END);
 633       event.set_compileID(C->_compile_id);
 634       event.set_phaseLevel(level);
 635       event.commit();
 636     }
 637 #ifndef PRODUCT
 638     if (_printer) _printer->end_method();
 639 #endif
 640   }
 641 
 642   int           macro_count()             const { return _macro_nodes->length(); }
 643   int           predicate_count()         const { return _predicate_opaqs->length();}
 644   int           expensive_count()         const { return _expensive_nodes->length(); }
 645   Node*         macro_node(int idx)       const { return _macro_nodes->at(idx); }
 646   Node*         predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);}
 647   Node*         expensive_node(int idx)   const { return _expensive_nodes->at(idx); }
 648   ConnectionGraph* congraph()                   { return _congraph;}
 649   void set_congraph(ConnectionGraph* congraph)  { _congraph = congraph;}
 650   void add_macro_node(Node * n) {
 651     //assert(n->is_macro(), "must be a macro node");




  25 #ifndef SHARE_VM_OPTO_COMPILE_HPP
  26 #define SHARE_VM_OPTO_COMPILE_HPP
  27 
  28 #include "asm/codeBuffer.hpp"
  29 #include "ci/compilerInterface.hpp"
  30 #include "code/debugInfoRec.hpp"
  31 #include "code/exceptionHandlerTable.hpp"
  32 #include "compiler/compilerOracle.hpp"
  33 #include "compiler/compileBroker.hpp"
  34 #include "libadt/dict.hpp"
  35 #include "libadt/port.hpp"
  36 #include "libadt/vectset.hpp"
  37 #include "memory/resourceArea.hpp"
  38 #include "opto/idealGraphPrinter.hpp"
  39 #include "opto/phasetype.hpp"
  40 #include "opto/phase.hpp"
  41 #include "opto/regmask.hpp"
  42 #include "runtime/deoptimization.hpp"
  43 #include "runtime/vmThread.hpp"
  44 #include "trace/tracing.hpp"
  45 #include "utilities/ticks.hpp"
  46 
  47 class Block;
  48 class Bundle;
  49 class C2Compiler;
  50 class CallGenerator;
  51 class ConnectionGraph;
  52 class InlineTree;
  53 class Int_Array;
  54 class Matcher;
  55 class MachConstantNode;
  56 class MachConstantBaseNode;
  57 class MachNode;
  58 class MachOper;
  59 class MachSafePointNode;
  60 class Node;
  61 class Node_Array;
  62 class Node_Notes;
  63 class OptoReg;
  64 class PhaseCFG;
  65 class PhaseGVN;


 581   bool              print_assembly() const       { return _print_assembly; }
 582   void          set_print_assembly(bool z)       { _print_assembly = z; }
 583   bool              print_inlining() const       { return _print_inlining; }
 584   void          set_print_inlining(bool z)       { _print_inlining = z; }
 585   bool              print_intrinsics() const     { return _print_intrinsics; }
 586   void          set_print_intrinsics(bool z)     { _print_intrinsics = z; }
 587   // check the CompilerOracle for special behaviours for this compile
 588   bool          method_has_option(const char * option) {
 589     return method() != NULL && method()->has_option(option);
 590   }
 591 #ifndef PRODUCT
 592   bool          trace_opto_output() const       { return _trace_opto_output; }
 593   bool              parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
 594   void          set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
 595 #endif
 596 
 597   // JSR 292
 598   bool              has_method_handle_invokes() const { return _has_method_handle_invokes;     }
 599   void          set_has_method_handle_invokes(bool z) {        _has_method_handle_invokes = z; }
 600 
 601   Ticks _latest_stage_start_counter;
 602 
 603   void begin_method() {
 604 #ifndef PRODUCT
 605     if (_printer) _printer->begin_method(this);
 606 #endif
 607     C->_latest_stage_start_counter.stamp();
 608   }
 609 
 610   void print_method(CompilerPhaseType cpt, int level = 1) {
 611     EventCompilerPhase event;
 612     if (event.should_commit()) {
 613       event.set_starttime(C->_latest_stage_start_counter);

 614       event.set_phase((u1) cpt);
 615       event.set_compileID(C->_compile_id);
 616       event.set_phaseLevel(level);
 617       event.commit();
 618     }
 619 
 620 
 621 #ifndef PRODUCT
 622     if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
 623 #endif
 624     C->_latest_stage_start_counter.stamp();
 625   }
 626 
 627   void end_method(int level = 1) {
 628     EventCompilerPhase event;
 629     if (event.should_commit()) {
 630       event.set_starttime(C->_latest_stage_start_counter);

 631       event.set_phase((u1) PHASE_END);
 632       event.set_compileID(C->_compile_id);
 633       event.set_phaseLevel(level);
 634       event.commit();
 635     }
 636 #ifndef PRODUCT
 637     if (_printer) _printer->end_method();
 638 #endif
 639   }
 640 
 641   int           macro_count()             const { return _macro_nodes->length(); }
 642   int           predicate_count()         const { return _predicate_opaqs->length();}
 643   int           expensive_count()         const { return _expensive_nodes->length(); }
 644   Node*         macro_node(int idx)       const { return _macro_nodes->at(idx); }
 645   Node*         predicate_opaque1_node(int idx) const { return _predicate_opaqs->at(idx);}
 646   Node*         expensive_node(int idx)   const { return _expensive_nodes->at(idx); }
 647   ConnectionGraph* congraph()                   { return _congraph;}
 648   void set_congraph(ConnectionGraph* congraph)  { _congraph = congraph;}
 649   void add_macro_node(Node * n) {
 650     //assert(n->is_macro(), "must be a macro node");