src/cpu/sparc/vm/templateInterpreter_sparc.cpp

Print this page




1037   //
1038   // setup the frame anchor
1039   //
1040   // The scavenge function only needs to know that the PC of this frame is
1041   // in the interpreter method entry code, it doesn't need to know the exact
1042   // PC and hence we can use O7 which points to the return address from the
1043   // previous call in the code stream (signature handler function)
1044   //
1045   // The other trick is we set last_Java_sp to FP instead of the usual SP because
1046   // we have pushed the extra frame in order to protect the volatile register(s)
1047   // in that frame when we return from the jni call
1048   //
1049 
1050   __ set_last_Java_frame(FP, O7);
1051   __ mov(O7, I7);  // make dummy interpreter frame look like one above,
1052                    // not meaningless information that'll confuse me.
1053 
1054   // flush the windows now. We don't care about the current (protection) frame
1055   // only the outer frames
1056 
1057   __ flush_windows();
1058 
1059   // mark windows as flushed
1060   Address flags(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset());
1061   __ set(JavaFrameAnchor::flushed, G3_scratch);
1062   __ st(G3_scratch, flags);
1063 
1064   // Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready.
1065 
1066   Address thread_state(G2_thread, JavaThread::thread_state_offset());
1067 #ifdef ASSERT
1068   { Label L;
1069     __ ld(thread_state, G3_scratch);
1070     __ cmp_and_br_short(G3_scratch, _thread_in_Java, Assembler::equal, Assembler::pt, L);
1071     __ stop("Wrong thread state in native stub");
1072     __ bind(L);
1073   }
1074 #endif // ASSERT
1075   __ set(_thread_in_native, G3_scratch);
1076   __ st(G3_scratch, thread_state);
1077 




1037   //
1038   // setup the frame anchor
1039   //
1040   // The scavenge function only needs to know that the PC of this frame is
1041   // in the interpreter method entry code, it doesn't need to know the exact
1042   // PC and hence we can use O7 which points to the return address from the
1043   // previous call in the code stream (signature handler function)
1044   //
1045   // The other trick is we set last_Java_sp to FP instead of the usual SP because
1046   // we have pushed the extra frame in order to protect the volatile register(s)
1047   // in that frame when we return from the jni call
1048   //
1049 
1050   __ set_last_Java_frame(FP, O7);
1051   __ mov(O7, I7);  // make dummy interpreter frame look like one above,
1052                    // not meaningless information that'll confuse me.
1053 
1054   // flush the windows now. We don't care about the current (protection) frame
1055   // only the outer frames
1056 
1057   __ flushw();
1058 
1059   // mark windows as flushed
1060   Address flags(G2_thread, JavaThread::frame_anchor_offset() + JavaFrameAnchor::flags_offset());
1061   __ set(JavaFrameAnchor::flushed, G3_scratch);
1062   __ st(G3_scratch, flags);
1063 
1064   // Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready.
1065 
1066   Address thread_state(G2_thread, JavaThread::thread_state_offset());
1067 #ifdef ASSERT
1068   { Label L;
1069     __ ld(thread_state, G3_scratch);
1070     __ cmp_and_br_short(G3_scratch, _thread_in_Java, Assembler::equal, Assembler::pt, L);
1071     __ stop("Wrong thread state in native stub");
1072     __ bind(L);
1073   }
1074 #endif // ASSERT
1075   __ set(_thread_in_native, G3_scratch);
1076   __ st(G3_scratch, thread_state);
1077