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

src/share/vm/opto/parse.hpp

Print this page




  24 
  25 #ifndef SHARE_VM_OPTO_PARSE_HPP
  26 #define SHARE_VM_OPTO_PARSE_HPP
  27 
  28 #include "ci/ciMethodData.hpp"
  29 #include "ci/ciTypeFlow.hpp"
  30 #include "compiler/methodLiveness.hpp"
  31 #include "libadt/vectset.hpp"
  32 #include "oops/generateOopMap.hpp"
  33 #include "opto/graphKit.hpp"
  34 #include "opto/subnode.hpp"
  35 
  36 class BytecodeParseHistogram;
  37 class InlineTree;
  38 class Parse;
  39 class SwitchRange;
  40 
  41 
  42 //------------------------------InlineTree-------------------------------------
  43 class InlineTree : public ResourceObj {


  44   Compile*    C;                  // cache
  45   JVMState*   _caller_jvms;       // state of caller
  46   ciMethod*   _method;            // method being called by the caller_jvms
  47   InlineTree* _caller_tree;
  48   uint        _count_inline_bcs;  // Accumulated count of inlined bytecodes
  49   // Call-site count / interpreter invocation count, scaled recursively.
  50   // Always between 0.0 and 1.0.  Represents the percentage of the method's
  51   // total execution time used at this call site.
  52   const float _site_invoke_ratio;
  53   const int   _max_inline_level;  // the maximum inline level for this sub-tree (may be adjusted)
  54   float compute_callee_frequency( int caller_bci ) const;
  55 
  56   GrowableArray<InlineTree*> _subtrees;
  57   friend class Compile;
  58 


  59 protected:
  60   InlineTree(Compile* C,
  61              const InlineTree* caller_tree,
  62              ciMethod* callee_method,
  63              JVMState* caller_jvms,
  64              int caller_bci,
  65              float site_invoke_ratio,
  66              int max_inline_level);
  67   InlineTree *build_inline_tree_for_callee(ciMethod* callee_method,
  68                                            JVMState* caller_jvms,
  69                                            int caller_bci);
  70   const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result);
  71   const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const;
  72   const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const;
  73   void        print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const;
  74 
  75   InlineTree *caller_tree()       const { return _caller_tree;  }
  76   InlineTree* callee_at(int bci, ciMethod* m) const;
  77   int         inline_level()      const { return stack_depth(); }
  78   int         stack_depth()       const { return _caller_jvms ? _caller_jvms->depth() : 0; }


 104   // and may be accessed by find_subtree_from_root.
 105   // The call_method is the dest_method for a special or static invocation.
 106   // The call_method is an optimized virtual method candidate otherwise.
 107   WarmCallInfo* ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, WarmCallInfo* wci);
 108 
 109   // Information about inlined method
 110   JVMState*   caller_jvms()       const { return _caller_jvms; }
 111   ciMethod   *method()            const { return _method; }
 112   int         caller_bci()        const { return _caller_jvms ? _caller_jvms->bci() : InvocationEntryBci; }
 113   uint        count_inline_bcs()  const { return _count_inline_bcs; }
 114   float       site_invoke_ratio() const { return _site_invoke_ratio; };
 115 
 116 #ifndef PRODUCT
 117 private:
 118   uint        _count_inlines;     // Count of inlined methods
 119 public:
 120   // Debug information collected during parse
 121   uint        count_inlines()     const { return _count_inlines; };
 122 #endif
 123   GrowableArray<InlineTree*> subtrees() { return _subtrees; }


 124 };
 125 
 126 
 127 //-----------------------------------------------------------------------------
 128 //------------------------------Parse------------------------------------------
 129 // Parse bytecodes, build a Graph
 130 class Parse : public GraphKit {
 131  public:
 132   // Per-block information needed by the parser:
 133   class Block {
 134    private:
 135     ciTypeFlow::Block* _flow;
 136     int                _pred_count;     // how many predecessors in CFG?
 137     int                _preds_parsed;   // how many of these have been parsed?
 138     uint               _count;          // how many times executed?  Currently only set by _goto's
 139     bool               _is_parsed;      // has this block been parsed yet?
 140     bool               _is_handler;     // is this block an exception handler?
 141     bool               _has_merged_backedge; // does this block have merged backedge?
 142     SafePointNode*     _start_map;      // all values flowing into this block
 143     MethodLivenessResult _live_locals;  // lazily initialized liveness bitmap




  24 
  25 #ifndef SHARE_VM_OPTO_PARSE_HPP
  26 #define SHARE_VM_OPTO_PARSE_HPP
  27 
  28 #include "ci/ciMethodData.hpp"
  29 #include "ci/ciTypeFlow.hpp"
  30 #include "compiler/methodLiveness.hpp"
  31 #include "libadt/vectset.hpp"
  32 #include "oops/generateOopMap.hpp"
  33 #include "opto/graphKit.hpp"
  34 #include "opto/subnode.hpp"
  35 
  36 class BytecodeParseHistogram;
  37 class InlineTree;
  38 class Parse;
  39 class SwitchRange;
  40 
  41 
  42 //------------------------------InlineTree-------------------------------------
  43 class InlineTree : public ResourceObj {
  44   friend class VMStructs;
  45 
  46   Compile*    C;                  // cache
  47   JVMState*   _caller_jvms;       // state of caller
  48   ciMethod*   _method;            // method being called by the caller_jvms
  49   InlineTree* _caller_tree;
  50   uint        _count_inline_bcs;  // Accumulated count of inlined bytecodes
  51   // Call-site count / interpreter invocation count, scaled recursively.
  52   // Always between 0.0 and 1.0.  Represents the percentage of the method's
  53   // total execution time used at this call site.
  54   const float _site_invoke_ratio;
  55   const int   _max_inline_level;  // the maximum inline level for this sub-tree (may be adjusted)
  56   float compute_callee_frequency( int caller_bci ) const;
  57 
  58   GrowableArray<InlineTree*> _subtrees;

  59 
  60   void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
  61 
  62 protected:
  63   InlineTree(Compile* C,
  64              const InlineTree* caller_tree,
  65              ciMethod* callee_method,
  66              JVMState* caller_jvms,
  67              int caller_bci,
  68              float site_invoke_ratio,
  69              int max_inline_level);
  70   InlineTree *build_inline_tree_for_callee(ciMethod* callee_method,
  71                                            JVMState* caller_jvms,
  72                                            int caller_bci);
  73   const char* try_to_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result);
  74   const char* should_inline(ciMethod* callee_method, ciMethod* caller_method, int caller_bci, ciCallProfile& profile, WarmCallInfo* wci_result) const;
  75   const char* should_not_inline(ciMethod* callee_method, ciMethod* caller_method, WarmCallInfo* wci_result) const;
  76   void        print_inlining(ciMethod *callee_method, int caller_bci, const char *failure_msg) const;
  77 
  78   InlineTree *caller_tree()       const { return _caller_tree;  }
  79   InlineTree* callee_at(int bci, ciMethod* m) const;
  80   int         inline_level()      const { return stack_depth(); }
  81   int         stack_depth()       const { return _caller_jvms ? _caller_jvms->depth() : 0; }


 107   // and may be accessed by find_subtree_from_root.
 108   // The call_method is the dest_method for a special or static invocation.
 109   // The call_method is an optimized virtual method candidate otherwise.
 110   WarmCallInfo* ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, WarmCallInfo* wci);
 111 
 112   // Information about inlined method
 113   JVMState*   caller_jvms()       const { return _caller_jvms; }
 114   ciMethod   *method()            const { return _method; }
 115   int         caller_bci()        const { return _caller_jvms ? _caller_jvms->bci() : InvocationEntryBci; }
 116   uint        count_inline_bcs()  const { return _count_inline_bcs; }
 117   float       site_invoke_ratio() const { return _site_invoke_ratio; };
 118 
 119 #ifndef PRODUCT
 120 private:
 121   uint        _count_inlines;     // Count of inlined methods
 122 public:
 123   // Debug information collected during parse
 124   uint        count_inlines()     const { return _count_inlines; };
 125 #endif
 126   GrowableArray<InlineTree*> subtrees() { return _subtrees; }
 127 
 128   void print_value_on(outputStream* st) const PRODUCT_RETURN;
 129 };
 130 
 131 
 132 //-----------------------------------------------------------------------------
 133 //------------------------------Parse------------------------------------------
 134 // Parse bytecodes, build a Graph
 135 class Parse : public GraphKit {
 136  public:
 137   // Per-block information needed by the parser:
 138   class Block {
 139    private:
 140     ciTypeFlow::Block* _flow;
 141     int                _pred_count;     // how many predecessors in CFG?
 142     int                _preds_parsed;   // how many of these have been parsed?
 143     uint               _count;          // how many times executed?  Currently only set by _goto's
 144     bool               _is_parsed;      // has this block been parsed yet?
 145     bool               _is_handler;     // is this block an exception handler?
 146     bool               _has_merged_backedge; // does this block have merged backedge?
 147     SafePointNode*     _start_map;      // all values flowing into this block
 148     MethodLivenessResult _live_locals;  // lazily initialized liveness bitmap


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