136 volatile intx _flags; // flags |
136 volatile intx _flags; // flags |
137 |
137 |
138 |
138 |
139 void set_bytecode_1(Bytecodes::Code code); |
139 void set_bytecode_1(Bytecodes::Code code); |
140 void set_bytecode_2(Bytecodes::Code code); |
140 void set_bytecode_2(Bytecodes::Code code); |
141 void set_f1(Metadata* f1) { |
141 void set_f1(Metadata* f1) { |
142 Metadata* existing_f1 = (Metadata*)_f1; // read once |
142 Metadata* existing_f1 = (Metadata*)_f1; // read once |
143 assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change"); |
143 assert(existing_f1 == NULL || existing_f1 == f1, "illegal field change"); |
144 _f1 = f1; |
144 _f1 = f1; |
145 } |
145 } |
146 void release_set_f1(Metadata* f1); |
146 void release_set_f1(Metadata* f1); |
323 return false; // default: not resolved |
323 return false; // default: not resolved |
324 } |
324 } |
325 |
325 |
326 // Accessors |
326 // Accessors |
327 int indices() const { return _indices; } |
327 int indices() const { return _indices; } |
|
328 int indices_ord() const { return (intx)OrderAccess::load_ptr_acquire(&_indices); } |
328 int constant_pool_index() const { return (indices() & cp_index_mask); } |
329 int constant_pool_index() const { return (indices() & cp_index_mask); } |
329 Bytecodes::Code bytecode_1() const { return Bytecodes::cast((indices() >> bytecode_1_shift) & bytecode_1_mask); } |
330 Bytecodes::Code bytecode_1() const { return Bytecodes::cast((indices_ord() >> bytecode_1_shift) & bytecode_1_mask); } |
330 Bytecodes::Code bytecode_2() const { return Bytecodes::cast((indices() >> bytecode_2_shift) & bytecode_2_mask); } |
331 Bytecodes::Code bytecode_2() const { return Bytecodes::cast((indices_ord() >> bytecode_2_shift) & bytecode_2_mask); } |
331 Method* f1_as_method() const { Metadata* f1 = (Metadata*)_f1; assert(f1 == NULL || f1->is_method(), ""); return (Method*)f1; } |
332 Metadata* f1_ord() const { return (Metadata *)OrderAccess::load_ptr_acquire(&_f1); } |
332 Klass* f1_as_klass() const { Metadata* f1 = (Metadata*)_f1; assert(f1 == NULL || f1->is_klass(), ""); return (Klass*)f1; } |
333 Method* f1_as_method() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_method(), ""); return (Method*)f1; } |
333 bool is_f1_null() const { Metadata* f1 = (Metadata*)_f1; return f1 == NULL; } // classifies a CPC entry as unbound |
334 Klass* f1_as_klass() const { Metadata* f1 = f1_ord(); assert(f1 == NULL || f1->is_klass(), ""); return (Klass*)f1; } |
|
335 // Use the accessor f1() to acquire _f1's value. This is needed for |
|
336 // example in BytecodeInterpreter::run(), where is_f1_null() is |
|
337 // called to check if an invokedynamic call is resolved. This load |
|
338 // of _f1 must be ordered with the loads performed by |
|
339 // cache->main_entry_index(). |
|
340 bool is_f1_null() const { Metadata* f1 = f1_ord(); return f1 == NULL; } // classifies a CPC entry as unbound |
334 int f2_as_index() const { assert(!is_vfinal(), ""); return (int) _f2; } |
341 int f2_as_index() const { assert(!is_vfinal(), ""); return (int) _f2; } |
335 Method* f2_as_vfinal_method() const { assert(is_vfinal(), ""); return (Method*)_f2; } |
342 Method* f2_as_vfinal_method() const { assert(is_vfinal(), ""); return (Method*)_f2; } |
336 int field_index() const { assert(is_field_entry(), ""); return (_flags & field_index_mask); } |
343 int field_index() const { assert(is_field_entry(), ""); return (_flags & field_index_mask); } |
337 int parameter_size() const { assert(is_method_entry(), ""); return (_flags & parameter_size_mask); } |
344 int parameter_size() const { assert(is_method_entry(), ""); return (_flags & parameter_size_mask); } |
338 bool is_volatile() const { return (_flags & (1 << is_volatile_shift)) != 0; } |
345 bool is_volatile() const { return (_flags & (1 << is_volatile_shift)) != 0; } |
339 bool is_final() const { return (_flags & (1 << is_final_shift)) != 0; } |
346 bool is_final() const { return (_flags & (1 << is_final_shift)) != 0; } |
340 bool is_forced_virtual() const { return (_flags & (1 << is_forced_virtual_shift)) != 0; } |
347 bool is_forced_virtual() const { return (_flags & (1 << is_forced_virtual_shift)) != 0; } |