mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
01b2a7bd22
Remove conditional logic and consolidate NODE_IF implementation to use variable-sized nodes exclusively. This eliminates dual code paths and completes the NODE_IF migration started in previous commits. Changes: - inline new_if_var into new_if, remove p->var_nodes_enabled condition - remove new_unless function, replace calls with new_if (swap then/else) - remove codegen_if function, merge nil? optimization into gen_if_var - remove NODE_IF case from main codegen switch (always wrapped in NODE_VARIABLE) - fix nil? optimization to handle both traditional and variable-sized nodes - update gen_if_var to use direct struct field access instead of macros The nil? optimization now works with both node representations: - Traditional: NODE_TYPE(condition) == NODE_CALL (preserved) - Variable-sized: NODE_VARIABLE wrapper containing NODE_CALL struct This ensures obj.nil? patterns generate optimized OP_JMPNIL bytecode regardless of AST node representation. Co-authored-by: Claude <noreply@anthropic.com>