@@ -300,6 +300,7 @@ class VMNativeEntryWrapper {
300300
301301#define JRT_ENTRY (result_type, header ) \
302302 result_type header { \
303+ assert (current ==JavaThread::current ()," Must be" ); \
303304MACOS_AARCH64_ONLY (ThreadWXEnable__wx (WXWrite, current)); \
304305 ThreadInVMfromJava__tiv (current); \
305306VM_ENTRY_BASE (result_type, header, current) \
@@ -327,6 +328,7 @@ class VMNativeEntryWrapper {
327328
328329#define JRT_ENTRY_NO_ASYNC (result_type, header ) \
329330 result_type header { \
331+ assert (current ==JavaThread::current ()," Must be" ); \
330332MACOS_AARCH64_ONLY (ThreadWXEnable__wx (WXWrite, current)); \
331333 ThreadInVMfromJava__tiv (current,false /* check asyncs*/ ); \
332334VM_ENTRY_BASE (result_type, header, current) \
@@ -336,17 +338,20 @@ class VMNativeEntryWrapper {
336338// to get back into Java from the VM
337339#define JRT_BLOCK_ENTRY (result_type, header ) \
338340 result_type header { \
341+ assert (current ==JavaThread::current ()," Must be" ); \
339342MACOS_AARCH64_ONLY (ThreadWXEnable__wx (WXWrite, current)); \
340343 HandleMarkCleaner__hm (current);
341344
342345#define JRT_BLOCK \
343346 { \
347+ assert (current ==JavaThread::current ()," Must be" ); \
344348 ThreadInVMfromJava__tiv (current); \
345349 JavaThread* THREAD = current;/* For exception macros.*/ \
346350debug_only (VMEntryWrapper __vew;)
347351
348352#define JRT_BLOCK_NO_ASYNC \
349353 { \
354+ assert (current ==JavaThread::current ()," Must be" ); \
350355 ThreadInVMfromJava__tiv (current,false /* check asyncs*/ ); \
351356 JavaThread* THREAD = current;/* For exception macros.*/ \
352357debug_only (VMEntryWrapper __vew;)