src/share/vm/oops/cpCacheOop.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7017732 Sdiff src/share/vm/oops

src/share/vm/oops/cpCacheOop.cpp

Print this page




 116 bool ConstantPoolCacheEntry::same_methodOop(oop cur_f1, oop f1) {
 117   return (cur_f1 == f1 || ((methodOop)cur_f1)->name() ==
 118          ((methodOop)f1)->name() || ((methodOop)cur_f1)->signature() ==
 119          ((methodOop)f1)->signature());
 120 }
 121 #endif
 122 
 123 // Note that concurrent update of both bytecodes can leave one of them
 124 // reset to zero.  This is harmless; the interpreter will simply re-resolve
 125 // the damaged entry.  More seriously, the memory synchronization is needed
 126 // to flush other fields (f1, f2) completely to memory before the bytecodes
 127 // are updated, lest other processors see a non-zero bytecode but zero f1/f2.
 128 void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
 129                                        Bytecodes::Code put_code,
 130                                        KlassHandle field_holder,
 131                                        int orig_field_index,
 132                                        int field_offset,
 133                                        TosState field_type,
 134                                        bool is_final,
 135                                        bool is_volatile) {
 136   set_f1(field_holder());
 137   set_f2(field_offset);
 138   // The field index is used by jvm/ti and is the index into fields() array
 139   // in holder instanceKlass.  This is scaled by instanceKlass::next_offset.
 140   assert((orig_field_index % instanceKlass::next_offset) == 0, "wierd index");
 141   const int field_index = orig_field_index / instanceKlass::next_offset;
 142   assert(field_index <= field_index_mask,
 143          "field index does not fit in low flag bits");
 144   set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) |
 145             (field_index & field_index_mask));
 146   set_bytecode_1(get_code);
 147   set_bytecode_2(put_code);
 148   NOT_PRODUCT(verify(tty));
 149 }
 150 
 151 int  ConstantPoolCacheEntry::field_index() const {
 152   return (_flags & field_index_mask) * instanceKlass::next_offset;
 153 }
 154 
 155 void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
 156                                         methodHandle method,




 116 bool ConstantPoolCacheEntry::same_methodOop(oop cur_f1, oop f1) {
 117   return (cur_f1 == f1 || ((methodOop)cur_f1)->name() ==
 118          ((methodOop)f1)->name() || ((methodOop)cur_f1)->signature() ==
 119          ((methodOop)f1)->signature());
 120 }
 121 #endif
 122 
 123 // Note that concurrent update of both bytecodes can leave one of them
 124 // reset to zero.  This is harmless; the interpreter will simply re-resolve
 125 // the damaged entry.  More seriously, the memory synchronization is needed
 126 // to flush other fields (f1, f2) completely to memory before the bytecodes
 127 // are updated, lest other processors see a non-zero bytecode but zero f1/f2.
 128 void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
 129                                        Bytecodes::Code put_code,
 130                                        KlassHandle field_holder,
 131                                        int orig_field_index,
 132                                        int field_offset,
 133                                        TosState field_type,
 134                                        bool is_final,
 135                                        bool is_volatile) {
 136   set_f1(field_holder()->java_mirror());
 137   set_f2(field_offset);
 138   // The field index is used by jvm/ti and is the index into fields() array
 139   // in holder instanceKlass.  This is scaled by instanceKlass::next_offset.
 140   assert((orig_field_index % instanceKlass::next_offset) == 0, "wierd index");
 141   const int field_index = orig_field_index / instanceKlass::next_offset;
 142   assert(field_index <= field_index_mask,
 143          "field index does not fit in low flag bits");
 144   set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) |
 145             (field_index & field_index_mask));
 146   set_bytecode_1(get_code);
 147   set_bytecode_2(put_code);
 148   NOT_PRODUCT(verify(tty));
 149 }
 150 
 151 int  ConstantPoolCacheEntry::field_index() const {
 152   return (_flags & field_index_mask) * instanceKlass::next_offset;
 153 }
 154 
 155 void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
 156                                         methodHandle method,


src/share/vm/oops/cpCacheOop.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File