From fafa8c7f6e9dea6dfcfd827d9e2a8632bea7b335 Mon Sep 17 00:00:00 2001 From: George Marques Date: Thu, 7 Oct 2021 15:18:52 -0300 Subject: Enable method type information on release builds This is needed to ensure GDScript compilation works properly on release builds and make use of optimized typed instructions. --- core/object/method_bind.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'core/object/method_bind.cpp') diff --git a/core/object/method_bind.cpp b/core/object/method_bind.cpp index c53104fe3f..d1d8b075fe 100644 --- a/core/object/method_bind.cpp +++ b/core/object/method_bind.cpp @@ -63,12 +63,15 @@ uint32_t MethodBind::get_hash() const { return hash; } -#ifdef DEBUG_METHODS_ENABLED PropertyInfo MethodBind::get_argument_info(int p_argument) const { ERR_FAIL_INDEX_V(p_argument, get_argument_count(), PropertyInfo()); PropertyInfo info = _gen_argument_type_info(p_argument); +#ifdef DEBUG_METHODS_ENABLED info.name = p_argument < arg_names.size() ? String(arg_names[p_argument]) : String("arg" + itos(p_argument)); +#else + info.name = String("arg" + itos(p_argument)); +#endif return info; } @@ -76,7 +79,6 @@ PropertyInfo MethodBind::get_return_info() const { return _gen_argument_type_info(-1); } -#endif void MethodBind::_set_const(bool p_const) { _const = p_const; } @@ -109,7 +111,6 @@ void MethodBind::set_default_arguments(const Vector &p_defargs) { default_argument_count = default_arguments.size(); } -#ifdef DEBUG_METHODS_ENABLED void MethodBind::_generate_argument_types(int p_count) { set_argument_count(p_count); @@ -123,8 +124,6 @@ void MethodBind::_generate_argument_types(int p_count) { argument_types = argt; } -#endif - MethodBind::MethodBind() { static int last_id = 0; method_id = last_id++; -- cgit v1.2.3