summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_function.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-11-13 10:31:14 -0300
committerGeorge Marques <george@gmarqu.es>2020-11-21 13:24:49 -0300
commitc707d6fe717c43fecafa0aca53182f214268ec16 (patch)
treeea042ae9a1655dfc3ce0fcab17954bd33d2e4a88 /modules/gdscript/gdscript_function.cpp
parentb6519d0d03fa444ad39a41f295b25317926189fc (diff)
downloadredot-engine-c707d6fe717c43fecafa0aca53182f214268ec16.tar.gz
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.
Diffstat (limited to 'modules/gdscript/gdscript_function.cpp')
-rw-r--r--modules/gdscript/gdscript_function.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 397c1f0bf8..32372439c5 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -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
}