187 bswapl(reg); |
187 bswapl(reg); |
188 shrl(reg, 16); |
188 shrl(reg, 16); |
189 } |
189 } |
190 |
190 |
191 |
191 |
192 void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_offset, bool giant_index) { |
192 void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_offset, size_t index_size) { |
193 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
193 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
194 if (!giant_index) { |
194 if (index_size == sizeof(u2)) { |
195 load_unsigned_short(reg, Address(rsi, bcp_offset)); |
195 load_unsigned_short(reg, Address(rsi, bcp_offset)); |
196 } else { |
196 } else if (index_size == sizeof(u4)) { |
197 assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); |
197 assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); |
198 movl(reg, Address(rsi, bcp_offset)); |
198 movl(reg, Address(rsi, bcp_offset)); |
199 // Check if the secondary index definition is still ~x, otherwise |
199 // Check if the secondary index definition is still ~x, otherwise |
200 // we have to change the following assembler code to calculate the |
200 // we have to change the following assembler code to calculate the |
201 // plain index. |
201 // plain index. |
202 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); |
202 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); |
203 notl(reg); // convert to plain index |
203 notl(reg); // convert to plain index |
|
204 } else if (index_size == sizeof(u1)) { |
|
205 assert(EnableMethodHandles, "tiny index used only for EnableMethodHandles"); |
|
206 load_unsigned_byte(reg, Address(rsi, bcp_offset)); |
|
207 } else { |
|
208 ShouldNotReachHere(); |
204 } |
209 } |
205 } |
210 } |
206 |
211 |
207 |
212 |
208 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, |
213 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, |
209 int bcp_offset, bool giant_index) { |
214 int bcp_offset, size_t index_size) { |
210 assert(cache != index, "must use different registers"); |
215 assert(cache != index, "must use different registers"); |
211 get_cache_index_at_bcp(index, bcp_offset, giant_index); |
216 get_cache_index_at_bcp(index, bcp_offset, index_size); |
212 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); |
217 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); |
213 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
218 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
214 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index |
219 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index |
215 } |
220 } |
216 |
221 |
217 |
222 |
218 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, |
223 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, |
219 int bcp_offset, bool giant_index) { |
224 int bcp_offset, size_t index_size) { |
220 assert(cache != tmp, "must use different register"); |
225 assert(cache != tmp, "must use different register"); |
221 get_cache_index_at_bcp(tmp, bcp_offset, giant_index); |
226 get_cache_index_at_bcp(tmp, bcp_offset, index_size); |
222 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
227 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); |
223 // convert from field index to ConstantPoolCacheEntry index |
228 // convert from field index to ConstantPoolCacheEntry index |
224 // and from word offset to byte offset |
229 // and from word offset to byte offset |
225 shll(tmp, 2 + LogBytesPerWord); |
230 shll(tmp, 2 + LogBytesPerWord); |
226 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); |
231 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); |