1472N/A * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A if(
sig[i] == 0 )
continue;
// do not print 'halves' 0N/A printf(
"LP64 and 2-reg longs not supported\n");
0N/A sig[i] = s[i];
// Reset sig array 0N/A // Convention is to pack the first 6 int/oop args into the first 6 0N/A // registers (I0-I5), extras spill to the stack. Then pack the first 0N/A // 32 float args into F0-F31, extras spill to the stack. Then pad 0N/A // all register sets to align. Then put longs and doubles into the 0N/A // same registers as they fit, else spill to the stack. 0N/A // Count int/oop and float args. See how many stack slots we'll need 0N/A // and where the longs & doubles will go. 0N/A case Op_RegL:
// Longs-in-1-reg compete with int args 0N/A // Now do the signature layout 0N/A if(
sig[i+
1] !=
'h' ) {
printf(
"expecting (h)alf, found %c\n",
sig[i+
1]);
return; }
0N/A printf(
"LP64 and 2-reg longs not supported\n");
0N/A sig[i] = s[i];
// Reset sig array 0N/A // The native convention is V8 if !LP64, which means the V8 convention is 0N/A // used both with and without LONGS_IN_ONE_ENTRY, an unfortunate split. The 0N/A // same actual machine registers are used, but they are named differently in 0N/A // the LONGS_IN_ONE_ENTRY mode. The LP64 convention is the V9 convention 0N/A // which is slightly more sane. 0N/A // V9 convention: All things "as-if" on double-wide stack slots. 0N/A // Hoist any flt/dbl's in the first 16 dbl regs. 0N/A int j = 0;
// Count of actual args, not HALVES 0N/A if(
sig[i+
1] !=
'h' ) {
printf(
"expecting (h)alf, found %c\n",
sig[i+
1]);
return; }
0N/A case Op_RegF:
// V9ism: floats go in ODD registers 0N/A case 'h':
sig[i] = 0; j--;
break;
// Do not count HALVES 0N/A // V8 convention: first 6 things in O-regs, rest on stack. 0N/A // Alignment is willy-nilly. 0N/A if(
sig[i+
1] !=
'h' ) {
printf(
"expecting (h)alf, found %c\n",
sig[i+
1]);
return; }
0N/A printf(
"Usage: args IPFLhDh... (Java argument string)\n");