213 void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_offset, size_t index_size) { |
213 void InterpreterMacroAssembler::get_cache_index_at_bcp(Register reg, int bcp_offset, size_t index_size) { |
214 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
214 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); |
215 if (index_size == sizeof(u2)) { |
215 if (index_size == sizeof(u2)) { |
216 load_unsigned_short(reg, Address(rsi, bcp_offset)); |
216 load_unsigned_short(reg, Address(rsi, bcp_offset)); |
217 } else if (index_size == sizeof(u4)) { |
217 } else if (index_size == sizeof(u4)) { |
218 assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); |
218 assert(EnableInvokeDynamic, "giant index used only for JSR 292"); |
219 movl(reg, Address(rsi, bcp_offset)); |
219 movl(reg, Address(rsi, bcp_offset)); |
220 // Check if the secondary index definition is still ~x, otherwise |
220 // Check if the secondary index definition is still ~x, otherwise |
221 // we have to change the following assembler code to calculate the |
221 // we have to change the following assembler code to calculate the |
222 // plain index. |
222 // plain index. |
223 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); |
223 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); |
224 notl(reg); // convert to plain index |
224 notl(reg); // convert to plain index |
225 } else if (index_size == sizeof(u1)) { |
225 } else if (index_size == sizeof(u1)) { |
226 assert(EnableMethodHandles, "tiny index used only for EnableMethodHandles"); |
226 assert(EnableInvokeDynamic, "tiny index used only for JSR 292"); |
227 load_unsigned_byte(reg, Address(rsi, bcp_offset)); |
227 load_unsigned_byte(reg, Address(rsi, bcp_offset)); |
228 } else { |
228 } else { |
229 ShouldNotReachHere(); |
229 ShouldNotReachHere(); |
230 } |
230 } |
231 } |
231 } |