From 26494063237ab50b1a86847da1b3ce3c44d55409 Mon Sep 17 00:00:00 2001 From: Aleksey Shipilev Date: Mon, 18 Nov 2024 18:38:56 +0000 Subject: [PATCH] 8344352: 32-bit builds crash after JDK-8305895 Reviewed-by: rkennke, coleenp --- src/hotspot/share/runtime/arguments.cpp | 1 - src/hotspot/share/runtime/threads.cpp | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 175a85e33fb..0b16a634489 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -3678,7 +3678,6 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { if (UseCompactObjectHeaders && !UseCompressedClassPointers) { FLAG_SET_DEFAULT(UseCompressedClassPointers, true); } - ObjLayout::initialize(); #endif return JNI_OK; diff --git a/src/hotspot/share/runtime/threads.cpp b/src/hotspot/share/runtime/threads.cpp index f6b7b7956e2..73f2e87f5c7 100644 --- a/src/hotspot/share/runtime/threads.cpp +++ b/src/hotspot/share/runtime/threads.cpp @@ -497,6 +497,9 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // Timing (must come after argument parsing) TraceTime timer("Create VM", TRACETIME_LOG(Info, startuptime)); + // Initialize object layout after parsing the args + ObjLayout::initialize(); + // Initialize the os module after parsing the args jint os_init_2_result = os::init_2(); if (os_init_2_result != JNI_OK) return os_init_2_result;