< prev index next >

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Print this page

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



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

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

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

3253   guarantee(total_allocation <= 8192, "must be");
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 }










< prev index next >