@@ -2833,36 +2833,122 @@ void MacroAssembler::push_IU_state() {
2833
2833
pusha ();
2834
2834
}
2835
2835
2836
- void MacroAssembler::push_cont_fastpath (Register java_thread ) {
2836
+ void MacroAssembler::push_cont_fastpath () {
2837
2837
if (!Continuations::enabled ()) return ;
2838
+
2839
+ #ifndef _LP64
2840
+ Register rthread = rax;
2841
+ Register rrealsp = rbx;
2842
+ push (rthread);
2843
+ push (rrealsp);
2844
+
2845
+ get_thread (rthread);
2846
+
2847
+ // The code below wants the original RSP.
2848
+ // Move it back after the pushes above.
2849
+ movptr (rrealsp, rsp);
2850
+ addptr (rrealsp, 2 *wordSize);
2851
+ #else
2852
+ Register rthread = r15_thread;
2853
+ Register rrealsp = rsp;
2854
+ #endif
2855
+
2838
2856
Label done;
2839
- cmpptr (rsp , Address (java_thread , JavaThread::cont_fastpath_offset ()));
2857
+ cmpptr (rrealsp , Address (rthread , JavaThread::cont_fastpath_offset ()));
2840
2858
jccb (Assembler::belowEqual, done);
2841
- movptr (Address (java_thread , JavaThread::cont_fastpath_offset ()), rsp );
2859
+ movptr (Address (rthread , JavaThread::cont_fastpath_offset ()), rrealsp );
2842
2860
bind (done);
2861
+
2862
+ #ifndef _LP64
2863
+ pop (rrealsp);
2864
+ pop (rthread);
2865
+ #endif
2843
2866
}
2844
2867
2845
- void MacroAssembler::pop_cont_fastpath (Register java_thread ) {
2868
+ void MacroAssembler::pop_cont_fastpath () {
2846
2869
if (!Continuations::enabled ()) return ;
2870
+
2871
+ #ifndef _LP64
2872
+ Register rthread = rax;
2873
+ Register rrealsp = rbx;
2874
+ push (rthread);
2875
+ push (rrealsp);
2876
+
2877
+ get_thread (rthread);
2878
+
2879
+ // The code below wants the original RSP.
2880
+ // Move it back after the pushes above.
2881
+ movptr (rrealsp, rsp);
2882
+ addptr (rrealsp, 2 *wordSize);
2883
+ #else
2884
+ Register rthread = r15_thread;
2885
+ Register rrealsp = rsp;
2886
+ #endif
2887
+
2847
2888
Label done;
2848
- cmpptr (rsp , Address (java_thread , JavaThread::cont_fastpath_offset ()));
2889
+ cmpptr (rrealsp , Address (rthread , JavaThread::cont_fastpath_offset ()));
2849
2890
jccb (Assembler::below, done);
2850
- movptr (Address (java_thread , JavaThread::cont_fastpath_offset ()), 0 );
2891
+ movptr (Address (rthread , JavaThread::cont_fastpath_offset ()), 0 );
2851
2892
bind (done);
2893
+
2894
+ #ifndef _LP64
2895
+ pop (rrealsp);
2896
+ pop (rthread);
2897
+ #endif
2852
2898
}
2853
2899
2854
- void MacroAssembler::inc_held_monitor_count (Register java_thread ) {
2900
+ void MacroAssembler::inc_held_monitor_count () {
2855
2901
if (!Continuations::enabled ()) return ;
2856
- incrementl (Address (java_thread, JavaThread::held_monitor_count_offset ()));
2902
+
2903
+ #ifndef _LP64
2904
+ Register thread = rax;
2905
+ push (thread);
2906
+ get_thread (thread);
2907
+ #else
2908
+ Register thread = r15_thread;
2909
+ #endif
2910
+
2911
+ incrementl (Address (thread, JavaThread::held_monitor_count_offset ()));
2912
+
2913
+ #ifndef _LP64
2914
+ pop (thread);
2915
+ #endif
2857
2916
}
2858
2917
2859
- void MacroAssembler::dec_held_monitor_count (Register java_thread ) {
2918
+ void MacroAssembler::dec_held_monitor_count () {
2860
2919
if (!Continuations::enabled ()) return ;
2861
- decrementl (Address (java_thread, JavaThread::held_monitor_count_offset ()));
2920
+
2921
+ #ifndef _LP64
2922
+ Register thread = rax;
2923
+ push (thread);
2924
+ get_thread (thread);
2925
+ #else
2926
+ Register thread = r15_thread;
2927
+ #endif
2928
+
2929
+ decrementl (Address (thread, JavaThread::held_monitor_count_offset ()));
2930
+
2931
+ #ifndef _LP64
2932
+ pop (thread);
2933
+ #endif
2862
2934
}
2863
2935
2864
- void MacroAssembler::reset_held_monitor_count (Register java_thread) {
2865
- movl (Address (java_thread, JavaThread::held_monitor_count_offset ()), (int32_t )0 );
2936
+ void MacroAssembler::reset_held_monitor_count () {
2937
+ if (!Continuations::enabled ()) return ;
2938
+
2939
+ #ifndef _LP64
2940
+ Register thread = rax;
2941
+ push (thread);
2942
+ get_thread (thread);
2943
+ #else
2944
+ Register thread = r15_thread;
2945
+ #endif
2946
+
2947
+ movl (Address (thread, JavaThread::held_monitor_count_offset ()), (int32_t )0 );
2948
+
2949
+ #ifndef _LP64
2950
+ pop (thread);
2951
+ #endif
2866
2952
}
2867
2953
2868
2954
#ifdef ASSERT
0 commit comments