1316 BasicType* in_elem_bt = NULL; 1317 1318 int argc = 0; 1319 if (!is_critical_native) { 1320 out_sig_bt[argc++] = T_ADDRESS; 1321 if (method->is_static()) { 1322 out_sig_bt[argc++] = T_OBJECT; 1323 } 1324 1325 for (int i = 0; i < total_in_args ; i++ ) { 1326 out_sig_bt[argc++] = in_sig_bt[i]; 1327 } 1328 } else { 1329 in_elem_bt = NEW_RESOURCE_ARRAY(BasicType, total_in_args); 1330 SignatureStream ss(method->signature()); 1331 for (int i = 0; i < total_in_args ; i++ ) { 1332 if (in_sig_bt[i] == T_ARRAY) { 1333 // Arrays are passed as int, elem* pair 1334 out_sig_bt[argc++] = T_INT; 1335 out_sig_bt[argc++] = T_ADDRESS; 1336 Symbol* atype = ss.as_symbol(); 1337 const char* at = atype->as_C_string(); 1338 if (strlen(at) == 2) { 1339 assert(at[0] == '[', "must be"); 1340 switch (at[1]) { 1341 case 'B': in_elem_bt[i] = T_BYTE; break; 1342 case 'C': in_elem_bt[i] = T_CHAR; break; 1343 case 'D': in_elem_bt[i] = T_DOUBLE; break; 1344 case 'F': in_elem_bt[i] = T_FLOAT; break; 1345 case 'I': in_elem_bt[i] = T_INT; break; 1346 case 'J': in_elem_bt[i] = T_LONG; break; 1347 case 'S': in_elem_bt[i] = T_SHORT; break; 1348 case 'Z': in_elem_bt[i] = T_BOOLEAN; break; 1349 default: ShouldNotReachHere(); 1350 } 1351 } 1352 } else { 1353 out_sig_bt[argc++] = in_sig_bt[i]; 1354 in_elem_bt[i] = T_VOID; 1355 } 1356 if (in_sig_bt[i] != T_VOID) { 1357 assert(in_sig_bt[i] == ss.type(), "must match"); 1358 ss.next(); 1359 } 1360 } 1361 } 1362 1363 // Now figure out where the args must be stored and how much stack space 1364 // they require. 1365 int out_arg_slots; 1366 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); 1367 1368 // Compute framesize for the wrapper. We need to handlize all oops in 1369 // incoming registers 1370 1371 // Calculate the total number of stack slots we will need. 1372 1373 // First count the abi requirement plus all of the outgoing args 1374 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 1375 1376 // Now the space for the inbound oop handle area 1377 int total_save_slots = 8 * VMRegImpl::slots_per_word; // 8 arguments passed in registers | 1316 BasicType* in_elem_bt = NULL; 1317 1318 int argc = 0; 1319 if (!is_critical_native) { 1320 out_sig_bt[argc++] = T_ADDRESS; 1321 if (method->is_static()) { 1322 out_sig_bt[argc++] = T_OBJECT; 1323 } 1324 1325 for (int i = 0; i < total_in_args ; i++ ) { 1326 out_sig_bt[argc++] = in_sig_bt[i]; 1327 } 1328 } else { 1329 in_elem_bt = NEW_RESOURCE_ARRAY(BasicType, total_in_args); 1330 SignatureStream ss(method->signature()); 1331 for (int i = 0; i < total_in_args ; i++ ) { 1332 if (in_sig_bt[i] == T_ARRAY) { 1333 // Arrays are passed as int, elem* pair 1334 out_sig_bt[argc++] = T_INT; 1335 out_sig_bt[argc++] = T_ADDRESS; 1336 ss.skip_array_prefix(1); // skip one '[' 1337 if (ss.is_primitive()) 1338 in_elem_bt[i] = ss.type(); 1339 // else what is in_elem_bt[i]? 1340 } else { 1341 out_sig_bt[argc++] = in_sig_bt[i]; 1342 in_elem_bt[i] = T_VOID; 1343 } 1344 if (in_sig_bt[i] != T_VOID) { 1345 assert(in_sig_bt[i] == ss.type() || 1346 in_sig_bt[i] == T_ARRAY, "must match"); 1347 ss.next(); 1348 } 1349 } 1350 } 1351 1352 // Now figure out where the args must be stored and how much stack space 1353 // they require. 1354 int out_arg_slots; 1355 out_arg_slots = c_calling_convention(out_sig_bt, out_regs, NULL, total_c_args); 1356 1357 // Compute framesize for the wrapper. We need to handlize all oops in 1358 // incoming registers 1359 1360 // Calculate the total number of stack slots we will need. 1361 1362 // First count the abi requirement plus all of the outgoing args 1363 int stack_slots = SharedRuntime::out_preserve_stack_slots() + out_arg_slots; 1364 1365 // Now the space for the inbound oop handle area 1366 int total_save_slots = 8 * VMRegImpl::slots_per_word; // 8 arguments passed in registers |