GDScript: Gather instructions arguments beforehand

Almost all instructions need variant arguments. With this change they
are loaded in an array before each instruction call. This makes the
addressing code be localized to less places, improving compilation
overhead and binary size by a small margin.

This should not affect performance.
This commit is contained in:
George Marques 2020-11-13 10:31:14 -03:00
parent b6519d0d03
commit c707d6fe71
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D
6 changed files with 360 additions and 380 deletions

View file

@ -139,31 +139,13 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String
}
}
GDScriptFunction::GDScriptFunction() :
function_list(this) {
_stack_size = 0;
_call_size = 0;
rpc_mode = MultiplayerAPI::RPC_MODE_DISABLED;
GDScriptFunction::GDScriptFunction() {
name = "<anonymous>";
#ifdef DEBUG_ENABLED
_func_cname = nullptr;
{
MutexLock lock(GDScriptLanguage::get_singleton()->lock);
GDScriptLanguage::get_singleton()->function_list.add(&function_list);
}
profile.call_count = 0;
profile.self_time = 0;
profile.total_time = 0;
profile.frame_call_count = 0;
profile.frame_self_time = 0;
profile.frame_total_time = 0;
profile.last_frame_call_count = 0;
profile.last_frame_self_time = 0;
profile.last_frame_total_time = 0;
#endif
}