< prev index next >

src/hotspot/share/ci/ciTypeFlow.hpp

Print this page




 318       push(long2_type());
 319     }
 320     void      pop_long() {
 321       assert(type_at_tos() == long2_type(), "must be 2nd half");
 322       pop();
 323       assert(is_long(type_at_tos()), "must be long");
 324       pop();
 325     }
 326     void      push_object(ciKlass* klass) {
 327       push(klass);
 328     }
 329     void      pop_object() {
 330       assert(is_reference(type_at_tos()), "must be reference type");
 331       pop();
 332     }
 333     void      pop_array() {
 334       assert(type_at_tos() == null_type() ||
 335              type_at_tos()->is_array_klass(), "must be array type");
 336       pop();
 337     }
 338     // pop_objArray and pop_typeArray narrow the tos to ciObjArrayKlass
 339     // or ciTypeArrayKlass (resp.).  In the rare case that an explicit
 340     // null is popped from the stack, we return NULL.  Caller beware.
 341     ciObjArrayKlass* pop_objArray() {
 342       ciType* array = pop_value();
 343       if (array == null_type())  return NULL;
 344       assert(array->is_obj_array_klass(), "must be object array type");
 345       return array->as_obj_array_klass();


 346     }
 347     ciTypeArrayKlass* pop_typeArray() {
 348       ciType* array = pop_value();
 349       if (array == null_type())  return NULL;
 350       assert(array->is_type_array_klass(), "must be prim array type");
 351       return array->as_type_array_klass();
 352     }
 353     void      push_null() {
 354       push(null_type());
 355     }
 356     void      do_null_assert(ciKlass* unloaded_klass);
 357 
 358     // Helper convenience routines.
 359     void do_aaload(ciBytecodeStream* str);
 360     void do_checkcast(ciBytecodeStream* str);
 361     void do_getfield(ciBytecodeStream* str);
 362     void do_getstatic(ciBytecodeStream* str);
 363     void do_invoke(ciBytecodeStream* str, bool has_receiver);
 364     void do_jsr(ciBytecodeStream* str);
 365     void do_ldc(ciBytecodeStream* str);
 366     void do_multianewarray(ciBytecodeStream* str);
 367     void do_new(ciBytecodeStream* str);


 368     void do_newarray(ciBytecodeStream* str);
 369     void do_putfield(ciBytecodeStream* str);
 370     void do_putstatic(ciBytecodeStream* str);
 371     void do_ret(ciBytecodeStream* str);
 372 
 373     void overwrite_local_double_long(int index) {
 374       // Invalidate the previous local if it contains first half of
 375       // a double or long value since it's seconf half is being overwritten.
 376       int prev_index = index - 1;
 377       if (prev_index >= 0 &&
 378           (is_double(type_at(local(prev_index))) ||
 379            is_long(type_at(local(prev_index))))) {
 380         set_type_at(local(prev_index), bottom_type());
 381       }
 382     }
 383 
 384     void load_local_object(int index) {
 385       ciType* type = type_at(local(index));
 386       assert(is_reference(type), "must be reference type");
 387       push(type);


 825   // Tell whether the flow analysis has encountered an error of some sort.
 826   bool failing() { return env()->failing() || _failure_reason != NULL; }
 827 
 828   // Reason this compilation is failing, such as "too many basic blocks".
 829   const char* failure_reason() { return _failure_reason; }
 830 
 831   // Note a failure.
 832   void record_failure(const char* reason);
 833 
 834   // Return the block of a given pre-order number.
 835   int have_block_count() const      { return _block_map != NULL; }
 836   int block_count() const           { assert(have_block_count(), "");
 837                                       return _next_pre_order; }
 838   Block* pre_order_at(int po) const { assert(0 <= po && po < block_count(), "out of bounds");
 839                                       return _block_map[po]; }
 840   Block* start_block() const        { return pre_order_at(start_block_num()); }
 841   int start_block_num() const       { return 0; }
 842   Block* rpo_at(int rpo) const      { assert(0 <= rpo && rpo < block_count(), "out of bounds");
 843                                       return _block_map[rpo]; }
 844   int inc_next_pre_order()          { return _next_pre_order++; }


 845 
 846 private:
 847   // A work list used during flow analysis.
 848   Block* _work_list;
 849 
 850   // List of blocks in reverse post order
 851   Block* _rpo_list;
 852 
 853   // Next Block::_pre_order.  After mapping, doubles as block_count.
 854   int _next_pre_order;
 855 
 856   // Are there more blocks on the work list?
 857   bool work_list_empty() { return _work_list == NULL; }
 858 
 859   // Get the next basic block from our work list.
 860   Block* work_list_next();
 861 
 862   // Add a basic block to our work list.
 863   void add_to_work_list(Block* block);
 864 




 318       push(long2_type());
 319     }
 320     void      pop_long() {
 321       assert(type_at_tos() == long2_type(), "must be 2nd half");
 322       pop();
 323       assert(is_long(type_at_tos()), "must be long");
 324       pop();
 325     }
 326     void      push_object(ciKlass* klass) {
 327       push(klass);
 328     }
 329     void      pop_object() {
 330       assert(is_reference(type_at_tos()), "must be reference type");
 331       pop();
 332     }
 333     void      pop_array() {
 334       assert(type_at_tos() == null_type() ||
 335              type_at_tos()->is_array_klass(), "must be array type");
 336       pop();
 337     }
 338     // pop_valueOrobjArray and pop_typeArray narrow the tos to ciObjArrayKlass,
 339     // ciValueArrayKlass or ciTypeArrayKlass (resp.). In the rare case that an explicit
 340     // null is popped from the stack, we return NULL.  Caller beware.
 341     ciArrayKlass* pop_objOrValueArray() {
 342       ciType* array = pop_value();
 343       if (array == null_type())  return NULL;
 344       // Value type arrays may contain oop or flattened representation
 345       assert(array->is_obj_array_klass() || (ValueArrayFlatten && array->is_value_array_klass()),
 346           "must be value or object array type");
 347       return array->as_array_klass();
 348     }
 349     ciTypeArrayKlass* pop_typeArray() {
 350       ciType* array = pop_value();
 351       if (array == null_type())  return NULL;
 352       assert(array->is_type_array_klass(), "must be prim array type");
 353       return array->as_type_array_klass();
 354     }
 355     void      push_null() {
 356       push(null_type());
 357     }
 358     void      do_null_assert(ciKlass* unloaded_klass);
 359 
 360     // Helper convenience routines.
 361     void do_aload(ciBytecodeStream* str);
 362     void do_checkcast(ciBytecodeStream* str);
 363     void do_getfield(ciBytecodeStream* str);
 364     void do_getstatic(ciBytecodeStream* str);
 365     void do_invoke(ciBytecodeStream* str, bool has_receiver);
 366     void do_jsr(ciBytecodeStream* str);
 367     void do_ldc(ciBytecodeStream* str);
 368     void do_multianewarray(ciBytecodeStream* str);
 369     void do_new(ciBytecodeStream* str);
 370     void do_defaultvalue(ciBytecodeStream* str);
 371     void do_withfield(ciBytecodeStream* str);
 372     void do_newarray(ciBytecodeStream* str);
 373     void do_putfield(ciBytecodeStream* str);
 374     void do_putstatic(ciBytecodeStream* str);
 375     void do_ret(ciBytecodeStream* str);
 376 
 377     void overwrite_local_double_long(int index) {
 378       // Invalidate the previous local if it contains first half of
 379       // a double or long value since it's seconf half is being overwritten.
 380       int prev_index = index - 1;
 381       if (prev_index >= 0 &&
 382           (is_double(type_at(local(prev_index))) ||
 383            is_long(type_at(local(prev_index))))) {
 384         set_type_at(local(prev_index), bottom_type());
 385       }
 386     }
 387 
 388     void load_local_object(int index) {
 389       ciType* type = type_at(local(index));
 390       assert(is_reference(type), "must be reference type");
 391       push(type);


 829   // Tell whether the flow analysis has encountered an error of some sort.
 830   bool failing() { return env()->failing() || _failure_reason != NULL; }
 831 
 832   // Reason this compilation is failing, such as "too many basic blocks".
 833   const char* failure_reason() { return _failure_reason; }
 834 
 835   // Note a failure.
 836   void record_failure(const char* reason);
 837 
 838   // Return the block of a given pre-order number.
 839   int have_block_count() const      { return _block_map != NULL; }
 840   int block_count() const           { assert(have_block_count(), "");
 841                                       return _next_pre_order; }
 842   Block* pre_order_at(int po) const { assert(0 <= po && po < block_count(), "out of bounds");
 843                                       return _block_map[po]; }
 844   Block* start_block() const        { return pre_order_at(start_block_num()); }
 845   int start_block_num() const       { return 0; }
 846   Block* rpo_at(int rpo) const      { assert(0 <= rpo && rpo < block_count(), "out of bounds");
 847                                       return _block_map[rpo]; }
 848   int inc_next_pre_order()          { return _next_pre_order++; }
 849 
 850   ciType* mark_as_never_null(ciType* type);
 851 
 852 private:
 853   // A work list used during flow analysis.
 854   Block* _work_list;
 855 
 856   // List of blocks in reverse post order
 857   Block* _rpo_list;
 858 
 859   // Next Block::_pre_order.  After mapping, doubles as block_count.
 860   int _next_pre_order;
 861 
 862   // Are there more blocks on the work list?
 863   bool work_list_empty() { return _work_list == NULL; }
 864 
 865   // Get the next basic block from our work list.
 866   Block* work_list_next();
 867 
 868   // Add a basic block to our work list.
 869   void add_to_work_list(Block* block);
 870 


< prev index next >