< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page
rev 60615 : 8231441: Initial SVE backend support
Reviewed-by: adinn, pli
Contributed-by: joshua.zhu@arm.com, yang.zhang@arm.com, ningsheng.jian@arm.com


1355   __ stlrw(rscratch1, rscratch2);
1356 
1357   // Call the native method.
1358   __ blr(r10);
1359   __ bind(native_return);
1360   __ maybe_isb();
1361   __ get_method(rmethod);
1362   // result potentially in r0 or v0
1363 
1364   // make room for the pushes we're about to do
1365   __ sub(rscratch1, esp, 4 * wordSize);
1366   __ andr(sp, rscratch1, -16);
1367 
1368   // NOTE: The order of these pushes is known to frame::interpreter_frame_result
1369   // in order to extract the result of a method call. If the order of these
1370   // pushes change or anything else is added to the stack then the code in
1371   // interpreter_frame_result must also change.
1372   __ push(dtos);
1373   __ push(ltos);
1374 





1375   // change thread state
1376   __ mov(rscratch1, _thread_in_native_trans);
1377   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1378   __ stlrw(rscratch1, rscratch2);
1379 
1380   // Force this write out before the read below
1381   __ dmb(Assembler::ISH);
1382 
1383   // check for safepoint operation in progress and/or pending suspend requests
1384   {
1385     Label L, Continue;
1386     __ safepoint_poll_acquire(L);
1387     __ ldrw(rscratch2, Address(rthread, JavaThread::suspend_flags_offset()));
1388     __ cbz(rscratch2, Continue);
1389     __ bind(L);
1390 
1391     // Don't use call_VM as it will see a possible pending exception
1392     // and forward it and never return here preventing us from
1393     // clearing _last_native_pc down below. So we do a runtime call by
1394     // hand.




1355   __ stlrw(rscratch1, rscratch2);
1356 
1357   // Call the native method.
1358   __ blr(r10);
1359   __ bind(native_return);
1360   __ maybe_isb();
1361   __ get_method(rmethod);
1362   // result potentially in r0 or v0
1363 
1364   // make room for the pushes we're about to do
1365   __ sub(rscratch1, esp, 4 * wordSize);
1366   __ andr(sp, rscratch1, -16);
1367 
1368   // NOTE: The order of these pushes is known to frame::interpreter_frame_result
1369   // in order to extract the result of a method call. If the order of these
1370   // pushes change or anything else is added to the stack then the code in
1371   // interpreter_frame_result must also change.
1372   __ push(dtos);
1373   __ push(ltos);
1374 
1375   if (UseSVE > 0) {
1376     // Make sure that jni code does not change SVE vector length.
1377     __ verify_sve_vector_length();
1378   }
1379 
1380   // change thread state
1381   __ mov(rscratch1, _thread_in_native_trans);
1382   __ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
1383   __ stlrw(rscratch1, rscratch2);
1384 
1385   // Force this write out before the read below
1386   __ dmb(Assembler::ISH);
1387 
1388   // check for safepoint operation in progress and/or pending suspend requests
1389   {
1390     Label L, Continue;
1391     __ safepoint_poll_acquire(L);
1392     __ ldrw(rscratch2, Address(rthread, JavaThread::suspend_flags_offset()));
1393     __ cbz(rscratch2, Continue);
1394     __ bind(L);
1395 
1396     // Don't use call_VM as it will see a possible pending exception
1397     // and forward it and never return here preventing us from
1398     // clearing _last_native_pc down below. So we do a runtime call by
1399     // hand.


< prev index next >