1226 int frame_complete = CodeOffsets::frame_never_safe;
1227 int frame_size_in_words = 0;
1228 gen_c2i_adapter(masm, sig_extended, regs, skip_fixup, i2c_entry, oop_maps, frame_complete, frame_size_in_words);
1229
1230 __ flush();
1231 new_adapter = AdapterBlob::create(masm->code(), frame_complete, frame_size_in_words, oop_maps);
1232
1233 // If value types are passed as fields, save the extended signature as symbol in
1234 // the AdapterHandlerEntry to be used by nmethod::preserve_callee_argument_oops().
1235 Symbol* extended_signature = NULL;
1236 if (ValueTypePassFieldsAsArgs) {
1237 bool has_value_argument = false;
1238 Thread* THREAD = Thread::current();
1239 ResourceMark rm(THREAD);
1240 int length = sig_extended.length();
1241 char* sig_str = NEW_RESOURCE_ARRAY(char, 2*length + 3);
1242 int idx = 0;
1243 sig_str[idx++] = '(';
1244 for (int index = 0; index < length; index++) {
1245 BasicType bt = sig_extended.at(index)._bt;
1246 if (bt == T_VALUETYPE || bt == T_VOID) {
1247 has_value_argument = true;
1248 continue; // Ignore wrapper types
1249 }
1250 sig_str[idx++] = type2char(bt);
1251 if (bt == T_OBJECT) {
1252 sig_str[idx++] = ';';
1253 } else if (bt == T_ARRAY) {
1254 // We don't know the array element type, put void as placeholder
1255 sig_str[idx++] = 'V';
1256 }
1257 }
1258 sig_str[idx++] = ')';
1259 sig_str[idx++] = '\0';
1260 if (has_value_argument) {
1261 // Extended signature is only required if a value type argument is passed
1262 extended_signature = SymbolTable::new_permanent_symbol(sig_str, THREAD);
1263 }
1264 }
1265
1266 return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, extended_signature);
1267 }
1268
1269 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
1270 VMRegPair *regs,
1271 VMRegPair *regs2,
1272 int total_args_passed) {
1273 assert(regs2 == NULL, "not needed on x86");
1274 // We return the amount of VMRegImpl stack slots we need to reserve for all
1275 // the arguments NOT counting out_preserve_stack_slots.
|
1226 int frame_complete = CodeOffsets::frame_never_safe;
1227 int frame_size_in_words = 0;
1228 gen_c2i_adapter(masm, sig_extended, regs, skip_fixup, i2c_entry, oop_maps, frame_complete, frame_size_in_words);
1229
1230 __ flush();
1231 new_adapter = AdapterBlob::create(masm->code(), frame_complete, frame_size_in_words, oop_maps);
1232
1233 // If value types are passed as fields, save the extended signature as symbol in
1234 // the AdapterHandlerEntry to be used by nmethod::preserve_callee_argument_oops().
1235 Symbol* extended_signature = NULL;
1236 if (ValueTypePassFieldsAsArgs) {
1237 bool has_value_argument = false;
1238 Thread* THREAD = Thread::current();
1239 ResourceMark rm(THREAD);
1240 int length = sig_extended.length();
1241 char* sig_str = NEW_RESOURCE_ARRAY(char, 2*length + 3);
1242 int idx = 0;
1243 sig_str[idx++] = '(';
1244 for (int index = 0; index < length; index++) {
1245 BasicType bt = sig_extended.at(index)._bt;
1246 if (bt == T_VALUETYPE) {
1247 has_value_argument = true;
1248 } else if (bt == T_VOID) {
1249 // Ignore
1250 } else {
1251 if (bt == T_ARRAY) {
1252 bt = T_OBJECT; // We don't know the element type, treat as Object
1253 }
1254 sig_str[idx++] = type2char(bt);
1255 if (bt == T_OBJECT) {
1256 sig_str[idx++] = ';';
1257 }
1258 }
1259 }
1260 sig_str[idx++] = ')';
1261 sig_str[idx++] = '\0';
1262 if (has_value_argument) {
1263 // Extended signature is only required if a value type argument is passed
1264 extended_signature = SymbolTable::new_permanent_symbol(sig_str, THREAD);
1265 }
1266 }
1267
1268 return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, extended_signature);
1269 }
1270
1271 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
1272 VMRegPair *regs,
1273 VMRegPair *regs2,
1274 int total_args_passed) {
1275 assert(regs2 == NULL, "not needed on x86");
1276 // We return the amount of VMRegImpl stack slots we need to reserve for all
1277 // the arguments NOT counting out_preserve_stack_slots.
|