From 9c15e2f24bb4a07a310c89ec790ca47be9788e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Thu, 31 Aug 2023 18:38:47 +0200 Subject: [PATCH] Optimize GDScript VM codegen for MSVC --- modules/gdscript/gdscript_vm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 1ddd54b3236..29693938b50 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -397,7 +397,13 @@ void (*type_init_function_table[])(Variant *) = { #define OPCODES_END #define OPCODES_OUT #define DISPATCH_OPCODE continue +#ifdef _MSC_VER +#define OPCODE_SWITCH(m_test) \ + __assume(m_test <= OPCODE_END); \ + switch (m_test) +#else #define OPCODE_SWITCH(m_test) switch (m_test) +#endif #define OPCODE_BREAK break #define OPCODE_OUT break #endif