149 } 150 __ call_VM(rax, 151 CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception), 152 c_rarg1, c_rarg2); 153 } 154 // throw exception 155 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); 156 return entry; 157 } 158 159 160 address TemplateInterpreterGenerator::generate_continuation_for(TosState state) { 161 address entry = __ pc(); 162 // NULL last_sp until next java call 163 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 164 __ dispatch_next(state); 165 return entry; 166 } 167 168 169 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 170 address entry = __ pc(); 171 172 // Restore stack bottom in case i2c adjusted stack 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 175 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 176 177 __ restore_bcp(); 178 __ restore_locals(); 179 180 if (state == atos) { 181 Register mdp = rbx; 182 Register tmp = rcx; 183 __ profile_return_type(mdp, rax, tmp); 184 } 185 186 Label L_got_cache, L_giant_index; 187 if (EnableInvokeDynamic) { 188 __ cmpb(Address(r13, 0), Bytecodes::_invokedynamic); 189 __ jcc(Assembler::equal, L_giant_index); 190 } 191 __ get_cache_and_index_at_bcp(rbx, rcx, 1, sizeof(u2)); 192 __ bind(L_got_cache); 193 __ movl(rbx, Address(rbx, rcx, 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); 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 208 return entry; 209 } 210 211 212 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, 213 int step) { 214 address entry = __ pc(); 215 // NULL last_sp until next java call 216 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 217 __ restore_bcp(); 218 __ restore_locals(); 219 // handle exceptions 220 { 221 Label L; 222 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t) NULL_WORD); 223 __ jcc(Assembler::zero, L); 224 __ call_VM(noreg, 225 CAST_FROM_FN_PTR(address, 226 InterpreterRuntime::throw_pending_exception)); 227 __ should_not_reach_here(); | 149 } 150 __ call_VM(rax, 151 CAST_FROM_FN_PTR(address, InterpreterRuntime::create_exception), 152 c_rarg1, c_rarg2); 153 } 154 // throw exception 155 __ jump(ExternalAddress(Interpreter::throw_exception_entry())); 156 return entry; 157 } 158 159 160 address TemplateInterpreterGenerator::generate_continuation_for(TosState state) { 161 address entry = __ pc(); 162 // NULL last_sp until next java call 163 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 164 __ dispatch_next(state); 165 return entry; 166 } 167 168 169 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) { 170 address entry = __ pc(); 171 172 // Restore stack bottom in case i2c adjusted stack 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 175 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 176 177 __ restore_bcp(); 178 __ restore_locals(); 179 180 if (state == atos) { 181 Register mdp = rbx; 182 Register tmp = rcx; 183 __ profile_return_type(mdp, rax, tmp); 184 } 185 186 const Register cache = rbx; 187 const Register index = rcx; 188 __ get_cache_and_index_at_bcp(cache, index, 1, index_size); 189 190 const Register flags = cache; 191 __ movl(flags, Address(cache, index, Address::times_ptr, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset())); 192 __ andl(flags, ConstantPoolCacheEntry::parameter_size_mask); 193 __ lea(rsp, Address(rsp, flags, Interpreter::stackElementScale())); 194 __ dispatch_next(state, step); 195 196 return entry; 197 } 198 199 200 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, 201 int step) { 202 address entry = __ pc(); 203 // NULL last_sp until next java call 204 __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD); 205 __ restore_bcp(); 206 __ restore_locals(); 207 // handle exceptions 208 { 209 Label L; 210 __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t) NULL_WORD); 211 __ jcc(Assembler::zero, L); 212 __ call_VM(noreg, 213 CAST_FROM_FN_PTR(address, 214 InterpreterRuntime::throw_pending_exception)); 215 __ should_not_reach_here(); |