src/cpu/x86/vm/sharedRuntime_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8074457 Sdiff src/cpu/x86/vm

src/cpu/x86/vm/sharedRuntime_x86_32.cpp

Print this page




2635 
2636   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
2637 
2638   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
2639   __ movl(counter, rbx);
2640 
2641   // Now adjust the caller's stack to make up for the extra locals
2642   // but record the original sp so that we can save it in the skeletal interpreter
2643   // frame and the stack walking of interpreter_sender will get the unextended sp
2644   // value and not the "real" sp value.
2645 
2646   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());
2647   __ movptr(sp_temp, rsp);
2648   __ movl2ptr(rbx, Address(rdi, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()));
2649   __ subptr(rsp, rbx);
2650 
2651   // Push interpreter frames in a loop
2652   Label loop;
2653   __ bind(loop);
2654   __ movptr(rbx, Address(rsi, 0));      // Load frame size
2655 #ifdef CC_INTERP
2656   __ subptr(rbx, 4*wordSize);           // we'll push pc and ebp by hand and
2657 #ifdef ASSERT
2658   __ push(0xDEADDEAD);                  // Make a recognizable pattern
2659   __ push(0xDEADDEAD);
2660 #else /* ASSERT */
2661   __ subptr(rsp, 2*wordSize);           // skip the "static long no_param"
2662 #endif /* ASSERT */
2663 #else /* CC_INTERP */
2664   __ subptr(rbx, 2*wordSize);           // we'll push pc and rbp, by hand
2665 #endif /* CC_INTERP */
2666   __ pushptr(Address(rcx, 0));          // save return address
2667   __ enter();                           // save old & set new rbp,
2668   __ subptr(rsp, rbx);                  // Prolog!
2669   __ movptr(rbx, sp_temp);              // sender's sp
2670 #ifdef CC_INTERP
2671   __ movptr(Address(rbp,
2672                   -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))),
2673           rbx); // Make it walkable
2674 #else /* CC_INTERP */
2675   // This value is corrected by layout_activation_impl
2676   __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
2677   __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable
2678 #endif /* CC_INTERP */
2679   __ movptr(sp_temp, rsp);              // pass to next frame
2680   __ addptr(rsi, wordSize);             // Bump array pointer (sizes)
2681   __ addptr(rcx, wordSize);             // Bump array pointer (pcs)
2682   __ decrementl(counter);             // decrement counter
2683   __ jcc(Assembler::notZero, loop);
2684   __ pushptr(Address(rcx, 0));          // save final return address
2685 
2686   // Re-push self-frame
2687   __ enter();                           // save old & set new rbp,
2688 
2689   //  Return address and rbp, are in place
2690   // We'll push additional args later. Just allocate a full sized
2691   // register save area
2692   __ subptr(rsp, (frame_size_in_words-additional_words - 2) * wordSize);
2693 
2694   // Restore frame locals after moving the frame
2695   __ movptr(Address(rsp, RegisterSaver::raxOffset()*wordSize), rax);
2696   __ movptr(Address(rsp, RegisterSaver::rdxOffset()*wordSize), rdx);
2697   __ fstp_d(Address(rsp, RegisterSaver::fpResultOffset()*wordSize));   // Pop float stack and store in local
2698   if( UseSSE>=2 ) __ movdbl(Address(rsp, RegisterSaver::xmm0Offset()*wordSize), xmm0);


2877 
2878   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
2879 
2880   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
2881   __ movl(counter, rbx);
2882 
2883   // Now adjust the caller's stack to make up for the extra locals
2884   // but record the original sp so that we can save it in the skeletal interpreter
2885   // frame and the stack walking of interpreter_sender will get the unextended sp
2886   // value and not the "real" sp value.
2887 
2888   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());
2889   __ movptr(sp_temp, rsp);
2890   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()));
2891   __ subptr(rsp, rbx);
2892 
2893   // Push interpreter frames in a loop
2894   Label loop;
2895   __ bind(loop);
2896   __ movptr(rbx, Address(rsi, 0));      // Load frame size
2897 #ifdef CC_INTERP
2898   __ subptr(rbx, 4*wordSize);           // we'll push pc and ebp by hand and
2899 #ifdef ASSERT
2900   __ push(0xDEADDEAD);                  // Make a recognizable pattern
2901   __ push(0xDEADDEAD);                  // (parm to RecursiveInterpreter...)
2902 #else /* ASSERT */
2903   __ subptr(rsp, 2*wordSize);           // skip the "static long no_param"
2904 #endif /* ASSERT */
2905 #else /* CC_INTERP */
2906   __ subptr(rbx, 2*wordSize);           // we'll push pc and rbp, by hand
2907 #endif /* CC_INTERP */
2908   __ pushptr(Address(rcx, 0));          // save return address
2909   __ enter();                           // save old & set new rbp,
2910   __ subptr(rsp, rbx);                  // Prolog!
2911   __ movptr(rbx, sp_temp);              // sender's sp
2912 #ifdef CC_INTERP
2913   __ movptr(Address(rbp,
2914                   -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))),
2915           rbx); // Make it walkable
2916 #else /* CC_INTERP */
2917   // This value is corrected by layout_activation_impl
2918   __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD );
2919   __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable
2920 #endif /* CC_INTERP */
2921   __ movptr(sp_temp, rsp);              // pass to next frame
2922   __ addptr(rsi, wordSize);             // Bump array pointer (sizes)
2923   __ addptr(rcx, wordSize);             // Bump array pointer (pcs)
2924   __ decrementl(counter);             // decrement counter
2925   __ jcc(Assembler::notZero, loop);
2926   __ pushptr(Address(rcx, 0));            // save final return address
2927 
2928   // Re-push self-frame
2929   __ enter();                           // save old & set new rbp,
2930   __ subptr(rsp, (framesize-2) * wordSize);   // Prolog!
2931 
2932 
2933   // set last_Java_sp, last_Java_fp
2934   __ get_thread(rdi);
2935   __ set_last_Java_frame(rdi, noreg, rbp, NULL);
2936 
2937   // Call C code.  Need thread but NOT official VM entry
2938   // crud.  We cannot block on this call, no GC can happen.  Call should
2939   // restore return values to their stack-slots with the new SP.
2940   __ movptr(Address(rsp,arg0_off*wordSize),rdi);




2635 
2636   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
2637 
2638   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
2639   __ movl(counter, rbx);
2640 
2641   // Now adjust the caller's stack to make up for the extra locals
2642   // but record the original sp so that we can save it in the skeletal interpreter
2643   // frame and the stack walking of interpreter_sender will get the unextended sp
2644   // value and not the "real" sp value.
2645 
2646   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());
2647   __ movptr(sp_temp, rsp);
2648   __ movl2ptr(rbx, Address(rdi, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()));
2649   __ subptr(rsp, rbx);
2650 
2651   // Push interpreter frames in a loop
2652   Label loop;
2653   __ bind(loop);
2654   __ movptr(rbx, Address(rsi, 0));      // Load frame size









2655   __ subptr(rbx, 2*wordSize);           // we'll push pc and rbp, by hand

2656   __ pushptr(Address(rcx, 0));          // save return address
2657   __ enter();                           // save old & set new rbp,
2658   __ subptr(rsp, rbx);                  // Prolog!
2659   __ movptr(rbx, sp_temp);              // sender's sp





2660   // This value is corrected by layout_activation_impl
2661   __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD);
2662   __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable

2663   __ movptr(sp_temp, rsp);              // pass to next frame
2664   __ addptr(rsi, wordSize);             // Bump array pointer (sizes)
2665   __ addptr(rcx, wordSize);             // Bump array pointer (pcs)
2666   __ decrementl(counter);             // decrement counter
2667   __ jcc(Assembler::notZero, loop);
2668   __ pushptr(Address(rcx, 0));          // save final return address
2669 
2670   // Re-push self-frame
2671   __ enter();                           // save old & set new rbp,
2672 
2673   //  Return address and rbp, are in place
2674   // We'll push additional args later. Just allocate a full sized
2675   // register save area
2676   __ subptr(rsp, (frame_size_in_words-additional_words - 2) * wordSize);
2677 
2678   // Restore frame locals after moving the frame
2679   __ movptr(Address(rsp, RegisterSaver::raxOffset()*wordSize), rax);
2680   __ movptr(Address(rsp, RegisterSaver::rdxOffset()*wordSize), rdx);
2681   __ fstp_d(Address(rsp, RegisterSaver::fpResultOffset()*wordSize));   // Pop float stack and store in local
2682   if( UseSSE>=2 ) __ movdbl(Address(rsp, RegisterSaver::xmm0Offset()*wordSize), xmm0);


2861 
2862   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
2863 
2864   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
2865   __ movl(counter, rbx);
2866 
2867   // Now adjust the caller's stack to make up for the extra locals
2868   // but record the original sp so that we can save it in the skeletal interpreter
2869   // frame and the stack walking of interpreter_sender will get the unextended sp
2870   // value and not the "real" sp value.
2871 
2872   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());
2873   __ movptr(sp_temp, rsp);
2874   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()));
2875   __ subptr(rsp, rbx);
2876 
2877   // Push interpreter frames in a loop
2878   Label loop;
2879   __ bind(loop);
2880   __ movptr(rbx, Address(rsi, 0));      // Load frame size









2881   __ subptr(rbx, 2*wordSize);           // we'll push pc and rbp, by hand

2882   __ pushptr(Address(rcx, 0));          // save return address
2883   __ enter();                           // save old & set new rbp,
2884   __ subptr(rsp, rbx);                  // Prolog!
2885   __ movptr(rbx, sp_temp);              // sender's sp





2886   // This value is corrected by layout_activation_impl
2887   __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD );
2888   __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable

2889   __ movptr(sp_temp, rsp);              // pass to next frame
2890   __ addptr(rsi, wordSize);             // Bump array pointer (sizes)
2891   __ addptr(rcx, wordSize);             // Bump array pointer (pcs)
2892   __ decrementl(counter);             // decrement counter
2893   __ jcc(Assembler::notZero, loop);
2894   __ pushptr(Address(rcx, 0));            // save final return address
2895 
2896   // Re-push self-frame
2897   __ enter();                           // save old & set new rbp,
2898   __ subptr(rsp, (framesize-2) * wordSize);   // Prolog!
2899 
2900 
2901   // set last_Java_sp, last_Java_fp
2902   __ get_thread(rdi);
2903   __ set_last_Java_frame(rdi, noreg, rbp, NULL);
2904 
2905   // Call C code.  Need thread but NOT official VM entry
2906   // crud.  We cannot block on this call, no GC can happen.  Call should
2907   // restore return values to their stack-slots with the new SP.
2908   __ movptr(Address(rsp,arg0_off*wordSize),rdi);


src/cpu/x86/vm/sharedRuntime_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File