aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-06-18 01:31:50 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-06-18 02:34:27 +0900
commitfb01411ae842dbcc16d18dec2216fa2719649dff (patch)
treee8dcf2550a7aa8c5579a86b2623b00b96d6f8f8c /compile.c
parentacae5f363dfaedd9c2873cee68c9498da3c072f5 (diff)
downloadruby-fb01411ae842dbcc16d18dec2216fa2719649dff.tar.gz
node.h: Reduce struct size to fit with Ruby object size (five VALUEs)
by merging `rb_ast_body_t#line_count` and `#script_lines`. Fortunately `line_count == RARRAY_LEN(script_lines)` was always satisfied. When script_lines is saved, it has an array of lines, and when not saved, it has a Fixnum that represents the old line_count.
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 30c75119b2..4b967a87a0 100644
--- a/compile.c
+++ b/compile.c
@@ -1328,8 +1328,7 @@ new_child_iseq(rb_iseq_t *iseq, const NODE *const node,
ast.root = node;
ast.compile_option = 0;
- ast.line_count = -1;
- ast.script_lines = Qfalse;
+ ast.script_lines = INT2FIX(-1);
debugs("[new_child_iseq]> ---------------------------------------\n");
int isolated_depth = ISEQ_COMPILE_DATA(iseq)->isolated_depth;