198 jmp(rax); 199 bind(L); 200 get_thread(java_thread); 201 } 202 } 203 204 205 void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { 206 assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); 207 movl(reg, Address(rsi, bcp_offset)); 208 bswapl(reg); 209 shrl(reg, 16); 210 } 211 212 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"); 215 if (index_size == sizeof(u2)) { 216 load_unsigned_short(reg, Address(rsi, bcp_offset)); 217 } else if (index_size == sizeof(u4)) { 218 assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic"); 219 movl(reg, Address(rsi, bcp_offset)); 220 // Check if the secondary index definition is still ~x, otherwise 221 // we have to change the following assembler code to calculate the 222 // plain index. 223 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); 224 notl(reg); // convert to plain index 225 } else if (index_size == sizeof(u1)) { 226 assert(EnableMethodHandles, "tiny index used only for EnableMethodHandles"); 227 load_unsigned_byte(reg, Address(rsi, bcp_offset)); 228 } else { 229 ShouldNotReachHere(); 230 } 231 } 232 233 234 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, 235 int bcp_offset, size_t index_size) { 236 assert(cache != index, "must use different registers"); 237 get_cache_index_at_bcp(index, bcp_offset, index_size); 238 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); 239 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); 240 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index 241 } 242 243 244 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, 245 int bcp_offset, size_t index_size) { 246 assert(cache != tmp, "must use different register"); | 198 jmp(rax); 199 bind(L); 200 get_thread(java_thread); 201 } 202 } 203 204 205 void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { 206 assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); 207 movl(reg, Address(rsi, bcp_offset)); 208 bswapl(reg); 209 shrl(reg, 16); 210 } 211 212 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"); 215 if (index_size == sizeof(u2)) { 216 load_unsigned_short(reg, Address(rsi, bcp_offset)); 217 } else if (index_size == sizeof(u4)) { 218 assert(EnableInvokeDynamic, "giant index used only for JSR 292"); 219 movl(reg, Address(rsi, bcp_offset)); 220 // Check if the secondary index definition is still ~x, otherwise 221 // we have to change the following assembler code to calculate the 222 // plain index. 223 assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line"); 224 notl(reg); // convert to plain index 225 } else if (index_size == sizeof(u1)) { 226 assert(EnableInvokeDynamic, "tiny index used only for JSR 292"); 227 load_unsigned_byte(reg, Address(rsi, bcp_offset)); 228 } else { 229 ShouldNotReachHere(); 230 } 231 } 232 233 234 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, 235 int bcp_offset, size_t index_size) { 236 assert(cache != index, "must use different registers"); 237 get_cache_index_at_bcp(index, bcp_offset, index_size); 238 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); 239 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); 240 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index 241 } 242 243 244 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, 245 int bcp_offset, size_t index_size) { 246 assert(cache != tmp, "must use different register"); |