< prev index next >

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Print this page

1555   }
1556 }
1557 
1558 static void gen_special_dispatch(MacroAssembler* masm,
1559                                  const methodHandle& method,
1560                                  const BasicType* sig_bt,
1561                                  const VMRegPair* regs) {
1562   verify_oop_args(masm, method, sig_bt, regs);
1563   vmIntrinsics::ID iid = method->intrinsic_id();
1564 
1565   // Now write the args into the outgoing interpreter space
1566   bool     has_receiver   = false;
1567   Register receiver_reg   = noreg;
1568   int      member_arg_pos = -1;
1569   Register member_reg     = noreg;
1570   int      ref_kind       = MethodHandles::signature_polymorphic_intrinsic_ref_kind(iid);
1571   if (ref_kind != 0) {
1572     member_arg_pos = method->size_of_parameters() - 1;  // trailing MemberName argument
1573     member_reg = R19_method;  // known to be free at this point
1574     has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
1575   } else if (iid == vmIntrinsics::_invokeBasic || iid == vmIntrinsics::_linkToNative) {
1576     has_receiver = true;



1577   } else {
1578     fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
1579   }
1580 
1581   if (member_reg != noreg) {
1582     // Load the member_arg into register, if necessary.
1583     SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
1584     VMReg r = regs[member_arg_pos].first();
1585     if (r->is_stack()) {
1586       __ ld(member_reg, reg2offset(r), R1_SP);
1587     } else {
1588       // no data motion is needed
1589       member_reg = r->as_Register();
1590     }
1591   }
1592 
1593   if (has_receiver) {
1594     // Make sure the receiver is loaded into a register.
1595     assert(method->size_of_parameters() > 0, "oob");
1596     assert(sig_bt[0] == T_OBJECT, "receiver argument must be an object");

3253   int total_allocation = longwords * sizeof (unsigned long) * 3;
3254   unsigned long *scratch = (unsigned long *)alloca(total_allocation);
3255 
3256   // Local scratch arrays
3257   unsigned long
3258     *a = scratch + 0 * longwords,
3259     *n = scratch + 1 * longwords,
3260     *m = scratch + 2 * longwords;
3261 
3262   reverse_words((unsigned long *)a_ints, a, longwords);
3263   reverse_words((unsigned long *)n_ints, n, longwords);
3264 
3265   if (len >= MONTGOMERY_SQUARING_THRESHOLD) {
3266     ::montgomery_square(a, n, m, (unsigned long)inv, longwords);
3267   } else {
3268     ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords);
3269   }
3270 
3271   reverse_words(m, (unsigned long *)m_ints, longwords);
3272 }
3273 
3274 #ifdef COMPILER2
3275 RuntimeStub* SharedRuntime::make_native_invoker(address call_target,
3276                                                 int shadow_space_bytes,
3277                                                 const GrowableArray<VMReg>& input_registers,
3278                                                 const GrowableArray<VMReg>& output_registers) {
3279   Unimplemented();
3280   return nullptr;
3281 }
3282 #endif

1555   }
1556 }
1557 
1558 static void gen_special_dispatch(MacroAssembler* masm,
1559                                  const methodHandle& method,
1560                                  const BasicType* sig_bt,
1561                                  const VMRegPair* regs) {
1562   verify_oop_args(masm, method, sig_bt, regs);
1563   vmIntrinsics::ID iid = method->intrinsic_id();
1564 
1565   // Now write the args into the outgoing interpreter space
1566   bool     has_receiver   = false;
1567   Register receiver_reg   = noreg;
1568   int      member_arg_pos = -1;
1569   Register member_reg     = noreg;
1570   int      ref_kind       = MethodHandles::signature_polymorphic_intrinsic_ref_kind(iid);
1571   if (ref_kind != 0) {
1572     member_arg_pos = method->size_of_parameters() - 1;  // trailing MemberName argument
1573     member_reg = R19_method;  // known to be free at this point
1574     has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
1575   } else if (iid == vmIntrinsics::_invokeBasic) {
1576     has_receiver = true;
1577   } else if (iid == vmIntrinsics::_linkToNative) {
1578     member_arg_pos = method->size_of_parameters() - 1;  // trailing NativeEntryPoint argument
1579     member_reg = R19_method;  // known to be free at this point
1580   } else {
1581     fatal("unexpected intrinsic id %d", vmIntrinsics::as_int(iid));
1582   }
1583 
1584   if (member_reg != noreg) {
1585     // Load the member_arg into register, if necessary.
1586     SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
1587     VMReg r = regs[member_arg_pos].first();
1588     if (r->is_stack()) {
1589       __ ld(member_reg, reg2offset(r), R1_SP);
1590     } else {
1591       // no data motion is needed
1592       member_reg = r->as_Register();
1593     }
1594   }
1595 
1596   if (has_receiver) {
1597     // Make sure the receiver is loaded into a register.
1598     assert(method->size_of_parameters() > 0, "oob");
1599     assert(sig_bt[0] == T_OBJECT, "receiver argument must be an object");

3256   int total_allocation = longwords * sizeof (unsigned long) * 3;
3257   unsigned long *scratch = (unsigned long *)alloca(total_allocation);
3258 
3259   // Local scratch arrays
3260   unsigned long
3261     *a = scratch + 0 * longwords,
3262     *n = scratch + 1 * longwords,
3263     *m = scratch + 2 * longwords;
3264 
3265   reverse_words((unsigned long *)a_ints, a, longwords);
3266   reverse_words((unsigned long *)n_ints, n, longwords);
3267 
3268   if (len >= MONTGOMERY_SQUARING_THRESHOLD) {
3269     ::montgomery_square(a, n, m, (unsigned long)inv, longwords);
3270   } else {
3271     ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords);
3272   }
3273 
3274   reverse_words(m, (unsigned long *)m_ints, longwords);
3275 }










< prev index next >