370 if (!thread->stack_guards_enabled()) { |
370 if (!thread->stack_guards_enabled()) { |
371 thread->reguard_stack(); |
371 thread->reguard_stack(); |
372 } |
372 } |
373 |
373 |
374 // Check that there are shadow pages available before changing thread state |
374 // Check that there are shadow pages available before changing thread state |
375 // to Java |
375 // to Java. Calculate current_stack_pointer here to make sure |
376 if (!os::stack_shadow_pages_available(THREAD, method)) { |
376 // stack_shadow_pages_available() and bang_stack_shadow_pages() use the same sp. |
|
377 address sp = os::current_stack_pointer(); |
|
378 if (!os::stack_shadow_pages_available(THREAD, method, sp)) { |
377 // Throw stack overflow exception with preinitialized exception. |
379 // Throw stack overflow exception with preinitialized exception. |
378 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); |
380 Exceptions::throw_stack_overflow_exception(THREAD, __FILE__, __LINE__, method); |
379 return; |
381 return; |
380 } else { |
382 } else { |
381 // Touch pages checked if the OS needs them to be touched to be mapped. |
383 // Touch pages checked if the OS needs them to be touched to be mapped. |
382 os::map_stack_shadow_pages(); |
384 os::map_stack_shadow_pages(sp); |
383 } |
385 } |
384 |
386 |
385 #if INCLUDE_JVMCI |
387 #if INCLUDE_JVMCI |
386 if (alternative_target != NULL) { |
388 if (alternative_target != NULL) { |
387 if (alternative_target->is_alive()) { |
389 if (alternative_target->is_alive()) { |