1124 Assembler::StoreLoad | Assembler::StoreStore));
1125 } else {
1126 // Write serialization page so VM thread can do a pseudo remote membar.
1127 // We use the current thread pointer to calculate a thread specific
1128 // offset to write to within the page. This minimizes bus traffic
1129 // due to cache line collision.
1130 __ serialize_memory(thread, rcx);
1131 }
1132 }
1133
1134 #ifndef _LP64
1135 if (AlwaysRestoreFPU) {
1136 // Make sure the control word is correct.
1137 __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
1138 }
1139 #endif // _LP64
1140
1141 // check for safepoint operation in progress and/or pending suspend requests
1142 {
1143 Label Continue;
1144 __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
1145 SafepointSynchronize::_not_synchronized);
1146
1147 Label L;
1148 __ jcc(Assembler::notEqual, L);
1149 __ cmpl(Address(thread, JavaThread::suspend_flags_offset()), 0);
1150 __ jcc(Assembler::equal, Continue);
1151 __ bind(L);
1152
1153 // Don't use call_VM as it will see a possible pending exception
1154 // and forward it and never return here preventing us from
1155 // clearing _last_native_pc down below. Also can't use
1156 // call_VM_leaf either as it will check to see if r13 & r14 are
1157 // preserved and correspond to the bcp/locals pointers. So we do a
1158 // runtime call by hand.
1159 //
1160 #ifndef _LP64
1161 __ push(thread);
1162 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address,
1163 JavaThread::check_special_condition_for_native_trans)));
1164 __ increment(rsp, wordSize);
1165 __ get_thread(thread);
1166 #else
1167 __ mov(c_rarg0, r15_thread);
1168 __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
1169 __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
1170 __ andptr(rsp, -16); // align stack as required by ABI
1171 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans)));
|
1124 Assembler::StoreLoad | Assembler::StoreStore));
1125 } else {
1126 // Write serialization page so VM thread can do a pseudo remote membar.
1127 // We use the current thread pointer to calculate a thread specific
1128 // offset to write to within the page. This minimizes bus traffic
1129 // due to cache line collision.
1130 __ serialize_memory(thread, rcx);
1131 }
1132 }
1133
1134 #ifndef _LP64
1135 if (AlwaysRestoreFPU) {
1136 // Make sure the control word is correct.
1137 __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
1138 }
1139 #endif // _LP64
1140
1141 // check for safepoint operation in progress and/or pending suspend requests
1142 {
1143 Label Continue;
1144 Label slow_path;
1145
1146 #ifndef _LP64
1147 __ safepoint_poll(slow_path);
1148 #else
1149 __ safepoint_poll(slow_path, r15_thread, rscratch1);
1150 #endif
1151
1152 __ cmpl(Address(thread, JavaThread::suspend_flags_offset()), 0);
1153 __ jcc(Assembler::equal, Continue);
1154 __ bind(slow_path);
1155
1156 // Don't use call_VM as it will see a possible pending exception
1157 // and forward it and never return here preventing us from
1158 // clearing _last_native_pc down below. Also can't use
1159 // call_VM_leaf either as it will check to see if r13 & r14 are
1160 // preserved and correspond to the bcp/locals pointers. So we do a
1161 // runtime call by hand.
1162 //
1163 #ifndef _LP64
1164 __ push(thread);
1165 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address,
1166 JavaThread::check_special_condition_for_native_trans)));
1167 __ increment(rsp, wordSize);
1168 __ get_thread(thread);
1169 #else
1170 __ mov(c_rarg0, r15_thread);
1171 __ mov(r12, rsp); // remember sp (can only use r12 if not using call_VM)
1172 __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
1173 __ andptr(rsp, -16); // align stack as required by ABI
1174 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans)));
|