diff --git a/static_core/runtime/runtime.cpp b/static_core/runtime/runtime.cpp index 13b8dced8a95e6734e14accd5c8b689590082699..2b926453b6d0cfd7946d8d357c954803ecf9ae22 100644 --- a/static_core/runtime/runtime.cpp +++ b/static_core/runtime/runtime.cpp @@ -937,6 +937,12 @@ static inline void InitializeCompilerOptions() compiler::g_options.SetCompilerInlineExternalMethodsAot(false); } #endif + +#if defined(PANDA_COMPILER_DEBUG_INFO) && !defined(NDEBUG) + if (!compiler::g_options.WasSetCompilerEmitDebugInfo()) { + compiler::g_options.SetCompilerEmitDebugInfo(true); + } +#endif } bool Runtime::Initialize() @@ -953,16 +959,12 @@ bool Runtime::Initialize() CheckOptionsFromOs(); + InitializeCompilerOptions(); + if (!CreatePandaVM(GetRuntimeType())) { return false; } -#if defined(PANDA_COMPILER_DEBUG_INFO) && !defined(NDEBUG) - if (!compiler::g_options.WasSetCompilerEmitDebugInfo()) { - compiler::g_options.SetCompilerEmitDebugInfo(true); - } -#endif - // We must load AOT file before InitializePandaVM, because during initialization, code execution may be called. if (!HandleAotOptions()) { return false; @@ -993,8 +995,6 @@ bool Runtime::Initialize() StartMemAllocDumper(ConvertToString(options_.GetMemAllocDumpFile())); } - InitializeCompilerOptions(); - #ifdef PANDA_TARGET_MOBILE mem::GcHung::InitPreFork(true); #else