commit f9dd4b533df712f6ad101ee3f70d9042c86b8b66
parent 2e5bae3f1beee2be2beed977c85a4afa8f65d3a6
Author: Jan de Mooij <jdemooij@mozilla.com>
Date: Sat, 13 Dec 2025 08:11:45 +0000
Bug 2005479 part 9 - Handle result_type: None in MIROps.yaml a bit better. r=iain
This shrinks the generated LIR a bit for the very small number of MIR instructions with
explicit `result_type: None` such as `GuardGlobalGeneration`.
Also don't generate a `setResultType(MIRType::None)` call for these cases.
Differential Revision: https://phabricator.services.mozilla.com/D276165
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/js/src/jit/GenerateLIRFiles.py b/js/src/jit/GenerateLIRFiles.py
@@ -392,6 +392,8 @@ class {class_name} : public {parent_class}<{num_defs}, {num_operands}, {num_temp
def mir_type_to_lir_type(mir_type):
+ assert mir_type and mir_type != "None"
+
if mir_type == "Value":
return "BoxedValue"
@@ -491,7 +493,7 @@ def generate_lir_header(c_out, yaml_path, mir_yaml_path):
lir_result_type = None
else:
assert lir_result_type in result_types
- elif result_type:
+ elif result_type and result_type != "None":
lir_result_type = mir_type_to_lir_type(result_type)
assert lir_result_type in result_types
diff --git a/js/src/jit/GenerateMIRFiles.py b/js/src/jit/GenerateMIRFiles.py
@@ -235,7 +235,9 @@ def gen_mir_class(
code += " setGuard();\\\n"
if movable:
code += " setMovable();\\\n"
- if result:
+ # Note: MIRType::None is the default MIR result type so don't generate a
+ # setResultType call for it.
+ if result and result != "None":
code += f" setResultType(MIRType::{result});\\\n"
code += " }\\\n public:\\\n"
if arguments: