124 |
124 |
125 void ConstantPoolCacheEntry::set_parameter_size(int value) { |
125 void ConstantPoolCacheEntry::set_parameter_size(int value) { |
126 // This routine is called only in corner cases where the CPCE is not yet initialized. |
126 // This routine is called only in corner cases where the CPCE is not yet initialized. |
127 // See AbstractInterpreter::deopt_continue_after_entry. |
127 // See AbstractInterpreter::deopt_continue_after_entry. |
128 assert(_flags == 0 || parameter_size() == 0 || parameter_size() == value, |
128 assert(_flags == 0 || parameter_size() == 0 || parameter_size() == value, |
129 err_msg("size must not change: parameter_size=%d, value=%d", parameter_size(), value)); |
129 "size must not change: parameter_size=%d, value=%d", parameter_size(), value); |
130 // Setting the parameter size by itself is only safe if the |
130 // Setting the parameter size by itself is only safe if the |
131 // current value of _flags is 0, otherwise another thread may have |
131 // current value of _flags is 0, otherwise another thread may have |
132 // updated it and we don't want to overwrite that value. Don't |
132 // updated it and we don't want to overwrite that value. Don't |
133 // bother trying to update it once it's nonzero but always make |
133 // bother trying to update it once it's nonzero but always make |
134 // sure that the final parameter size agrees with what was passed. |
134 // sure that the final parameter size agrees with what was passed. |
135 if (_flags == 0) { |
135 if (_flags == 0) { |
136 Atomic::cmpxchg_ptr((value & parameter_size_mask), &_flags, 0); |
136 Atomic::cmpxchg_ptr((value & parameter_size_mask), &_flags, 0); |
137 } |
137 } |
138 guarantee(parameter_size() == value, |
138 guarantee(parameter_size() == value, |
139 err_msg("size must not change: parameter_size=%d, value=%d", parameter_size(), value)); |
139 "size must not change: parameter_size=%d, value=%d", parameter_size(), value); |
140 } |
140 } |
141 |
141 |
142 void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code, |
142 void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code, |
143 methodHandle method, |
143 methodHandle method, |
144 int vtable_index) { |
144 int vtable_index) { |
591 #ifdef ASSERT |
591 #ifdef ASSERT |
592 // invokedynamic and invokehandle have more entries; check if they |
592 // invokedynamic and invokehandle have more entries; check if they |
593 // all point to the same constant pool cache entry. |
593 // all point to the same constant pool cache entry. |
594 for (int entry = 1; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) { |
594 for (int entry = 1; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) { |
595 const int cpci_next = invokedynamic_references_map[ref + entry]; |
595 const int cpci_next = invokedynamic_references_map[ref + entry]; |
596 assert(cpci == cpci_next, err_msg_res("%d == %d", cpci, cpci_next)); |
596 assert(cpci == cpci_next, "%d == %d", cpci, cpci_next); |
597 } |
597 } |
598 #endif |
598 #endif |
599 entry_at(cpci)->initialize_resolved_reference_index(ref); |
599 entry_at(cpci)->initialize_resolved_reference_index(ref); |
600 ref += ConstantPoolCacheEntry::_indy_resolved_references_entries - 1; // skip extra entries |
600 ref += ConstantPoolCacheEntry::_indy_resolved_references_entries - 1; // skip extra entries |
601 } |
601 } |