src/share/vm/c1/c1_GraphBuilder.hpp

changeset 2174
f02a8bbe6ed4
parent 2138
d5d065957597
child 2180
80c9354976b0
     1.1 --- a/src/share/vm/c1/c1_GraphBuilder.hpp	Wed Sep 22 23:51:03 2010 -0700
     1.2 +++ b/src/share/vm/c1/c1_GraphBuilder.hpp	Tue Dec 29 19:08:54 2009 +0100
     1.3 @@ -58,9 +58,6 @@
     1.4      // BlockEnds.
     1.5      BlockBegin*  _continuation;
     1.6  
     1.7 -    // Without return value of inlined method on stack
     1.8 -    ValueStack*  _continuation_state;
     1.9 -
    1.10      // Was this ScopeData created only for the parsing and inlining of
    1.11      // a jsr?
    1.12      bool         _parsing_jsr;
    1.13 @@ -125,14 +122,10 @@
    1.14      void set_stream(ciBytecodeStream* stream)      { _stream = stream;          }
    1.15  
    1.16      intx max_inline_size() const                   { return _max_inline_size;   }
    1.17 -    int  caller_stack_size() const;
    1.18  
    1.19      BlockBegin* continuation() const               { return _continuation;      }
    1.20      void set_continuation(BlockBegin* cont)        { _continuation = cont;      }
    1.21  
    1.22 -    ValueStack* continuation_state() const         { return _continuation_state; }
    1.23 -    void set_continuation_state(ValueStack* s)     { _continuation_state = s; }
    1.24 -
    1.25      // Indicates whether this ScopeData was pushed only for the
    1.26      // parsing and inlining of a jsr
    1.27      bool parsing_jsr() const                       { return _parsing_jsr;       }
    1.28 @@ -163,7 +156,6 @@
    1.29  
    1.30    // for all GraphBuilders
    1.31    static bool       _can_trap[Bytecodes::number_of_java_codes];
    1.32 -  static bool       _is_async[Bytecodes::number_of_java_codes];
    1.33  
    1.34    // for each instance of GraphBuilder
    1.35    ScopeData*        _scope_data;                 // Per-scope data; used for inlining
    1.36 @@ -179,7 +171,6 @@
    1.37    // for each call to connect_to_end; can also be set by inliner
    1.38    BlockBegin*       _block;                      // the current block
    1.39    ValueStack*       _state;                      // the current execution state
    1.40 -  ValueStack*       _exception_state;            // state that will be used by handle_exception
    1.41    Instruction*      _last;                       // the last instruction added
    1.42    bool              _skip_block;                 // skip processing of the rest of this block
    1.43  
    1.44 @@ -194,8 +185,6 @@
    1.45    ValueStack*       state() const                { return _state; }
    1.46    void              set_state(ValueStack* state) { _state = state; }
    1.47    IRScope*          scope() const                { return scope_data()->scope(); }
    1.48 -  ValueStack*       exception_state() const      { return _exception_state; }
    1.49 -  void              set_exception_state(ValueStack* s) { _exception_state = s; }
    1.50    ciMethod*         method() const               { return scope()->method(); }
    1.51    ciBytecodeStream* stream() const               { return scope_data()->stream(); }
    1.52    Instruction*      last() const                 { return _last; }
    1.53 @@ -230,7 +219,7 @@
    1.54    void load_indexed (BasicType type);
    1.55    void store_indexed(BasicType type);
    1.56    void stack_op(Bytecodes::Code code);
    1.57 -  void arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* lock_stack = NULL);
    1.58 +  void arithmetic_op(ValueType* type, Bytecodes::Code code, ValueStack* state_before = NULL);
    1.59    void negate_op(ValueType* type);
    1.60    void shift_op(ValueType* type, Bytecodes::Code code);
    1.61    void logic_op(ValueType* type, Bytecodes::Code code);
    1.62 @@ -267,12 +256,8 @@
    1.63    Instruction* append_split(StateSplit* instr);
    1.64  
    1.65    // other helpers
    1.66 -  static bool is_async(Bytecodes::Code code) {
    1.67 -    assert(0 <= code && code < Bytecodes::number_of_java_codes, "illegal bytecode");
    1.68 -    return _is_async[code];
    1.69 -  }
    1.70    BlockBegin* block_at(int bci)                  { return scope_data()->block_at(bci); }
    1.71 -  XHandlers* handle_exception(int bci);
    1.72 +  XHandlers* handle_exception(Instruction* instruction);
    1.73    void connect_to_end(BlockBegin* beg);
    1.74    void null_check(Value value);
    1.75    void eliminate_redundant_phis(BlockBegin* start);
    1.76 @@ -283,7 +268,28 @@
    1.77  
    1.78    void kill_all();
    1.79  
    1.80 -  ValueStack* lock_stack();
    1.81 +  // use of state copy routines (try to minimize unnecessary state
    1.82 +  // object allocations):
    1.83 +
    1.84 +  // - if the instruction unconditionally needs a full copy of the
    1.85 +  // state (for patching for example), then use copy_state_before*
    1.86 +
    1.87 +  // - if the instruction needs a full copy of the state only for
    1.88 +  // handler generation (Instruction::needs_exception_state() returns
    1.89 +  // false) then use copy_state_exhandling*
    1.90 +
    1.91 +  // - if the instruction needs either a full copy of the state for
    1.92 +  // handler generation and a least a minimal copy of the state (as
    1.93 +  // returned by Instruction::exception_state()) for debug info
    1.94 +  // generation (that is when Instruction::needs_exception_state()
    1.95 +  // returns true) then use copy_state_for_exception*
    1.96 +
    1.97 +  ValueStack* copy_state_before_with_bci(int bci);
    1.98 +  ValueStack* copy_state_before();
    1.99 +  ValueStack* copy_state_exhandling_with_bci(int bci);
   1.100 +  ValueStack* copy_state_exhandling();
   1.101 +  ValueStack* copy_state_for_exception_with_bci(int bci);
   1.102 +  ValueStack* copy_state_for_exception();
   1.103  
   1.104    //
   1.105    // Inlining support
   1.106 @@ -292,9 +298,7 @@
   1.107    // accessors
   1.108    bool parsing_jsr() const                               { return scope_data()->parsing_jsr();           }
   1.109    BlockBegin* continuation() const                       { return scope_data()->continuation();          }
   1.110 -  ValueStack* continuation_state() const                 { return scope_data()->continuation_state();    }
   1.111    BlockBegin* jsr_continuation() const                   { return scope_data()->jsr_continuation();      }
   1.112 -  int caller_stack_size() const                          { return scope_data()->caller_stack_size();     }
   1.113    void set_continuation(BlockBegin* continuation)        { scope_data()->set_continuation(continuation); }
   1.114    void set_inline_cleanup_info(BlockBegin* block,
   1.115                                 Instruction* return_prev,

mercurial