176 #ifndef PRODUCT |
176 #ifndef PRODUCT |
177 EntryPoint TemplateInterpreter::_trace_code; |
177 EntryPoint TemplateInterpreter::_trace_code; |
178 #endif // !PRODUCT |
178 #endif // !PRODUCT |
179 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries]; |
179 EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries]; |
180 EntryPoint TemplateInterpreter::_earlyret_entry; |
180 EntryPoint TemplateInterpreter::_earlyret_entry; |
|
181 EntryPoint TemplateInterpreter::_return_unbox_entry; |
181 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ]; |
182 EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ]; |
182 EntryPoint TemplateInterpreter::_continuation_entry; |
183 EntryPoint TemplateInterpreter::_continuation_entry; |
183 EntryPoint TemplateInterpreter::_safept_entry; |
184 EntryPoint TemplateInterpreter::_safept_entry; |
184 |
185 |
185 address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; |
186 address TemplateInterpreter::_return_3_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; |
186 address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; |
187 address TemplateInterpreter::_return_5_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; |
|
188 address TemplateInterpreter::_return_5_unbox_addrs_by_index[TemplateInterpreter::number_of_return_addrs]; |
187 |
189 |
188 DispatchTable TemplateInterpreter::_active_table; |
190 DispatchTable TemplateInterpreter::_active_table; |
189 DispatchTable TemplateInterpreter::_normal_table; |
191 DispatchTable TemplateInterpreter::_normal_table; |
190 DispatchTable TemplateInterpreter::_safept_table; |
192 DispatchTable TemplateInterpreter::_safept_table; |
191 address TemplateInterpreter::_wentry_point[DispatchTable::length]; |
193 address TemplateInterpreter::_wentry_point[DispatchTable::length]; |
249 generate_return_entry_for(vtos, i) |
251 generate_return_entry_for(vtos, i) |
250 ); |
252 ); |
251 } |
253 } |
252 } |
254 } |
253 |
255 |
|
256 if (EnableInvokeDynamic) { |
|
257 CodeletMark cm(_masm, "unboxing return entry points"); |
|
258 Interpreter::_return_unbox_entry = |
|
259 EntryPoint( |
|
260 generate_return_unbox_entry_for(btos, 5), |
|
261 generate_return_unbox_entry_for(ctos, 5), |
|
262 generate_return_unbox_entry_for(stos, 5), |
|
263 generate_return_unbox_entry_for(atos, 5), // cast conversion |
|
264 generate_return_unbox_entry_for(itos, 5), |
|
265 generate_return_unbox_entry_for(ltos, 5), |
|
266 generate_return_unbox_entry_for(ftos, 5), |
|
267 generate_return_unbox_entry_for(dtos, 5), |
|
268 Interpreter::_return_entry[5].entry(vtos) // no unboxing for void |
|
269 ); |
|
270 } |
|
271 |
254 { CodeletMark cm(_masm, "earlyret entry points"); |
272 { CodeletMark cm(_masm, "earlyret entry points"); |
255 Interpreter::_earlyret_entry = |
273 Interpreter::_earlyret_entry = |
256 EntryPoint( |
274 EntryPoint( |
257 generate_earlyret_entry_for(btos), |
275 generate_earlyret_entry_for(btos), |
258 generate_earlyret_entry_for(ctos), |
276 generate_earlyret_entry_for(ctos), |
296 } |
314 } |
297 } |
315 } |
298 |
316 |
299 for (int j = 0; j < number_of_states; j++) { |
317 for (int j = 0; j < number_of_states; j++) { |
300 const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; |
318 const TosState states[] = {btos, ctos, stos, itos, ltos, ftos, dtos, atos, vtos}; |
301 Interpreter::_return_3_addrs_by_index[Interpreter::TosState_as_index(states[j])] = Interpreter::return_entry(states[j], 3); |
319 int index = Interpreter::TosState_as_index(states[j]); |
302 Interpreter::_return_5_addrs_by_index[Interpreter::TosState_as_index(states[j])] = Interpreter::return_entry(states[j], 5); |
320 Interpreter::_return_3_addrs_by_index[index] = Interpreter::return_entry(states[j], 3); |
|
321 Interpreter::_return_5_addrs_by_index[index] = Interpreter::return_entry(states[j], 5); |
|
322 if (EnableInvokeDynamic) |
|
323 Interpreter::_return_5_unbox_addrs_by_index[index] = Interpreter::return_unbox_entry(states[j], 5); |
303 } |
324 } |
304 |
325 |
305 { CodeletMark cm(_masm, "continuation entry points"); |
326 { CodeletMark cm(_masm, "continuation entry points"); |
306 Interpreter::_continuation_entry = |
327 Interpreter::_continuation_entry = |
307 EntryPoint( |
328 EntryPoint( |
524 guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); |
545 guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); |
525 return _return_entry[length].entry(state); |
546 return _return_entry[length].entry(state); |
526 } |
547 } |
527 |
548 |
528 |
549 |
|
550 address TemplateInterpreter::return_unbox_entry(TosState state, int length) { |
|
551 assert(EnableInvokeDynamic, ""); |
|
552 if (state == vtos) { |
|
553 // no unboxing to do, actually |
|
554 return return_entry(state, length); |
|
555 } else { |
|
556 assert(length == 5, "unboxing entries generated for invokedynamic only"); |
|
557 return _return_unbox_entry.entry(state); |
|
558 } |
|
559 } |
|
560 |
|
561 |
529 address TemplateInterpreter::deopt_entry(TosState state, int length) { |
562 address TemplateInterpreter::deopt_entry(TosState state, int length) { |
530 guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length"); |
563 guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length"); |
531 return _deopt_entry[length].entry(state); |
564 return _deopt_entry[length].entry(state); |
532 } |
565 } |
533 |
566 |