comparison src/cpu/x86/vm/interp_masm_x86_32.cpp @ 622:56aae7be60d4

6812678: macro assembler needs delayed binding of a few constants (for 6655638) Summary: minor assembler enhancements preparing for method handles Reviewed-by: kvn
author jrose
date Wed, 04 Mar 2009 09:58:39 -0800
parents dc3ad84615cf
children 2f2f54ed12ce
comparison
equal deleted inserted replaced
621:19f25e603e7b 622:56aae7be60d4
190 190
191 191
192 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset) { 192 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset) {
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 assert(cache != index, "must use different registers"); 194 assert(cache != index, "must use different registers");
195 load_unsigned_word(index, Address(rsi, bcp_offset)); 195 load_unsigned_short(index, Address(rsi, bcp_offset));
196 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); 196 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
197 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); 197 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below");
198 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index 198 shlptr(index, 2); // convert from field index to ConstantPoolCacheEntry index
199 } 199 }
200 200
201 201
202 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) { 202 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {
203 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); 203 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
204 assert(cache != tmp, "must use different register"); 204 assert(cache != tmp, "must use different register");
205 load_unsigned_word(tmp, Address(rsi, bcp_offset)); 205 load_unsigned_short(tmp, Address(rsi, bcp_offset));
206 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below"); 206 assert(sizeof(ConstantPoolCacheEntry) == 4*wordSize, "adjust code below");
207 // convert from field index to ConstantPoolCacheEntry index 207 // convert from field index to ConstantPoolCacheEntry index
208 // and from word offset to byte offset 208 // and from word offset to byte offset
209 shll(tmp, 2 + LogBytesPerWord); 209 shll(tmp, 2 + LogBytesPerWord);
210 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize)); 210 movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
1029 test_method_data_pointer(rcx, verify_continue); // If mdp is zero, continue 1029 test_method_data_pointer(rcx, verify_continue); // If mdp is zero, continue
1030 get_method(rbx); 1030 get_method(rbx);
1031 1031
1032 // If the mdp is valid, it will point to a DataLayout header which is 1032 // If the mdp is valid, it will point to a DataLayout header which is
1033 // consistent with the bcp. The converse is highly probable also. 1033 // consistent with the bcp. The converse is highly probable also.
1034 load_unsigned_word(rdx, Address(rcx, in_bytes(DataLayout::bci_offset()))); 1034 load_unsigned_short(rdx, Address(rcx, in_bytes(DataLayout::bci_offset())));
1035 addptr(rdx, Address(rbx, methodOopDesc::const_offset())); 1035 addptr(rdx, Address(rbx, methodOopDesc::const_offset()));
1036 lea(rdx, Address(rdx, constMethodOopDesc::codes_offset())); 1036 lea(rdx, Address(rdx, constMethodOopDesc::codes_offset()));
1037 cmpptr(rdx, rsi); 1037 cmpptr(rdx, rsi);
1038 jcc(Assembler::equal, verify_continue); 1038 jcc(Assembler::equal, verify_continue);
1039 // rbx,: method 1039 // rbx,: method