comparison src/cpu/x86/vm/sharedRuntime_x86_64.cpp @ 17033:2d6dd2eebd51

Fixed HSAIL deopt
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 02 Sep 2014 21:42:37 -0700
parents ed29f7ff71eb
children 89152779163c
comparison
equal deleted inserted replaced
17032:8f3ece00da4f 17033:2d6dd2eebd51
641 __ jcc(Assembler::below, L_ok); 641 __ jcc(Assembler::below, L_ok);
642 __ bind(L_fail); 642 __ bind(L_fail);
643 } 643 }
644 644
645 void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm, 645 void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm,
646 int total_args_passed, 646 int total_args_passed,
647 int comp_args_on_stack, 647 int comp_args_on_stack,
648 const BasicType *sig_bt, 648 const BasicType *sig_bt,
649 const VMRegPair *regs) { 649 const VMRegPair *regs,
650 int frame_extension_argument) {
650 651
651 // Note: r13 contains the senderSP on entry. We must preserve it since 652 // Note: r13 contains the senderSP on entry. We must preserve it since
652 // we may do a i2c -> c2i transition if we lose a race where compiled 653 // we may do a i2c -> c2i transition if we lose a race where compiled
653 // code goes non-entrant while we get args ready. 654 // code goes non-entrant while we get args ready.
654 // In addition we use r13 to locate all the interpreter args as 655 // In addition we use r13 to locate all the interpreter args as
701 __ block_comment(msg); 702 __ block_comment(msg);
702 __ stop(msg); 703 __ stop(msg);
703 __ bind(L_ok); 704 __ bind(L_ok);
704 __ block_comment("} verify_i2ce "); 705 __ block_comment("} verify_i2ce ");
705 } 706 }
707
708 #ifdef GRAAL
709 if (frame_extension_argument != -1) {
710 // The frame_extension_argument is an int that describes the
711 // expected amount of argument space in the caller frame. If that
712 // is greater than total_args_passed then enlarge the caller frame
713 // by that amount to ensure deopt works correctly.
714 assert(frame_extension_argument < total_args_passed, "out of range");
715 assert(sig_bt[frame_extension_argument] == T_INT, "wrong signature");
716
717 Label done;
718 int i = frame_extension_argument;
719 int ld_off = (total_args_passed - i)*Interpreter::stackElementSize;
720 // Check if anything needs to be done. Too much space is ok.
721 __ movl(r13, Address(rsp, ld_off));
722 __ cmpl(r13, total_args_passed);
723 __ jcc(Assembler::lessEqual, done);
724 // Save the old rsp for the copy code
725 __ movptr(r11, rsp);
726 // Enlarge the frame
727 __ subl(r13, total_args_passed);
728 __ shlq(r13, 3);
729 __ subptr(rsp, r13);
730
731 // Now copy the arguments in reverse order so they don't get
732 // overwritten during the copy.
733 for (int i = total_args_passed - 1; i >= 0; i--) {
734 int ld_off = (total_args_passed - i) * Interpreter::stackElementSize;
735 __ movptr(r13, Address(r11, ld_off));
736 __ movptr(Address(rsp, ld_off), r13);
737 }
738 __ bind(done);
739 }
740 #else
741 assert(frame_extension_argument == -1, "unsupported");
742 #endif
706 743
707 // Must preserve original SP for loading incoming arguments because 744 // Must preserve original SP for loading incoming arguments because
708 // we need to align the outgoing SP for compiled code. 745 // we need to align the outgoing SP for compiled code.
709 __ movptr(r11, rsp); 746 __ movptr(r11, rsp);
710 747