comparison src/share/vm/oops/cpCacheOop.cpp @ 3938:e6b1331a51d2

7086585: make Java field injection more flexible Reviewed-by: jrose, twisti, kvn, coleenp
author never
date Sat, 10 Sep 2011 17:29:02 -0700
parents ddd894528dbc
children f096e1b74d85
comparison
equal deleted inserted replaced
3937:c565834fb592 3938:e6b1331a51d2
126 // to flush other fields (f1, f2) completely to memory before the bytecodes 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. 127 // are updated, lest other processors see a non-zero bytecode but zero f1/f2.
128 void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code, 128 void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
129 Bytecodes::Code put_code, 129 Bytecodes::Code put_code,
130 KlassHandle field_holder, 130 KlassHandle field_holder,
131 int orig_field_index, 131 int field_index,
132 int field_offset, 132 int field_offset,
133 TosState field_type, 133 TosState field_type,
134 bool is_final, 134 bool is_final,
135 bool is_volatile) { 135 bool is_volatile) {
136 set_f1(field_holder()->java_mirror()); 136 set_f1(field_holder()->java_mirror());
137 set_f2(field_offset); 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, 138 assert(field_index <= field_index_mask,
143 "field index does not fit in low flag bits"); 139 "field index does not fit in low flag bits");
144 set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) | 140 set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) |
145 (field_index & field_index_mask)); 141 (field_index & field_index_mask));
146 set_bytecode_1(get_code); 142 set_bytecode_1(get_code);
147 set_bytecode_2(put_code); 143 set_bytecode_2(put_code);
148 NOT_PRODUCT(verify(tty)); 144 NOT_PRODUCT(verify(tty));
149 } 145 }
150 146
151 int ConstantPoolCacheEntry::field_index() const { 147 int ConstantPoolCacheEntry::field_index() const {
152 return (_flags & field_index_mask) * instanceKlass::next_offset; 148 return (_flags & field_index_mask);
153 } 149 }
154 150
155 void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code, 151 void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
156 methodHandle method, 152 methodHandle method,
157 int vtable_index) { 153 int vtable_index) {