summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_compiler.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-11-18 10:32:28 -0300
committerGeorge Marques <george@gmarqu.es>2020-11-21 13:24:50 -0300
commit52ab64db691e1359ae64ef0d61a8359a2c2a38be (patch)
treeb0ad6993f661a2a1dc6a671289373d042c982646 /modules/gdscript/gdscript_compiler.cpp
parentd8b22097f24685cd87a78a5a4fe37a3e8a21ed71 (diff)
downloadredot-engine-52ab64db691e1359ae64ef0d61a8359a2c2a38be.tar.gz
GDScript: Add faster call instructions for builtin methods
Methods from builtin types can be called by using the function pointer when the argument and base types are known at compile time.
Diffstat (limited to 'modules/gdscript/gdscript_compiler.cpp')
-rw-r--r--modules/gdscript/gdscript_compiler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp
index 8383e47dec..69fe6d27cc 100644
--- a/modules/gdscript/gdscript_compiler.cpp
+++ b/modules/gdscript/gdscript_compiler.cpp
@@ -522,6 +522,8 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
} else {
gen->write_call(result, base, call->function_name, arguments);
}
+ } else if (base.type.has_type && base.type.kind == GDScriptDataType::BUILTIN) {
+ gen->write_call_builtin_type(result, base, base.type.builtin_type, call->function_name, arguments);
} else {
gen->write_call(result, base, call->function_name, arguments);
}