< prev index next >

src/hotspot/share/ci/ciTypeFlow.hpp

Print this page

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

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


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

819   bool failing() { return env()->failing() || _failure_reason != NULL; }
820 
821   // Reason this compilation is failing, such as "too many basic blocks".
822   const char* failure_reason() { return _failure_reason; }
823 
824   // Note a failure.
825   void record_failure(const char* reason);
826 
827   // Return the block of a given pre-order number.
828   int have_block_count() const      { return _block_map != NULL; }
829   int block_count() const           { assert(have_block_count(), "");
830                                       return _next_pre_order; }
831   Block* pre_order_at(int po) const { assert(0 <= po && po < block_count(), "out of bounds");
832                                       return _block_map[po]; }
833   Block* start_block() const        { return pre_order_at(start_block_num()); }
834   int start_block_num() const       { return 0; }
835   Block* rpo_at(int rpo) const      { assert(0 <= rpo && rpo < block_count(), "out of bounds");
836                                       return _block_map[rpo]; }
837   int inc_next_pre_order()          { return _next_pre_order++; }
838 


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

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

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