1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

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.
This commit is contained in:
George Marques
2021-10-07 15:18:52 -03:00
parent 082f624ef4
commit fafa8c7f6e
5 changed files with 20 additions and 88 deletions

View File

@@ -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<Variant> &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++;