src/share/vm/c1/c1_Runtime1.hpp

Print this page
rev 4136 : 7153771: array bound check elimination for c1
Summary: when possible optimize out array bound checks, inserting predicates when needed.
Reviewed-by:


  54   stub(new_multi_array)              \
  55   stub(handle_exception_nofpu)         /* optimized version that does not preserve fpu registers */ \
  56   stub(handle_exception)             \
  57   stub(handle_exception_from_callee) \
  58   stub(throw_array_store_exception)  \
  59   stub(throw_class_cast_exception)   \
  60   stub(throw_incompatible_class_change_error)   \
  61   stub(slow_subtype_check)           \
  62   stub(monitorenter)                 \
  63   stub(monitorenter_nofpu)             /* optimized version that does not preserve fpu registers */ \
  64   stub(monitorexit)                  \
  65   stub(monitorexit_nofpu)              /* optimized version that does not preserve fpu registers */ \
  66   stub(deoptimize)                   \
  67   stub(access_field_patching)        \
  68   stub(load_klass_patching)          \
  69   stub(load_mirror_patching)         \
  70   stub(g1_pre_barrier_slow)          \
  71   stub(g1_post_barrier_slow)         \
  72   stub(fpu2long_stub)                \
  73   stub(counter_overflow)             \

  74   last_entry(number_of_ids)
  75 
  76 #define DECLARE_STUB_ID(x)       x ## _id ,
  77 #define DECLARE_LAST_STUB_ID(x)  x
  78 #define STUB_NAME(x)             #x " Runtime1 stub",
  79 #define LAST_STUB_NAME(x)        #x " Runtime1 stub"
  80 
  81 class Runtime1: public AllStatic {
  82   friend class VMStructs;
  83   friend class ArrayCopyStub;
  84 
  85  public:
  86   enum StubID {
  87     RUNTIME1_STUBS(DECLARE_STUB_ID, DECLARE_LAST_STUB_ID)
  88   };
  89 
  90   // statistics
  91 #ifndef PRODUCT
  92   static int _resolve_invoke_cnt;
  93   static int _handle_wrong_method_cnt;


 172   static address   entry_for(StubID id)          { return blob_for(id)->code_begin(); }
 173   static const char* name_for (StubID id);
 174   static const char* name_for_address(address entry);
 175 
 176   // platform might add runtime names.
 177   static const char* pd_name_for_address(address entry);
 178 
 179   // method tracing
 180   static void trace_block_entry(jint block_id);
 181 
 182 #ifndef PRODUCT
 183   static address throw_count_address()               { return (address)&_throw_count;             }
 184   static address arraycopy_count_address(BasicType type);
 185 #endif
 186 
 187   // directly accessible leaf routine
 188   static int  arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int dst_pos, int length);
 189   static void primitive_arraycopy(HeapWord* src, HeapWord* dst, int length);
 190   static void oop_arraycopy(HeapWord* src, HeapWord* dst, int length);
 191   static int  is_instance_of(oopDesc* mirror, oopDesc* obj);


 192 
 193   static void print_statistics()                 PRODUCT_RETURN;
 194 };
 195 
 196 #endif // SHARE_VM_C1_C1_RUNTIME1_HPP


  54   stub(new_multi_array)              \
  55   stub(handle_exception_nofpu)         /* optimized version that does not preserve fpu registers */ \
  56   stub(handle_exception)             \
  57   stub(handle_exception_from_callee) \
  58   stub(throw_array_store_exception)  \
  59   stub(throw_class_cast_exception)   \
  60   stub(throw_incompatible_class_change_error)   \
  61   stub(slow_subtype_check)           \
  62   stub(monitorenter)                 \
  63   stub(monitorenter_nofpu)             /* optimized version that does not preserve fpu registers */ \
  64   stub(monitorexit)                  \
  65   stub(monitorexit_nofpu)              /* optimized version that does not preserve fpu registers */ \
  66   stub(deoptimize)                   \
  67   stub(access_field_patching)        \
  68   stub(load_klass_patching)          \
  69   stub(load_mirror_patching)         \
  70   stub(g1_pre_barrier_slow)          \
  71   stub(g1_post_barrier_slow)         \
  72   stub(fpu2long_stub)                \
  73   stub(counter_overflow)             \
  74   stub(predicate_failed_trap)        \
  75   last_entry(number_of_ids)
  76 
  77 #define DECLARE_STUB_ID(x)       x ## _id ,
  78 #define DECLARE_LAST_STUB_ID(x)  x
  79 #define STUB_NAME(x)             #x " Runtime1 stub",
  80 #define LAST_STUB_NAME(x)        #x " Runtime1 stub"
  81 
  82 class Runtime1: public AllStatic {
  83   friend class VMStructs;
  84   friend class ArrayCopyStub;
  85 
  86  public:
  87   enum StubID {
  88     RUNTIME1_STUBS(DECLARE_STUB_ID, DECLARE_LAST_STUB_ID)
  89   };
  90 
  91   // statistics
  92 #ifndef PRODUCT
  93   static int _resolve_invoke_cnt;
  94   static int _handle_wrong_method_cnt;


 173   static address   entry_for(StubID id)          { return blob_for(id)->code_begin(); }
 174   static const char* name_for (StubID id);
 175   static const char* name_for_address(address entry);
 176 
 177   // platform might add runtime names.
 178   static const char* pd_name_for_address(address entry);
 179 
 180   // method tracing
 181   static void trace_block_entry(jint block_id);
 182 
 183 #ifndef PRODUCT
 184   static address throw_count_address()               { return (address)&_throw_count;             }
 185   static address arraycopy_count_address(BasicType type);
 186 #endif
 187 
 188   // directly accessible leaf routine
 189   static int  arraycopy(oopDesc* src, int src_pos, oopDesc* dst, int dst_pos, int length);
 190   static void primitive_arraycopy(HeapWord* src, HeapWord* dst, int length);
 191   static void oop_arraycopy(HeapWord* src, HeapWord* dst, int length);
 192   static int  is_instance_of(oopDesc* mirror, oopDesc* obj);
 193 
 194   static void predicate_failed_trap(JavaThread* thread);
 195 
 196   static void print_statistics()                 PRODUCT_RETURN;
 197 };
 198 
 199 #endif // SHARE_VM_C1_C1_RUNTIME1_HPP