< prev index next >

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Print this page




1647   int int_args = 0;
1648 
1649 #ifdef ASSERT
1650   bool reg_destroyed[RegisterImpl::number_of_registers];
1651   bool freg_destroyed[FloatRegisterImpl::number_of_registers];
1652   for ( int r = 0 ; r < RegisterImpl::number_of_registers ; r++ ) {
1653     reg_destroyed[r] = false;
1654   }
1655   for ( int f = 0 ; f < FloatRegisterImpl::number_of_registers ; f++ ) {
1656     freg_destroyed[f] = false;
1657   }
1658 
1659 #endif /* ASSERT */
1660 
1661   // This may iterate in two different directions depending on the
1662   // kind of native it is.  The reason is that for regular JNI natives
1663   // the incoming and outgoing registers are offset upwards and for
1664   // critical natives they are offset down.
1665   GrowableArray<int> arg_order(2 * total_in_args);
1666   VMRegPair tmp_vmreg;
1667   tmp_vmreg.set1(r19->as_VMReg());
1668 
1669   if (!is_critical_native) {
1670     for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
1671       arg_order.push(i);
1672       arg_order.push(c_arg);
1673     }
1674   } else {
1675     // Compute a valid move order, using tmp_vmreg to break any cycles
1676     ComputeMoveOrder cmo(total_in_args, in_regs, total_c_args, out_regs, in_sig_bt, arg_order, tmp_vmreg);
1677   }
1678 
1679   int temploc = -1;
1680   for (int ai = 0; ai < arg_order.length(); ai += 2) {
1681     int i = arg_order.at(ai);
1682     int c_arg = arg_order.at(ai + 1);
1683     __ block_comment(err_msg("move %d -> %d", i, c_arg));
1684     if (c_arg == -1) {
1685       assert(is_critical_native, "should only be required for critical natives");
1686       // This arg needs to be moved to a temporary
1687       __ mov(tmp_vmreg.first()->as_Register(), in_regs[i].first()->as_Register());




1647   int int_args = 0;
1648 
1649 #ifdef ASSERT
1650   bool reg_destroyed[RegisterImpl::number_of_registers];
1651   bool freg_destroyed[FloatRegisterImpl::number_of_registers];
1652   for ( int r = 0 ; r < RegisterImpl::number_of_registers ; r++ ) {
1653     reg_destroyed[r] = false;
1654   }
1655   for ( int f = 0 ; f < FloatRegisterImpl::number_of_registers ; f++ ) {
1656     freg_destroyed[f] = false;
1657   }
1658 
1659 #endif /* ASSERT */
1660 
1661   // This may iterate in two different directions depending on the
1662   // kind of native it is.  The reason is that for regular JNI natives
1663   // the incoming and outgoing registers are offset upwards and for
1664   // critical natives they are offset down.
1665   GrowableArray<int> arg_order(2 * total_in_args);
1666   VMRegPair tmp_vmreg;
1667   tmp_vmreg.set2(r19->as_VMReg());
1668 
1669   if (!is_critical_native) {
1670     for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
1671       arg_order.push(i);
1672       arg_order.push(c_arg);
1673     }
1674   } else {
1675     // Compute a valid move order, using tmp_vmreg to break any cycles
1676     ComputeMoveOrder cmo(total_in_args, in_regs, total_c_args, out_regs, in_sig_bt, arg_order, tmp_vmreg);
1677   }
1678 
1679   int temploc = -1;
1680   for (int ai = 0; ai < arg_order.length(); ai += 2) {
1681     int i = arg_order.at(ai);
1682     int c_arg = arg_order.at(ai + 1);
1683     __ block_comment(err_msg("move %d -> %d", i, c_arg));
1684     if (c_arg == -1) {
1685       assert(is_critical_native, "should only be required for critical natives");
1686       // This arg needs to be moved to a temporary
1687       __ mov(tmp_vmreg.first()->as_Register(), in_regs[i].first()->as_Register());


< prev index next >