diff --git a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp index 6178f1988e5e74970a600fabf22101855dd77641..1c3cd19c838e731a368ec79a536808f07a95f554 100644 --- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp +++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp @@ -635,7 +635,11 @@ void os::setup_fpu() { #ifndef PRODUCT void os::verify_stack_alignment() { #ifdef AMD64 - assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment"); + // The current_stack_pointer() calls generated get_previous_sp stub routine. + // Only enable the assert after the routine becomes available. + if (StubRoutines::code1() != NULL) { + assert(((intptr_t)os::current_stack_pointer() & (StackAlignmentInBytes-1)) == 0, "incorrect stack alignment"); + } #endif } #endif