diff options
author | Peter Zhu <peter@peterzhu.ca> | 2024-02-15 16:09:57 -0500 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2024-02-16 10:15:35 -0500 |
commit | c5f22b5b75f839c0da5c504a4c9e9956545dc1ca (patch) | |
tree | c2a330fd846557155fb4622390b896c89ab887c2 /node.c | |
parent | f012ce0d18b19a8dfc815498108b9b5fdde26b46 (diff) |
Make all fields in AST movable
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -405,9 +405,13 @@ void rb_ast_update_references(rb_ast_t *ast) { if (ast->node_buffer) { - node_buffer_t *nb = ast->node_buffer; + ast->node_buffer->mark_hash = rb_gc_location(ast->node_buffer->mark_hash); + ast->node_buffer->tokens = rb_gc_location(ast->node_buffer->tokens); + node_buffer_t *nb = ast->node_buffer; iterate_node_values(ast, &nb->markable, update_ast_value, NULL); + + if (ast->body.script_lines) ast->body.script_lines = rb_gc_location(ast->body.script_lines); } } @@ -415,11 +419,13 @@ void rb_ast_mark(rb_ast_t *ast) { if (ast->node_buffer) { - rb_gc_mark(ast->node_buffer->mark_hash); - rb_gc_mark(ast->node_buffer->tokens); + rb_gc_mark_movable(ast->node_buffer->mark_hash); + rb_gc_mark_movable(ast->node_buffer->tokens); + node_buffer_t *nb = ast->node_buffer; iterate_node_values(ast, &nb->markable, mark_ast_value, NULL); - if (ast->body.script_lines) rb_gc_mark(ast->body.script_lines); + + if (ast->body.script_lines) rb_gc_mark_movable(ast->body.script_lines); } } |