1680 BasicType* in_elem_bt = NULL; 1681 1682 int argc = 0; 1683 if (!is_critical_native) { 1684 out_sig_bt[argc++] = T_ADDRESS; 1685 if (method->is_static()) { 1686 out_sig_bt[argc++] = T_OBJECT; 1687 } 1688 1689 for (int i = 0; i < total_in_args ; i++ ) { 1690 out_sig_bt[argc++] = in_sig_bt[i]; 1691 } 1692 } else { 1693 in_elem_bt = NEW_RESOURCE_ARRAY(BasicType, total_in_args); 1694 SignatureStream ss(method->signature()); 1695 for (int i = 0; i < total_in_args ; i++ ) { 1696 if (in_sig_bt[i] == T_ARRAY) { 1697 // Arrays are passed as int, elem* pair 1698 out_sig_bt[argc++] = T_INT; 1699 out_sig_bt[argc++] = T_ADDRESS; 1700 Symbol* atype = ss.as_symbol(); 1701 const char* at = atype->as_C_string(); 1702 if (strlen(at) == 2) { 1703 assert(at[0] == '[', "must be"); 1704 switch (at[1]) { 1705 case 'B': in_elem_bt[i] = T_BYTE; break; 1706 case 'C': in_elem_bt[i] = T_CHAR; break; 1707 case 'D': in_elem_bt[i] = T_DOUBLE; break; 1708 case 'F': in_elem_bt[i] = T_FLOAT; break; 1709 case 'I': in_elem_bt[i] = T_INT; break; 1710 case 'J': in_elem_bt[i] = T_LONG; break; 1711 case 'S': in_elem_bt[i] = T_SHORT; break; 1712 case 'Z': in_elem_bt[i] = T_BOOLEAN; break; 1713 default: ShouldNotReachHere(); 1714 } 1715 } 1716 } else { 1717 out_sig_bt[argc++] = in_sig_bt[i]; 1718 in_elem_bt[i] = T_VOID; 1719 } 1720 if (in_sig_bt[i] != T_VOID) { 1721 assert(in_sig_bt[i] == ss.type(), "must match"); 1722 ss.next(); 1723 } 1724 } 1725 } 1726 1727 // Now figure out where the args must be stored and how much stack space 1728 // they require. 1729 int out_arg_slots; 1730 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); 1731 1732 // Compute framesize for the wrapper. We need to handlize all oops in 1733 // registers a max of 2 on x86. 1734 1735 // Calculate the total number of stack slots we will need. 1736 1737 // First count the abi requirement plus all of the outgoing args 1738 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 1739 1740 // Now the space for the inbound oop handle area 1741 int total_save_slots = 2 * VMRegImpl::slots_per_word; // 2 arguments passed in registers | 1680 BasicType* in_elem_bt = NULL; 1681 1682 int argc = 0; 1683 if (!is_critical_native) { 1684 out_sig_bt[argc++] = T_ADDRESS; 1685 if (method->is_static()) { 1686 out_sig_bt[argc++] = T_OBJECT; 1687 } 1688 1689 for (int i = 0; i < total_in_args ; i++ ) { 1690 out_sig_bt[argc++] = in_sig_bt[i]; 1691 } 1692 } else { 1693 in_elem_bt = NEW_RESOURCE_ARRAY(BasicType, total_in_args); 1694 SignatureStream ss(method->signature()); 1695 for (int i = 0; i < total_in_args ; i++ ) { 1696 if (in_sig_bt[i] == T_ARRAY) { 1697 // Arrays are passed as int, elem* pair 1698 out_sig_bt[argc++] = T_INT; 1699 out_sig_bt[argc++] = T_ADDRESS; 1700 ss.skip_array_prefix(1); // skip one '[' 1701 if (ss.is_primitive()) 1702 in_elem_bt[i] = ss.type(); 1703 // else what is in_elem_bt[i]? 1704 } else { 1705 out_sig_bt[argc++] = in_sig_bt[i]; 1706 in_elem_bt[i] = T_VOID; 1707 } 1708 if (in_sig_bt[i] != T_VOID) { 1709 assert(in_sig_bt[i] == ss.type() || 1710 in_sig_bt[i] == T_ARRAY, "must match"); 1711 ss.next(); 1712 } 1713 } 1714 } 1715 1716 // Now figure out where the args must be stored and how much stack space 1717 // they require. 1718 int out_arg_slots; 1719 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); 1720 1721 // Compute framesize for the wrapper. We need to handlize all oops in 1722 // registers a max of 2 on x86. 1723 1724 // Calculate the total number of stack slots we will need. 1725 1726 // First count the abi requirement plus all of the outgoing args 1727 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 1728 1729 // Now the space for the inbound oop handle area 1730 int total_save_slots = 2 * VMRegImpl::slots_per_word; // 2 arguments passed in registers |