< prev index next >

src/hotspot/share/oops/generateOopMap.hpp

Print this page

 74  private:
 75   RetTableEntry *_first;
 76   static int _init_nof_entries;
 77 
 78   void add_jsr(int return_bci, int target_bci);   // Adds entry to list
 79  public:
 80   RetTable()                                                  { _first = NULL; }
 81   void compute_ret_table(const methodHandle& method);
 82   void update_ret_table(int bci, int delta);
 83   RetTableEntry* find_jsrs_for_target(int targBci);
 84 };
 85 
 86 //
 87 // CellTypeState
 88 //
 89 class CellTypeState {
 90  private:
 91   unsigned int _state;
 92 
 93   // Masks for separating the BITS and INFO portions of a CellTypeState
 94   enum { info_mask            = right_n_bits(28),
 95          bits_mask            = (int)(~info_mask) };
 96 
 97   // These constant are used for manipulating the BITS portion of a
 98   // CellTypeState
 99   enum { uninit_bit           = (int)(nth_bit(31)),
100          ref_bit              = nth_bit(30),
101          val_bit              = nth_bit(29),
102          addr_bit             = nth_bit(28),
103          live_bits_mask       = (int)(bits_mask & ~uninit_bit) };
104 
105   // These constants are used for manipulating the INFO portion of a
106   // CellTypeState
107   enum { top_info_bit         = nth_bit(27),
108          not_bottom_info_bit  = nth_bit(26),
109          info_data_mask       = right_n_bits(26),
110          info_conflict        = info_mask };
111 
112   // Within the INFO data, these values are used to distinguish different
113   // kinds of references.
114   enum { ref_not_lock_bit     = nth_bit(25),  // 0 if this reference is locked as a monitor
115          ref_slot_bit         = nth_bit(24),  // 1 if this reference is a "slot" reference,
116                                               // 0 if it is a "line" reference.
117          ref_data_mask        = right_n_bits(24) };
118 





119 
120   // These values are used to initialize commonly used CellTypeState
121   // constants.
122   enum { bottom_value         = 0,
123          uninit_value         = (int)(uninit_bit | info_conflict),
124          ref_value            = ref_bit,
125          ref_conflict         = ref_bit | info_conflict,
126          val_value            = val_bit | info_conflict,
127          addr_value           = addr_bit,
128          addr_conflict        = addr_bit | info_conflict };
129 
130  public:
131 
132   // Since some C++ constructors generate poor code for declarations of the
133   // form...
134   //
135   //   CellTypeState vector[length];
136   //
137   // ...we avoid making a constructor for this class.  CellTypeState values
138   // should be constructed using one of the make_* methods:

179   bool is_bottom() const                { return _state == 0; }
180   bool is_live() const                  { return ((_state & live_bits_mask) != 0); }
181   bool is_valid_state() const {
182     // Uninitialized and value cells must contain no data in their info field:
183     if ((can_be_uninit() || can_be_value()) && !is_info_top()) {
184       return false;
185     }
186     // The top bit is only set when all info bits are set:
187     if (is_info_top() && ((_state & info_mask) != info_mask)) {
188       return false;
189     }
190     // The not_bottom_bit must be set when any other info bit is set:
191     if (is_info_bottom() && ((_state & info_mask) != 0)) {
192       return false;
193     }
194     return true;
195   }
196 
197   bool is_address() const               { return ((_state & bits_mask) == addr_bit); }
198   bool is_reference() const             { return ((_state & bits_mask) == ref_bit); }
199   bool is_value() const                 { return ((_state & bits_mask) == val_bit); }
200   bool is_uninit() const                { return ((_state & bits_mask) == (uint)uninit_bit); }
201 
202   bool can_be_address() const           { return ((_state & addr_bit) != 0); }
203   bool can_be_reference() const         { return ((_state & ref_bit) != 0); }
204   bool can_be_value() const             { return ((_state & val_bit) != 0); }
205   bool can_be_uninit() const            { return ((_state & uninit_bit) != 0); }
206 
207   bool is_info_bottom() const           { return ((_state & not_bottom_info_bit) == 0); }
208   bool is_info_top() const              { return ((_state & top_info_bit) != 0); }
209   int  get_info() const {
210     assert((!is_info_top() && !is_info_bottom()),
211            "check to make sure top/bottom info is not used");
212     return (_state & info_data_mask);
213   }
214 
215   bool is_good_address() const          { return is_address() && !is_info_top(); }
216   bool is_lock_reference() const {
217     return ((_state & (bits_mask | top_info_bit | ref_not_lock_bit)) == ref_bit);
218   }
219   bool is_nonlock_reference() const {

380   void  interp_all                          ();
381 
382   // Interpretation methods (secondary)
383   void  interp1                             (BytecodeStream *itr);
384   void  do_exception_edge                   (BytecodeStream *itr);
385   void  check_type                          (CellTypeState expected, CellTypeState actual);
386   void  ppstore                             (CellTypeState *in,  int loc_no);
387   void  ppload                              (CellTypeState *out, int loc_no);
388   void  ppush1                              (CellTypeState in);
389   void  ppush                               (CellTypeState *in);
390   void  ppop1                               (CellTypeState out);
391   void  ppop                                (CellTypeState *out);
392   void  ppop_any                            (int poplen);
393   void  pp                                  (CellTypeState *in, CellTypeState *out);
394   void  pp_new_ref                          (CellTypeState *in, int bci);
395   void  ppdupswap                           (int poplen, const char *out);
396   void  do_ldc                              (int bci);
397   void  do_astore                           (int idx);
398   void  do_jsr                              (int delta);
399   void  do_field                            (int is_get, int is_static, int idx, int bci);
400   void  do_method                           (int is_static, int is_interface, int idx, int bci);

401   void  do_multianewarray                   (int dims, int bci);
402   void  do_monitorenter                     (int bci);
403   void  do_monitorexit                      (int bci);
404   void  do_return_monitor_check             ();
405   void  do_checkcast                        ();
406   CellTypeState *signature_to_effect        (const Symbol* sig, int bci, CellTypeState *out);
407   int copy_cts                              (CellTypeState *dst, CellTypeState *src);
408 
409   // Error handling
410   void  error_work                          (const char *format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
411   void  report_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
412   void  verify_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
413   bool  got_error()                         { return _got_error; }
414 
415   // Create result set
416   bool  _report_result;
417   bool  _report_result_for_send;            // Unfortunatly, stackmaps for sends are special, so we need some extra
418   BytecodeStream *_itr_send;                // variables to handle them properly.
419 
420   void  report_result                       ();

 74  private:
 75   RetTableEntry *_first;
 76   static int _init_nof_entries;
 77 
 78   void add_jsr(int return_bci, int target_bci);   // Adds entry to list
 79  public:
 80   RetTable()                                                  { _first = NULL; }
 81   void compute_ret_table(const methodHandle& method);
 82   void update_ret_table(int bci, int delta);
 83   RetTableEntry* find_jsrs_for_target(int targBci);
 84 };
 85 
 86 //
 87 // CellTypeState
 88 //
 89 class CellTypeState {
 90  private:
 91   unsigned int _state;
 92 
 93   // Masks for separating the BITS and INFO portions of a CellTypeState
 94   enum { info_mask            = right_n_bits(27),
 95          bits_mask            = (int)(~info_mask) };
 96 
 97   // These constant are used for manipulating the BITS portion of a
 98   // CellTypeState
 99   enum { uninit_bit           = (int)(nth_bit(31)),
100          ref_bit              = nth_bit(30),
101          val_bit              = nth_bit(29),
102          addr_bit             = nth_bit(28),
103          live_bits_mask       = (int)(bits_mask & ~uninit_bit) };
104 
105   // These constants are used for manipulating the INFO portion of a
106   // CellTypeState
107   enum { top_info_bit         = nth_bit(26),
108          not_bottom_info_bit  = nth_bit(25),
109          info_data_mask       = right_n_bits(25),
110          info_conflict        = info_mask };
111 
112   // Within the INFO data, these values are used to distinguish different
113   // kinds of references.
114   enum { ref_not_lock_bit     = nth_bit(24),  // 0 if this reference is locked as a monitor
115          ref_slot_bit         = nth_bit(23),  // 1 if this reference is a "slot" reference,
116                                               // 0 if it is a "line" reference.
117          ref_data_mask        = right_n_bits(23) };
118 
119   // Within the INFO data, these values are used to distinguish different
120   // kinds of value types.
121   enum { valuetype_slot_bit   = nth_bit(24),  // 1 if this reference is a "slot" value type,
122     // 0 if it is a "line" value type.
123     valuetype_data_mask  = right_n_bits(24) };
124 
125   // These values are used to initialize commonly used CellTypeState
126   // constants.
127   enum { bottom_value         = 0,
128          uninit_value         = (int)(uninit_bit | info_conflict),
129          ref_value            = ref_bit,
130          ref_conflict         = ref_bit | info_conflict,
131          val_value            = val_bit | info_conflict,
132          addr_value           = addr_bit,
133          addr_conflict        = addr_bit | info_conflict };
134 
135  public:
136 
137   // Since some C++ constructors generate poor code for declarations of the
138   // form...
139   //
140   //   CellTypeState vector[length];
141   //
142   // ...we avoid making a constructor for this class.  CellTypeState values
143   // should be constructed using one of the make_* methods:

184   bool is_bottom() const                { return _state == 0; }
185   bool is_live() const                  { return ((_state & live_bits_mask) != 0); }
186   bool is_valid_state() const {
187     // Uninitialized and value cells must contain no data in their info field:
188     if ((can_be_uninit() || can_be_value()) && !is_info_top()) {
189       return false;
190     }
191     // The top bit is only set when all info bits are set:
192     if (is_info_top() && ((_state & info_mask) != info_mask)) {
193       return false;
194     }
195     // The not_bottom_bit must be set when any other info bit is set:
196     if (is_info_bottom() && ((_state & info_mask) != 0)) {
197       return false;
198     }
199     return true;
200   }
201 
202   bool is_address() const               { return ((_state & bits_mask) == addr_bit); }
203   bool is_reference() const             { return ((_state & bits_mask) == ref_bit); }
204   bool is_inline_type() const           { return ((_state & bits_mask) == val_bit); }
205   bool is_uninit() const                { return ((_state & bits_mask) == (uint)uninit_bit); }
206 
207   bool can_be_address() const           { return ((_state & addr_bit) != 0); }
208   bool can_be_reference() const         { return ((_state & ref_bit) != 0); }
209   bool can_be_value() const             { return ((_state & val_bit) != 0); }
210   bool can_be_uninit() const            { return ((_state & uninit_bit) != 0); }
211 
212   bool is_info_bottom() const           { return ((_state & not_bottom_info_bit) == 0); }
213   bool is_info_top() const              { return ((_state & top_info_bit) != 0); }
214   int  get_info() const {
215     assert((!is_info_top() && !is_info_bottom()),
216            "check to make sure top/bottom info is not used");
217     return (_state & info_data_mask);
218   }
219 
220   bool is_good_address() const          { return is_address() && !is_info_top(); }
221   bool is_lock_reference() const {
222     return ((_state & (bits_mask | top_info_bit | ref_not_lock_bit)) == ref_bit);
223   }
224   bool is_nonlock_reference() const {

385   void  interp_all                          ();
386 
387   // Interpretation methods (secondary)
388   void  interp1                             (BytecodeStream *itr);
389   void  do_exception_edge                   (BytecodeStream *itr);
390   void  check_type                          (CellTypeState expected, CellTypeState actual);
391   void  ppstore                             (CellTypeState *in,  int loc_no);
392   void  ppload                              (CellTypeState *out, int loc_no);
393   void  ppush1                              (CellTypeState in);
394   void  ppush                               (CellTypeState *in);
395   void  ppop1                               (CellTypeState out);
396   void  ppop                                (CellTypeState *out);
397   void  ppop_any                            (int poplen);
398   void  pp                                  (CellTypeState *in, CellTypeState *out);
399   void  pp_new_ref                          (CellTypeState *in, int bci);
400   void  ppdupswap                           (int poplen, const char *out);
401   void  do_ldc                              (int bci);
402   void  do_astore                           (int idx);
403   void  do_jsr                              (int delta);
404   void  do_field                            (int is_get, int is_static, int idx, int bci);
405   void  do_method                           (int is_static, int idx, int bci);
406   void  do_withfield                       (int idx, int bci);
407   void  do_multianewarray                   (int dims, int bci);
408   void  do_monitorenter                     (int bci);
409   void  do_monitorexit                      (int bci);
410   void  do_return_monitor_check             ();
411   void  do_checkcast                        ();
412   CellTypeState *signature_to_effect        (const Symbol* sig, int bci, CellTypeState *out);
413   int copy_cts                              (CellTypeState *dst, CellTypeState *src);
414 
415   // Error handling
416   void  error_work                          (const char *format, va_list ap) ATTRIBUTE_PRINTF(2, 0);
417   void  report_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
418   void  verify_error                        (const char *format, ...) ATTRIBUTE_PRINTF(2, 3);
419   bool  got_error()                         { return _got_error; }
420 
421   // Create result set
422   bool  _report_result;
423   bool  _report_result_for_send;            // Unfortunatly, stackmaps for sends are special, so we need some extra
424   BytecodeStream *_itr_send;                // variables to handle them properly.
425 
426   void  report_result                       ();
< prev index next >