comparison src/cpu/x86/vm/templateInterpreter_x86_64.cpp @ 5604:bd3237e0e18d

8026328: Setting a breakpoint on invokedynamic crashes the JVM Reviewed-by: jrose, roland
author twisti
date Thu, 24 Oct 2013 16:23:07 -0700
parents 5ccbab1c69f3
children
comparison
equal deleted inserted replaced
50:f0e751ce0e7c 51:780831b3ec2e
164 __ dispatch_next(state); 164 __ dispatch_next(state);
165 return entry; 165 return entry;
166 } 166 }
167 167
168 168
169 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 169 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
170 address entry = __ pc(); 170 address entry = __ pc();
171 171
172 // Restore stack bottom in case i2c adjusted stack 172 // Restore stack bottom in case i2c adjusted stack
173 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize)); 173 __ movptr(rsp, Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize));
174 // and NULL it as marker that esp is now tos until next java call 174 // and NULL it as marker that esp is now tos until next java call
181 Register mdp = rbx; 181 Register mdp = rbx;
182 Register tmp = rcx; 182 Register tmp = rcx;
183 __ profile_return_type(mdp, rax, tmp); 183 __ profile_return_type(mdp, rax, tmp);
184 } 184 }
185 185
186 Label L_got_cache, L_giant_index; 186 const Register cache = rbx;
187 if (EnableInvokeDynamic) { 187 const Register index = rcx;
188 __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); 188 __ get_cache_and_index_at_bcp(cache, index, 1, index_size);
189 __ jcc(Assembler::equal, L_giant_index); 189
190 } 190 const Register flags = cache;
191 __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); 191 __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
192 __ bind(L_got_cache); 192 __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask);
193 __ movl(rbx, Address(rbx, rcx, 193 __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale()));
194 Address::times_ptr,
195 in_bytes(ConstantPoolCache::base_offset()) +
196 3 * wordSize));
197 __ andl(rbx, 0xFF);
198 __ lea(rsp, Address(rsp, rbx, Address::times_8));
199 __ dispatch_next(state, step); 194 __ dispatch_next(state, step);
200
201 // out of the main line of code...
202 if (EnableInvokeDynamic) {
203 __ bind(L_giant_index);
204 __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u4));
205 __ jmp(L_got_cache);
206 }
207 195
208 return entry; 196 return entry;
209 } 197 }
210 198
211 199