src/share/vm/opto/parse.hpp

Thu, 16 Jan 2014 14:25:51 +0100

author
goetz
date
Thu, 16 Jan 2014 14:25:51 +0100
changeset 6502
3514ee402842
parent 5991
b2ee5dc63353
child 6503
a9becfeecd1b
permissions
-rw-r--r--

8029101: PPC64 (part 211): ordering of Independent Reads of Independent Writes
Reviewed-by: dholmes, kvn
Contributed-by: martin.doerr@sap.com

     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     8  *
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12  * version 2 for more details (a copy is included in the LICENSE file that
    13  * accompanied this code).
    14  *
    15  * You should have received a copy of the GNU General Public License version
    16  * 2 along with this work; if not, write to the Free Software Foundation,
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18  *
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    22  *
    23  */
    25 #ifndef SHARE_VM_OPTO_PARSE_HPP
    26 #define SHARE_VM_OPTO_PARSE_HPP
    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"
    36 class BytecodeParseHistogram;
    37 class InlineTree;
    38 class Parse;
    39 class SwitchRange;
    42 //------------------------------InlineTree-------------------------------------
    43 class InlineTree : public ResourceObj {
    44   friend class VMStructs;
    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;
    58   GrowableArray<InlineTree*> _subtrees;
    60   void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
    61   const char* _msg;
    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   bool        try_to_inline(ciMethod* callee_method,
    74                             ciMethod* caller_method,
    75                             int caller_bci,
    76                             JVMState* jvms,
    77                             ciCallProfile& profile,
    78                             WarmCallInfo* wci_result,
    79                             bool& should_delay);
    80   bool        should_inline(ciMethod* callee_method,
    81                             ciMethod* caller_method,
    82                             int caller_bci,
    83                             ciCallProfile& profile,
    84                             WarmCallInfo* wci_result);
    85   bool        should_not_inline(ciMethod* callee_method,
    86                                 ciMethod* caller_method,
    87                                 JVMState* jvms,
    88                                 WarmCallInfo* wci_result);
    89   void        print_inlining(ciMethod* callee_method, int caller_bci,
    90                              bool success) const;
    92   InlineTree* caller_tree()       const { return _caller_tree;  }
    93   InlineTree* callee_at(int bci, ciMethod* m) const;
    94   int         inline_level()      const { return stack_depth(); }
    95   int         stack_depth()       const { return _caller_jvms ? _caller_jvms->depth() : 0; }
    96   const char* msg()               const { return _msg; }
    97   void        set_msg(const char* msg)  { _msg = msg; }
    98 public:
    99   static const char* check_can_parse(ciMethod* callee);
   101   static InlineTree* build_inline_tree_root();
   102   static InlineTree* find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee);
   104   // For temporary (stack-allocated, stateless) ilts:
   105   InlineTree(Compile* c, ciMethod* callee_method, JVMState* caller_jvms, float site_invoke_ratio, int max_inline_level);
   107   // InlineTree enum
   108   enum InlineStyle {
   109     Inline_do_not_inline             =   0, //
   110     Inline_cha_is_monomorphic        =   1, //
   111     Inline_type_profile_monomorphic  =   2  //
   112   };
   114   // See if it is OK to inline.
   115   // The receiver is the inline tree for the caller.
   116   //
   117   // The result is a temperature indication.  If it is hot or cold,
   118   // inlining is immediate or undesirable.  Otherwise, the info block
   119   // returned is newly allocated and may be enqueued.
   120   //
   121   // If the method is inlinable, a new inline subtree is created on the fly,
   122   // and may be accessed by find_subtree_from_root.
   123   // The call_method is the dest_method for a special or static invocation.
   124   // The call_method is an optimized virtual method candidate otherwise.
   125   WarmCallInfo* ok_to_inline(ciMethod *call_method, JVMState* caller_jvms, ciCallProfile& profile, WarmCallInfo* wci, bool& should_delay);
   127   // Information about inlined method
   128   JVMState*   caller_jvms()       const { return _caller_jvms; }
   129   ciMethod   *method()            const { return _method; }
   130   int         caller_bci()        const { return _caller_jvms ? _caller_jvms->bci() : InvocationEntryBci; }
   131   uint        count_inline_bcs()  const { return _count_inline_bcs; }
   132   float       site_invoke_ratio() const { return _site_invoke_ratio; };
   134 #ifndef PRODUCT
   135 private:
   136   uint        _count_inlines;     // Count of inlined methods
   137 public:
   138   // Debug information collected during parse
   139   uint        count_inlines()     const { return _count_inlines; };
   140 #endif
   141   GrowableArray<InlineTree*> subtrees() { return _subtrees; }
   143   void print_value_on(outputStream* st) const PRODUCT_RETURN;
   144 };
   147 //-----------------------------------------------------------------------------
   148 //------------------------------Parse------------------------------------------
   149 // Parse bytecodes, build a Graph
   150 class Parse : public GraphKit {
   151  public:
   152   // Per-block information needed by the parser:
   153   class Block {
   154    private:
   155     ciTypeFlow::Block* _flow;
   156     int                _pred_count;     // how many predecessors in CFG?
   157     int                _preds_parsed;   // how many of these have been parsed?
   158     uint               _count;          // how many times executed?  Currently only set by _goto's
   159     bool               _is_parsed;      // has this block been parsed yet?
   160     bool               _is_handler;     // is this block an exception handler?
   161     bool               _has_merged_backedge; // does this block have merged backedge?
   162     SafePointNode*     _start_map;      // all values flowing into this block
   163     MethodLivenessResult _live_locals;  // lazily initialized liveness bitmap
   165     int                _num_successors; // Includes only normal control flow.
   166     int                _all_successors; // Include exception paths also.
   167     Block**            _successors;
   169     // Use init_node/init_graph to initialize Blocks.
   170     // Block() : _live_locals((uintptr_t*)NULL,0) { ShouldNotReachHere(); }
   171     Block() : _live_locals(NULL,0) { ShouldNotReachHere(); }
   173    public:
   175     // Set up the block data structure itself.
   176     void init_node(Parse* outer, int po);
   177     // Set up the block's relations to other blocks.
   178     void init_graph(Parse* outer);
   180     ciTypeFlow::Block* flow() const        { return _flow; }
   181     int pred_count() const                 { return _pred_count; }
   182     int preds_parsed() const               { return _preds_parsed; }
   183     bool is_parsed() const                 { return _is_parsed; }
   184     bool is_handler() const                { return _is_handler; }
   185     void set_count( uint x )               { _count = x; }
   186     uint count() const                     { return _count; }
   188     SafePointNode* start_map() const       { assert(is_merged(),"");   return _start_map; }
   189     void set_start_map(SafePointNode* m)   { assert(!is_merged(), ""); _start_map = m; }
   191     // True after any predecessor flows control into this block
   192     bool is_merged() const                 { return _start_map != NULL; }
   194 #ifdef ASSERT
   195     // True after backedge predecessor flows control into this block
   196     bool has_merged_backedge() const       { return _has_merged_backedge; }
   197     void mark_merged_backedge(Block* pred) {
   198       assert(is_SEL_head(), "should be loop head");
   199       if (pred != NULL && is_SEL_backedge(pred)) {
   200         assert(is_parsed(), "block should be parsed before merging backedges");
   201         _has_merged_backedge = true;
   202       }
   203     }
   204 #endif
   206     // True when all non-exception predecessors have been parsed.
   207     bool is_ready() const                  { return preds_parsed() == pred_count(); }
   209     int num_successors() const             { return _num_successors; }
   210     int all_successors() const             { return _all_successors; }
   211     Block* successor_at(int i) const {
   212       assert((uint)i < (uint)all_successors(), "");
   213       return _successors[i];
   214     }
   215     Block* successor_for_bci(int bci);
   217     int start() const                      { return flow()->start(); }
   218     int limit() const                      { return flow()->limit(); }
   219     int rpo() const                        { return flow()->rpo(); }
   220     int start_sp() const                   { return flow()->stack_size(); }
   222     bool is_loop_head() const              { return flow()->is_loop_head(); }
   223     bool is_SEL_head() const               { return flow()->is_single_entry_loop_head(); }
   224     bool is_SEL_backedge(Block* pred) const{ return is_SEL_head() && pred->rpo() >= rpo(); }
   225     bool is_invariant_local(uint i) const  {
   226       const JVMState* jvms = start_map()->jvms();
   227       if (!jvms->is_loc(i) || flow()->outer()->has_irreducible_entry()) return false;
   228       return flow()->is_invariant_local(i - jvms->locoff());
   229     }
   230     bool can_elide_SEL_phi(uint i) const  { assert(is_SEL_head(),""); return is_invariant_local(i); }
   232     const Type* peek(int off=0) const      { return stack_type_at(start_sp() - (off+1)); }
   234     const Type* stack_type_at(int i) const;
   235     const Type* local_type_at(int i) const;
   236     static const Type* get_type(ciType* t) { return Type::get_typeflow_type(t); }
   238     bool has_trap_at(int bci) const        { return flow()->has_trap() && flow()->trap_bci() == bci; }
   240     // Call this just before parsing a block.
   241     void mark_parsed() {
   242       assert(!_is_parsed, "must parse each block exactly once");
   243       _is_parsed = true;
   244     }
   246     // Return the phi/region input index for the "current" pred,
   247     // and bump the pred number.  For historical reasons these index
   248     // numbers are handed out in descending order.  The last index is
   249     // always PhiNode::Input (i.e., 1).  The value returned is known
   250     // as a "path number" because it distinguishes by which path we are
   251     // entering the block.
   252     int next_path_num() {
   253       assert(preds_parsed() < pred_count(), "too many preds?");
   254       return pred_count() - _preds_parsed++;
   255     }
   257     // Add a previously unaccounted predecessor to this block.
   258     // This operates by increasing the size of the block's region
   259     // and all its phi nodes (if any).  The value returned is a
   260     // path number ("pnum").
   261     int add_new_path();
   263     // Initialize me by recording the parser's map.  My own map must be NULL.
   264     void record_state(Parse* outer);
   265   };
   267 #ifndef PRODUCT
   268   // BytecodeParseHistogram collects number of bytecodes parsed, nodes constructed, and transformations.
   269   class BytecodeParseHistogram : public ResourceObj {
   270    private:
   271     enum BPHType {
   272       BPH_transforms,
   273       BPH_values
   274     };
   275     static bool _initialized;
   276     static uint _bytecodes_parsed [Bytecodes::number_of_codes];
   277     static uint _nodes_constructed[Bytecodes::number_of_codes];
   278     static uint _nodes_transformed[Bytecodes::number_of_codes];
   279     static uint _new_values       [Bytecodes::number_of_codes];
   281     Bytecodes::Code _initial_bytecode;
   282     int             _initial_node_count;
   283     int             _initial_transforms;
   284     int             _initial_values;
   286     Parse     *_parser;
   287     Compile   *_compiler;
   289     // Initialization
   290     static void reset();
   292     // Return info being collected, select with global flag 'BytecodeParseInfo'
   293     int current_count(BPHType info_selector);
   295    public:
   296     BytecodeParseHistogram(Parse *p, Compile *c);
   297     static bool initialized();
   299     // Record info when starting to parse one bytecode
   300     void set_initial_state( Bytecodes::Code bc );
   301     // Record results of parsing one bytecode
   302     void record_change();
   304     // Profile printing
   305     static void print(float cutoff = 0.01F); // cutoff in percent
   306   };
   308   public:
   309     // Record work done during parsing
   310     BytecodeParseHistogram* _parse_histogram;
   311     void set_parse_histogram(BytecodeParseHistogram *bph) { _parse_histogram = bph; }
   312     BytecodeParseHistogram* parse_histogram()      { return _parse_histogram; }
   313 #endif
   315  private:
   316   friend class Block;
   318   // Variables which characterize this compilation as a whole:
   320   JVMState*     _caller;        // JVMS which carries incoming args & state.
   321   float         _expected_uses; // expected number of calls to this code
   322   float         _prof_factor;   // discount applied to my profile counts
   323   int           _depth;         // Inline tree depth, for debug printouts
   324   const TypeFunc*_tf;           // My kind of function type
   325   int           _entry_bci;     // the osr bci or InvocationEntryBci
   327   ciTypeFlow*   _flow;          // Results of previous flow pass.
   328   Block*        _blocks;        // Array of basic-block structs.
   329   int           _block_count;   // Number of elements in _blocks.
   331   GraphKit      _exits;         // Record all normal returns and throws here.
   332   bool          _wrote_final;   // Did we write a final field?
   333   bool          _wrote_volatile;     // Did we write a volatile field?
   334   bool          _count_invocations;  // update and test invocation counter
   335   bool          _method_data_update; // update method data oop
   336   Node*         _alloc_with_final;   // An allocation node with final field
   338   // Variables which track Java semantics during bytecode parsing:
   340   Block*            _block;     // block currently getting parsed
   341   ciBytecodeStream  _iter;      // stream of this method's bytecodes
   343   int           _blocks_merged; // Progress meter: state merges from BB preds
   344   int           _blocks_parsed; // Progress meter: BBs actually parsed
   346   const FastLockNode* _synch_lock; // FastLockNode for synchronized method
   348 #ifndef PRODUCT
   349   int _max_switch_depth;        // Debugging SwitchRanges.
   350   int _est_switch_depth;        // Debugging SwitchRanges.
   351 #endif
   353   // parser for the caller of the method of this object
   354   Parse* const _parent;
   356  public:
   357   // Constructor
   358   Parse(JVMState* caller, ciMethod* parse_method, float expected_uses, Parse* parent);
   360   virtual Parse* is_Parse() const { return (Parse*)this; }
   362   // Accessors.
   363   JVMState*     caller()        const { return _caller; }
   364   float         expected_uses() const { return _expected_uses; }
   365   float         prof_factor()   const { return _prof_factor; }
   366   int           depth()         const { return _depth; }
   367   const TypeFunc* tf()          const { return _tf; }
   368   //            entry_bci()     -- see osr_bci, etc.
   370   ciTypeFlow*   flow()          const { return _flow; }
   371   //            blocks()        -- see rpo_at, start_block, etc.
   372   int           block_count()   const { return _block_count; }
   374   GraphKit&     exits()               { return _exits; }
   375   bool          wrote_final() const   { return _wrote_final; }
   376   void      set_wrote_final(bool z)   { _wrote_final = z; }
   377   bool          wrote_volatile() const { return _wrote_volatile; }
   378   void      set_wrote_volatile(bool z) { _wrote_volatile = z; }
   379   bool          count_invocations() const  { return _count_invocations; }
   380   bool          method_data_update() const { return _method_data_update; }
   381   Node*    alloc_with_final() const   { return _alloc_with_final; }
   382   void set_alloc_with_final(Node* n)  {
   383     assert((_alloc_with_final == NULL) || (_alloc_with_final == n), "different init objects?");
   384     _alloc_with_final = n;
   385   }
   387   Block*             block()    const { return _block; }
   388   ciBytecodeStream&  iter()           { return _iter; }
   389   Bytecodes::Code    bc()       const { return _iter.cur_bc(); }
   391   void set_block(Block* b)            { _block = b; }
   393   // Derived accessors:
   394   bool is_normal_parse() const  { return _entry_bci == InvocationEntryBci; }
   395   bool is_osr_parse() const     { return _entry_bci != InvocationEntryBci; }
   396   int osr_bci() const           { assert(is_osr_parse(),""); return _entry_bci; }
   398   void set_parse_bci(int bci);
   400   // Must this parse be aborted?
   401   bool failing()                { return C->failing(); }
   403   Block* rpo_at(int rpo) {
   404     assert(0 <= rpo && rpo < _block_count, "oob");
   405     return &_blocks[rpo];
   406   }
   407   Block* start_block() {
   408     return rpo_at(flow()->start_block()->rpo());
   409   }
   410   // Can return NULL if the flow pass did not complete a block.
   411   Block* successor_for_bci(int bci) {
   412     return block()->successor_for_bci(bci);
   413   }
   415   Parse* parent_parser() const { return _parent; }
   417  private:
   418   // Create a JVMS & map for the initial state of this method.
   419   SafePointNode* create_entry_map();
   421   // OSR helpers
   422   Node *fetch_interpreter_state(int index, BasicType bt, Node *local_addrs, Node *local_addrs_base);
   423   Node* check_interpreter_type(Node* l, const Type* type, SafePointNode* &bad_type_exit);
   424   void  load_interpreter_state(Node* osr_buf);
   426   // Functions for managing basic blocks:
   427   void init_blocks();
   428   void load_state_from(Block* b);
   429   void store_state_to(Block* b) { b->record_state(this); }
   431   // Parse all the basic blocks.
   432   void do_all_blocks();
   434   // Parse the current basic block
   435   void do_one_block();
   437   // Raise an error if we get a bad ciTypeFlow CFG.
   438   void handle_missing_successor(int bci);
   440   // first actions (before BCI 0)
   441   void do_method_entry();
   443   // implementation of monitorenter/monitorexit
   444   void do_monitor_enter();
   445   void do_monitor_exit();
   447   // Eagerly create phie throughout the state, to cope with back edges.
   448   void ensure_phis_everywhere();
   450   // Merge the current mapping into the basic block starting at bci
   451   void merge(          int target_bci);
   452   // Same as plain merge, except that it allocates a new path number.
   453   void merge_new_path( int target_bci);
   454   // Merge the current mapping into an exception handler.
   455   void merge_exception(int target_bci);
   456   // Helper: Merge the current mapping into the given basic block
   457   void merge_common(Block* target, int pnum);
   458   // Helper functions for merging individual cells.
   459   PhiNode *ensure_phi(       int idx, bool nocreate = false);
   460   PhiNode *ensure_memory_phi(int idx, bool nocreate = false);
   461   // Helper to merge the current memory state into the given basic block
   462   void merge_memory_edges(MergeMemNode* n, int pnum, bool nophi);
   464   // Parse this bytecode, and alter the Parsers JVM->Node mapping
   465   void do_one_bytecode();
   467   // helper function to generate array store check
   468   void array_store_check();
   469   // Helper function to generate array load
   470   void array_load(BasicType etype);
   471   // Helper function to generate array store
   472   void array_store(BasicType etype);
   473   // Helper function to compute array addressing
   474   Node* array_addressing(BasicType type, int vals, const Type* *result2=NULL);
   476   // Pass current map to exits
   477   void return_current(Node* value);
   479   // Register finalizers on return from Object.<init>
   480   void call_register_finalizer();
   482   // Insert a compiler safepoint into the graph
   483   void add_safepoint();
   485   // Insert a compiler safepoint into the graph, if there is a back-branch.
   486   void maybe_add_safepoint(int target_bci) {
   487     if (UseLoopSafepoints && target_bci <= bci()) {
   488       add_safepoint();
   489     }
   490   }
   492   // Note:  Intrinsic generation routines may be found in library_call.cpp.
   494   // Helper function to setup Ideal Call nodes
   495   void do_call();
   497   // Helper function to uncommon-trap or bailout for non-compilable call-sites
   498   bool can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass *klass);
   500   // Helper function to setup for type-profile based inlining
   501   bool prepare_type_profile_inline(ciInstanceKlass* prof_klass, ciMethod* prof_method);
   503   // Helper functions for type checking bytecodes:
   504   void  do_checkcast();
   505   void  do_instanceof();
   507   // Helper functions for shifting & arithmetic
   508   void modf();
   509   void modd();
   510   void l2f();
   512   void do_irem();
   514   // implementation of _get* and _put* bytecodes
   515   void do_getstatic() { do_field_access(true,  false); }
   516   void do_getfield () { do_field_access(true,  true); }
   517   void do_putstatic() { do_field_access(false, false); }
   518   void do_putfield () { do_field_access(false, true); }
   520   // common code for making initial checks and forming addresses
   521   void do_field_access(bool is_get, bool is_field);
   522   bool static_field_ok_in_clinit(ciField *field, ciMethod *method);
   524   // common code for actually performing the load or store
   525   void do_get_xxx(Node* obj, ciField* field, bool is_field);
   526   void do_put_xxx(Node* obj, ciField* field, bool is_field);
   528   // loading from a constant field or the constant pool
   529   // returns false if push failed (non-perm field constants only, not ldcs)
   530   bool push_constant(ciConstant con, bool require_constant = false, bool is_autobox_cache = false, const Type* basic_type = NULL);
   532   // implementation of object creation bytecodes
   533   void emit_guard_for_new(ciInstanceKlass* klass);
   534   void do_new();
   535   void do_newarray(BasicType elemtype);
   536   void do_anewarray();
   537   void do_multianewarray();
   538   Node* expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, int ndimensions, int nargs);
   540   // implementation of jsr/ret
   541   void do_jsr();
   542   void do_ret();
   544   float   dynamic_branch_prediction(float &cnt);
   545   float   branch_prediction(float &cnt, BoolTest::mask btest, int target_bci);
   546   bool    seems_never_taken(float prob);
   547   bool    seems_stable_comparison(BoolTest::mask btest, Node* c);
   549   void    do_ifnull(BoolTest::mask btest, Node* c);
   550   void    do_if(BoolTest::mask btest, Node* c);
   551   int     repush_if_args();
   552   void    adjust_map_after_if(BoolTest::mask btest, Node* c, float prob,
   553                               Block* path, Block* other_path);
   554   void    sharpen_type_after_if(BoolTest::mask btest,
   555                                 Node* con, const Type* tcon,
   556                                 Node* val, const Type* tval);
   557   IfNode* jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask);
   558   Node*   jump_if_join(Node* iffalse, Node* iftrue);
   559   void    jump_if_true_fork(IfNode *ifNode, int dest_bci_if_true, int prof_table_index);
   560   void    jump_if_false_fork(IfNode *ifNode, int dest_bci_if_false, int prof_table_index);
   561   void    jump_if_always_fork(int dest_bci_if_true, int prof_table_index);
   563   friend class SwitchRange;
   564   void    do_tableswitch();
   565   void    do_lookupswitch();
   566   void    jump_switch_ranges(Node* a, SwitchRange* lo, SwitchRange* hi, int depth = 0);
   567   bool    create_jump_tables(Node* a, SwitchRange* lo, SwitchRange* hi);
   569   // helper functions for methodData style profiling
   570   void test_counter_against_threshold(Node* cnt, int limit);
   571   void increment_and_test_invocation_counter(int limit);
   572   void test_for_osr_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize offset, int limit);
   573   Node* method_data_addressing(ciMethodData* md, ciProfileData* data, ByteSize offset, Node* idx = NULL, uint stride = 0);
   574   void increment_md_counter_at(ciMethodData* md, ciProfileData* data, ByteSize offset, Node* idx = NULL, uint stride = 0);
   575   void set_md_flag_at(ciMethodData* md, ciProfileData* data, int flag_constant);
   577   void profile_method_entry();
   578   void profile_taken_branch(int target_bci, bool force_update = false);
   579   void profile_not_taken_branch(bool force_update = false);
   580   void profile_call(Node* receiver);
   581   void profile_generic_call();
   582   void profile_receiver_type(Node* receiver);
   583   void profile_ret(int target_bci);
   584   void profile_null_checkcast();
   585   void profile_switch_case(int table_index);
   587   // helper function for call statistics
   588   void count_compiled_calls(bool at_method_entry, bool is_inline) PRODUCT_RETURN;
   590   Node_Notes* make_node_notes(Node_Notes* caller_nn);
   592   // Helper functions for handling normal and abnormal exits.
   593   void build_exits();
   595   // Fix up all exceptional control flow exiting a single bytecode.
   596   void do_exceptions();
   598   // Fix up all exiting control flow at the end of the parse.
   599   void do_exits();
   601   // Add Catch/CatchProjs
   602   // The call is either a Java call or the VM's rethrow stub
   603   void catch_call_exceptions(ciExceptionHandlerStream&);
   605   // Handle all exceptions thrown by the inlined method.
   606   // Also handles exceptions for individual bytecodes.
   607   void catch_inline_exceptions(SafePointNode* ex_map);
   609   // Merge the given map into correct exceptional exit state.
   610   // Assumes that there is no applicable local handler.
   611   void throw_to_exit(SafePointNode* ex_map);
   613   // Use speculative type to optimize CmpP node
   614   Node* optimize_cmp_with_klass(Node* c);
   616  public:
   617 #ifndef PRODUCT
   618   // Handle PrintOpto, etc.
   619   void show_parse_info();
   620   void dump_map_adr_mem() const;
   621   static void print_statistics(); // Print some performance counters
   622   void dump();
   623   void dump_bci(int bci);
   624 #endif
   625 };
   627 #endif // SHARE_VM_OPTO_PARSE_HPP

mercurial