Commit 498becd7
498becd773a9Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 7 months ago · 1 file · ~1 modified
Description
fix: achieve bootstrap fixpoint by extracting GC_ROOT emission into helper method
The v1 compiler cannot compile a while loop nested inside two if statements at the end of declare_method_locals, generating "unsupported: WhileNode". Extract the loop into emit_gc_roots() so v1 can compile it, making gen2.c == gen3.c (0 diff lines).
Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]
Details
- Commit
- 498becd773a9
- Parent
- 8734ddc5b7c1
spinel_codegen.rbmodifiedView file
@@ -7158,14 +7158,18 @@
71587158
end71597159
if has_gc_locals == 171607160
if @needs_gc == 17161-
j = 07162-
while j < lnames.length7163-
if type_is_pointer(ltypes[j]) == 17164-
emit(" SP_GC_ROOT(lv_" + lnames[j] + ");")7165-
end7166-
j = j + 17167-
end7161+
emit_gc_roots(lnames, ltypes)7162+
end7163+
end7164+
end7165+
7166+
def emit_gc_roots(lnames, ltypes)7167+
j = 07168+
while j < lnames.length7169+
if type_is_pointer(ltypes[j]) == 17170+
emit(" SP_GC_ROOT(lv_" + lnames[j] + ");")71687171
end7172+
j = j + 171697173
end71707174
end71717175