< prev index next >

src/hotspot/share/ci/ciStreams.hpp

Print this page




 204     return cur_bci() + bytecode().get_offset_s4(cur_bc_raw());
 205   }
 206 
 207   // For a lookup or switch table, return target destination
 208   int get_int_table( int index ) const {
 209     return Bytes::get_Java_u4((address)&_table_base[index]); }
 210 
 211   int get_dest_table( int index ) const {
 212     return cur_bci() + get_int_table(index); }
 213 
 214   // --- Constant pool access ---
 215   int get_constant_raw_index() const;
 216   int get_constant_pool_index() const;
 217   int get_field_index();
 218   int get_method_index();
 219 
 220   // If this bytecode is a new, newarray, multianewarray, instanceof,
 221   // or checkcast, get the referenced klass.
 222   ciKlass* get_klass(bool& will_link);
 223   int get_klass_index() const;

 224 
 225   // If this bytecode is one of the ldc variants, get the referenced
 226   // constant.  Do not attempt to resolve it, since that would require
 227   // execution of Java code.  If it is not resolved, return an unloaded
 228   // object (ciConstant.as_object()->is_loaded() == false).
 229   ciConstant get_constant();
 230   constantTag get_constant_pool_tag(int index) const;
 231 
 232   // True if the klass-using bytecode points to an unresolved klass
 233   bool is_unresolved_klass() const {
 234     constantTag tag = get_constant_pool_tag(get_klass_index());
 235     return tag.is_unresolved_klass();
 236   }
 237 
 238   // If this bytecode is one of get_field, get_static, put_field,
 239   // or put_static, get the referenced field.
 240   ciField* get_field(bool& will_link);
 241 
 242   ciInstanceKlass* get_declared_field_holder();
 243   int      get_field_holder_index();


 267     _sig = signature;
 268     _pos = 0;
 269     _holder = holder;
 270   }
 271 
 272   bool at_return_type() { return _pos == _sig->count(); }
 273 
 274   bool is_done() { return _pos > _sig->count(); }
 275 
 276   void next() {
 277     if (_pos <= _sig->count()) {
 278       _pos++;
 279     }
 280   }
 281 
 282   ciType* type() {
 283     if (at_return_type()) {
 284       return _sig->return_type();
 285     } else {
 286       return _sig->type_at(_pos);








 287     }
 288   }
 289 
 290   // next klass in the signature
 291   ciKlass* next_klass() {
 292     ciKlass* sig_k;
 293     if (_holder != NULL) {
 294       sig_k = _holder;
 295       _holder = NULL;
 296     } else {
 297       while (!type()->is_klass()) {
 298         next();
 299       }
 300       assert(!at_return_type(), "passed end of signature");
 301       sig_k = type()->as_klass();
 302       next();
 303     }
 304     return sig_k;
 305   }
 306 };




 204     return cur_bci() + bytecode().get_offset_s4(cur_bc_raw());
 205   }
 206 
 207   // For a lookup or switch table, return target destination
 208   int get_int_table( int index ) const {
 209     return Bytes::get_Java_u4((address)&_table_base[index]); }
 210 
 211   int get_dest_table( int index ) const {
 212     return cur_bci() + get_int_table(index); }
 213 
 214   // --- Constant pool access ---
 215   int get_constant_raw_index() const;
 216   int get_constant_pool_index() const;
 217   int get_field_index();
 218   int get_method_index();
 219 
 220   // If this bytecode is a new, newarray, multianewarray, instanceof,
 221   // or checkcast, get the referenced klass.
 222   ciKlass* get_klass(bool& will_link);
 223   int get_klass_index() const;
 224   bool is_klass_never_null() const;
 225 
 226   // If this bytecode is one of the ldc variants, get the referenced
 227   // constant.  Do not attempt to resolve it, since that would require
 228   // execution of Java code.  If it is not resolved, return an unloaded
 229   // object (ciConstant.as_object()->is_loaded() == false).
 230   ciConstant get_constant();
 231   constantTag get_constant_pool_tag(int index) const;
 232 
 233   // True if the klass-using bytecode points to an unresolved klass
 234   bool is_unresolved_klass() const {
 235     constantTag tag = get_constant_pool_tag(get_klass_index());
 236     return tag.is_unresolved_klass();
 237   }
 238 
 239   // If this bytecode is one of get_field, get_static, put_field,
 240   // or put_static, get the referenced field.
 241   ciField* get_field(bool& will_link);
 242 
 243   ciInstanceKlass* get_declared_field_holder();
 244   int      get_field_holder_index();


 268     _sig = signature;
 269     _pos = 0;
 270     _holder = holder;
 271   }
 272 
 273   bool at_return_type() { return _pos == _sig->count(); }
 274 
 275   bool is_done() { return _pos > _sig->count(); }
 276 
 277   void next() {
 278     if (_pos <= _sig->count()) {
 279       _pos++;
 280     }
 281   }
 282 
 283   ciType* type() {
 284     if (at_return_type()) {
 285       return _sig->return_type();
 286     } else {
 287       return _sig->type_at(_pos);
 288     }
 289   }
 290 
 291   bool is_never_null() {
 292     if (at_return_type()) {
 293       return _sig->returns_never_null();
 294     } else {
 295       return _sig->is_never_null_at(_pos);
 296     }
 297   }
 298 
 299   // next klass in the signature
 300   ciKlass* next_klass() {
 301     ciKlass* sig_k;
 302     if (_holder != NULL) {
 303       sig_k = _holder;
 304       _holder = NULL;
 305     } else {
 306       while (!type()->is_klass()) {
 307         next();
 308       }
 309       assert(!at_return_type(), "passed end of signature");
 310       sig_k = type()->as_klass();
 311       next();
 312     }
 313     return sig_k;
 314   }
 315 };


< prev index next >