< prev index next >

src/hotspot/share/oops/cpCache.hpp

Print this page




 143 
 144   void set_bytecode_1(Bytecodes::Code code);
 145   void set_bytecode_2(Bytecodes::Code code);
 146   void set_f1(Metadata* f1) {
 147     Metadata* existing_f1 = _f1; // read once
 148     assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change");
 149     _f1 = f1;
 150   }
 151   void release_set_f1(Metadata* f1);
 152   void set_f2(intx f2) {
 153     intx existing_f2 = _f2; // read once
 154     assert(existing_f2 == 0 || existing_f2 == f2, "illegal field change");
 155     _f2 = f2;
 156   }
 157   void set_f2_as_vfinal_method(Method* f2) {
 158     assert(is_vfinal(), "flags must be set");
 159     set_f2((intx)f2);
 160   }
 161   int make_flags(TosState state, int option_bits, int field_index_or_method_params);
 162   void set_flags(intx flags)                     { _flags = flags; }
 163   bool init_flags_atomic(intx flags);
 164   void set_field_flags(TosState field_type, int option_bits, int field_index) {
 165     assert((field_index & field_index_mask) == field_index, "field_index in range");
 166     set_flags(make_flags(field_type, option_bits | (1 << is_field_entry_shift), field_index));
 167   }
 168   void set_method_flags(TosState return_type, int option_bits, int method_params) {
 169     assert((method_params & parameter_size_mask) == method_params, "method_params in range");
 170     set_flags(make_flags(return_type, option_bits, method_params));
 171   }
 172   bool init_method_flags_atomic(TosState return_type, int option_bits, int method_params) {
 173     assert((method_params & parameter_size_mask) == method_params, "method_params in range");
 174     return init_flags_atomic(make_flags(return_type, option_bits, method_params));
 175   }
 176 
 177  public:
 178   // specific bit definitions for the flags field:
 179   // (Note: the interpreter must use these definitions to access the CP cache.)
 180   enum {
 181     // high order bits are the TosState corresponding to field type or method return type
 182     tos_state_bits             = 4,
 183     tos_state_mask             = right_n_bits(tos_state_bits),
 184     tos_state_shift            = BitsPerInt - tos_state_bits,  // see verify_tos_state_shift below
 185     // misc. option bits; can be any bit position in [16..27]
 186     is_field_entry_shift       = 26,  // (F) is it a field or a method?
 187     has_method_type_shift      = 25,  // (M) does the call site have a MethodType?
 188     has_appendix_shift         = 24,  // (A) does the call site have an appendix argument?
 189     is_forced_virtual_shift    = 23,  // (I) is the interface reference forced to virtual mode?
 190     is_final_shift             = 22,  // (f) is the field or method final?
 191     is_volatile_shift          = 21,  // (v) is the field volatile?
 192     is_vfinal_shift            = 20,  // (vf) did the call resolve to a final method?
 193     // low order bits give field index (for FieldInfo) or method parameter size:
 194     field_index_bits           = 16,




 143 
 144   void set_bytecode_1(Bytecodes::Code code);
 145   void set_bytecode_2(Bytecodes::Code code);
 146   void set_f1(Metadata* f1) {
 147     Metadata* existing_f1 = _f1; // read once
 148     assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change");
 149     _f1 = f1;
 150   }
 151   void release_set_f1(Metadata* f1);
 152   void set_f2(intx f2) {
 153     intx existing_f2 = _f2; // read once
 154     assert(existing_f2 == 0 || existing_f2 == f2, "illegal field change");
 155     _f2 = f2;
 156   }
 157   void set_f2_as_vfinal_method(Method* f2) {
 158     assert(is_vfinal(), "flags must be set");
 159     set_f2((intx)f2);
 160   }
 161   int make_flags(TosState state, int option_bits, int field_index_or_method_params);
 162   void set_flags(intx flags)                     { _flags = flags; }

 163   void set_field_flags(TosState field_type, int option_bits, int field_index) {
 164     assert((field_index & field_index_mask) == field_index, "field_index in range");
 165     set_flags(make_flags(field_type, option_bits | (1 << is_field_entry_shift), field_index));
 166   }
 167   void set_method_flags(TosState return_type, int option_bits, int method_params) {
 168     assert((method_params & parameter_size_mask) == method_params, "method_params in range");
 169     set_flags(make_flags(return_type, option_bits, method_params));




 170   }
 171 
 172  public:
 173   // specific bit definitions for the flags field:
 174   // (Note: the interpreter must use these definitions to access the CP cache.)
 175   enum {
 176     // high order bits are the TosState corresponding to field type or method return type
 177     tos_state_bits             = 4,
 178     tos_state_mask             = right_n_bits(tos_state_bits),
 179     tos_state_shift            = BitsPerInt - tos_state_bits,  // see verify_tos_state_shift below
 180     // misc. option bits; can be any bit position in [16..27]
 181     is_field_entry_shift       = 26,  // (F) is it a field or a method?
 182     has_method_type_shift      = 25,  // (M) does the call site have a MethodType?
 183     has_appendix_shift         = 24,  // (A) does the call site have an appendix argument?
 184     is_forced_virtual_shift    = 23,  // (I) is the interface reference forced to virtual mode?
 185     is_final_shift             = 22,  // (f) is the field or method final?
 186     is_volatile_shift          = 21,  // (v) is the field volatile?
 187     is_vfinal_shift            = 20,  // (vf) did the call resolve to a final method?
 188     // low order bits give field index (for FieldInfo) or method parameter size:
 189     field_index_bits           = 16,


< prev index next >