You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
GDScript: Pool temporary values by type on the stack
So the stack slots perform less type changes, which is useful for future optimizations.
This commit is contained in:
@@ -711,7 +711,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
||||
case GDScriptParser::Node::UNARY_OPERATOR: {
|
||||
const GDScriptParser::UnaryOpNode *unary = static_cast<const GDScriptParser::UnaryOpNode *>(p_expression);
|
||||
|
||||
GDScriptCodeGenerator::Address result = codegen.add_temporary();
|
||||
GDScriptCodeGenerator::Address result = codegen.add_temporary(_gdtype_from_datatype(unary->get_datatype()));
|
||||
|
||||
GDScriptCodeGenerator::Address operand = _parse_expression(codegen, r_error, unary->operand);
|
||||
if (r_error) {
|
||||
@@ -729,7 +729,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
||||
case GDScriptParser::Node::BINARY_OPERATOR: {
|
||||
const GDScriptParser::BinaryOpNode *binary = static_cast<const GDScriptParser::BinaryOpNode *>(p_expression);
|
||||
|
||||
GDScriptCodeGenerator::Address result = codegen.add_temporary();
|
||||
GDScriptCodeGenerator::Address result = codegen.add_temporary(_gdtype_from_datatype(binary->get_datatype()));
|
||||
|
||||
switch (binary->operation) {
|
||||
case GDScriptParser::BinaryOpNode::OP_LOGIC_AND: {
|
||||
|
||||
Reference in New Issue
Block a user