368 369 MacroAssembler::remove_frame(framesize + 2 * wordSize); 370 if (NotifySimulator) { 371 notify(Assembler::method_reentry); 372 } 373 } 374 375 void C1_MacroAssembler::verified_value_entry() { 376 if (C1Breakpoint || VerifyFPU || !UseStackBanging) { 377 // Verified Entry first instruction should be 5 bytes long for correct 378 // patching by patch_verified_entry(). 379 // 380 // C1Breakpoint and VerifyFPU have one byte first instruction. 381 // Also first instruction will be one byte "push(rbp)" if stack banging 382 // code is not generated (see build_frame() above). 383 // For all these cases generate long instruction first. 384 nop(); 385 } 386 387 // build frame 388 // DMS CHECK: is it nop? 389 // verify_FPU(0, "method_entry"); 390 391 } 392 393 int C1_MacroAssembler::scalarized_entry(const CompiledEntrySignature *ces, int frame_size_in_bytes, int bang_size_in_bytes, Label& verified_value_entry_label, bool is_value_ro_entry) { 394 guarantee(false, "Support for ValueTypePassFieldsAsArgs and ValueTypeReturnedAsFields is not implemented"); 395 return 0; 396 } 397 398 399 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) { 400 // rbp, + 0: link 401 // + 1: return address 402 // + 2: argument with offset 0 403 // + 3: argument with offset 1 404 // + 4: ... 405 406 ldr(reg, Address(rfp, (offset_in_words + 2) * BytesPerWord)); 407 } 408 409 #ifndef PRODUCT 410 411 void C1_MacroAssembler::verify_stack_oop(int stack_offset) { 412 if (!VerifyOops) return; 413 verify_oop_addr(Address(sp, stack_offset), "oop"); 414 } 415 | 368 369 MacroAssembler::remove_frame(framesize + 2 * wordSize); 370 if (NotifySimulator) { 371 notify(Assembler::method_reentry); 372 } 373 } 374 375 void C1_MacroAssembler::verified_value_entry() { 376 if (C1Breakpoint || VerifyFPU || !UseStackBanging) { 377 // Verified Entry first instruction should be 5 bytes long for correct 378 // patching by patch_verified_entry(). 379 // 380 // C1Breakpoint and VerifyFPU have one byte first instruction. 381 // Also first instruction will be one byte "push(rbp)" if stack banging 382 // code is not generated (see build_frame() above). 383 // For all these cases generate long instruction first. 384 nop(); 385 } 386 387 // build frame 388 // verify_FPU(0, "method_entry"); 389 } 390 391 int C1_MacroAssembler::scalarized_entry(const CompiledEntrySignature *ces, int frame_size_in_bytes, int bang_size_in_bytes, Label& verified_value_entry_label, bool is_value_ro_entry) { 392 // This function required to support for ValueTypePassFieldsAsArgs 393 if (C1Breakpoint || VerifyFPU || !UseStackBanging) { 394 // Verified Entry first instruction should be 5 bytes long for correct 395 // patching by patch_verified_entry(). 396 // 397 // C1Breakpoint and VerifyFPU have one byte first instruction. 398 // Also first instruction will be one byte "push(rbp)" if stack banging 399 // code is not generated (see build_frame() above). 400 // For all these cases generate long instruction first. 401 nop(); 402 } 403 404 // verify_FPU(0, "method_entry"); 405 406 assert(ValueTypePassFieldsAsArgs, "sanity"); 407 408 GrowableArray<SigEntry>* sig = &ces->sig(); 409 GrowableArray<SigEntry>* sig_cc = is_value_ro_entry ? &ces->sig_cc_ro() : &ces->sig_cc(); 410 VMRegPair* regs = ces->regs(); 411 VMRegPair* regs_cc = is_value_ro_entry ? ces->regs_cc_ro() : ces->regs_cc(); 412 int args_on_stack = ces->args_on_stack(); 413 int args_on_stack_cc = is_value_ro_entry ? ces->args_on_stack_cc_ro() : ces->args_on_stack_cc(); 414 415 assert(sig->length() <= sig_cc->length(), "Zero-sized value class not allowed!"); 416 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sig_cc->length()); 417 int args_passed = sig->length(); 418 int args_passed_cc = SigEntry::fill_sig_bt(sig_cc, sig_bt); 419 420 int extra_stack_offset = wordSize; // tos is return address. 421 422 // Create a temp frame so we can call into runtime. It must be properly set up to accomodate GC. 423 int sp_inc = (args_on_stack - args_on_stack_cc) * VMRegImpl::stack_slot_size; 424 if (sp_inc > 0) { 425 sp_inc = align_up(sp_inc, StackAlignmentInBytes); 426 sub(sp, sp, sp_inc); 427 } else { 428 sp_inc = 0; 429 } 430 431 sub(sp, sp, frame_size_in_bytes); 432 if (sp_inc > 0) { 433 int real_frame_size = frame_size_in_bytes + 434 + wordSize // pushed rbp 435 + wordSize // returned address pushed by the stack extension code 436 + sp_inc; // stack extension 437 mov(rscratch1, real_frame_size); 438 str(rscratch1, Address(sp, frame_size_in_bytes - wordSize)); 439 } 440 441 // FIXME -- call runtime only if we cannot in-line allocate all the incoming value args. 442 mov(r1, (intptr_t) ces->method()); 443 if (is_value_ro_entry) { 444 far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::buffer_value_args_no_receiver_id))); 445 } else { 446 far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::buffer_value_args_id))); 447 } 448 int rt_call_offset = offset(); 449 450 // Remove the temp frame 451 add(sp, sp, frame_size_in_bytes); 452 453 int n = shuffle_value_args(true, is_value_ro_entry, extra_stack_offset, sig_bt, sig_cc, 454 args_passed_cc, args_on_stack_cc, regs_cc, // from 455 args_passed, args_on_stack, regs); // to 456 assert(sp_inc == n, "must be"); 457 458 if (sp_inc != 0) { 459 // Do the stack banging here, and skip over the stack repair code in the 460 // verified_value_entry (which has a different real_frame_size). 461 assert(sp_inc > 0, "stack should not shrink"); 462 generate_stack_overflow_check(bang_size_in_bytes); 463 decrement(sp, frame_size_in_bytes); 464 } 465 466 b(verified_value_entry_label); 467 return rt_call_offset; 468 } 469 470 471 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) { 472 // rbp, + 0: link 473 // + 1: return address 474 // + 2: argument with offset 0 475 // + 3: argument with offset 1 476 // + 4: ... 477 478 ldr(reg, Address(rfp, (offset_in_words + 2) * BytesPerWord)); 479 } 480 481 #ifndef PRODUCT 482 483 void C1_MacroAssembler::verify_stack_oop(int stack_offset) { 484 if (!VerifyOops) return; 485 verify_oop_addr(Address(sp, stack_offset), "oop"); 486 } 487 |