ruby/internal
HASUMI Hitoshi 9b1e97b211 [Universal parser] DeVALUE of p->debug_lines and ast->body.script_lines
This patch is part of universal parser work.

## Summary
- Decouple VALUE from members below:
  - `(struct parser_params *)->debug_lines`
  - `(rb_ast_t *)->body.script_lines`
- Instead, they are now `rb_parser_ary_t *`
  - They can also be a `(VALUE)FIXNUM` as before to hold line count
- `ISEQ_BODY(iseq)->variable.script_lines` remains VALUE
  - In order to do this,
  - Add `VALUE script_lines` param to `rb_iseq_new_with_opt()`
  - Introduce `rb_parser_build_script_lines_from()` to convert `rb_parser_ary_t *` into `VALUE`

## Other details
- Extend `rb_parser_ary_t *`. It previously could only store `rb_parser_ast_token *`, now can store script_lines, too
- Change tactics of building the top-level `SCRIPT_LINES__` in `yycompile0()`
  - Before: While parsing, each line of the script is added to `SCRIPT_LINES__[path]`
  - After: After `yyparse(p)`, `SCRIPT_LINES__[path]` will be built from `p->debug_lines`
- Remove the second parameter of `rb_parser_set_script_lines()` to make it simple
- Introduce `script_lines_free()` to be called from `rb_ast_free()` because the GC no longer takes care of the script_lines
- Introduce `rb_parser_string_deep_copy()` in parse.y to maintain script_lines when `rb_ruby_parser_free()` called
  - With regard to this, please see *Future tasks* below

## Future tasks
- Decouple IMEMO from `rb_ast_t *`
  - This lifts the five-members-restriction of Ruby object,
  - So we will be able to move the ownership of the `lex.string_buffer` from parser to AST
  - Then we remove `rb_parser_string_deep_copy()` to make the whole thing simple
2024-04-15 20:51:54 +09:00
..
array.h Suppress array-bounds warnings from gcc 13 2023-11-07 23:19:51 +09:00
basic_operators.h
bignum.h
bits.h Make popcount bit-masks stricter 2023-10-05 20:03:54 +09:00
class.h Refactor VM root modules 2024-03-06 15:33:43 -05:00
cmdlineopt.h [Feature #19790] Rename BUGREPORT_PATH as CRASH_REPORT 2023-09-25 22:57:28 +09:00
compar.h
compile.h Move the PC regardless of the leaf flag (#8232) 2023-08-16 20:28:33 -07:00
compilers.h
complex.h
cont.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
dir.h
enc.h
encoding.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
enum.h
enumerator.h
error.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
eval.h [Bug #20342] Consider wrapped load in main methods 2024-04-05 01:33:08 +09:00
file.h
fixnum.h
gc.h Fix setting GC stress at boot when objspace not available 2024-03-27 09:39:23 -04:00
hash.h Add rb_hash_free for the GC to use 2023-09-24 09:07:52 -04:00
imemo.h Extract imemo functions from gc.c into imemo.c 2024-02-22 11:35:09 -05:00
inits.h Merge rb_objspace_alloc and Init_heap. 2024-04-04 15:00:57 +01:00
io.h Define IO_WITHOUT_GVL macro 2024-01-24 20:51:50 +09:00
load.h
loadpath.h
math.h
missing.h Free environ when RUBY_FREE_AT_EXIT 2024-01-11 10:09:53 -05:00
numeric.h Faster Integer.sqrt for large bignum 2024-03-18 13:52:27 +09:00
object.h Move rb_class_allocate_instance from gc.c to object.c 2024-02-14 13:43:02 -05:00
parse.h [Universal parser] DeVALUE of p->debug_lines and ast->body.script_lines 2024-04-15 20:51:54 +09:00
proc.h
process.h
ractor.h
random.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
range.h
rational.h
re.h
ruby_parser.h [Universal parser] DeVALUE of p->debug_lines and ast->body.script_lines 2024-04-15 20:51:54 +09:00
sanitizers.h [DOC] Unify Doxygen formats (#10285) 2024-03-19 10:59:25 -07:00
serial.h
signal.h Revert "hijack SIGCHLD handler for internal use" 2024-04-04 21:48:14 +09:00
st.h Move internal ST functions to internal/st.h 2023-12-25 10:41:12 -05:00
static_assert.h
string.h Implement chilled strings 2024-03-19 09:26:49 +01:00
struct.h
symbol.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
thread.h Do not poll first 2024-01-05 05:51:25 +09:00
time.h
transcode.h Free everything at shutdown 2023-12-07 15:52:35 -05:00
util.h
variable.h Fix compaction for generic ivars 2023-11-24 13:29:04 -05:00
vm.h Exception#set_backtrace accept arrays of Backtrace::Location 2024-03-14 11:38:40 +01:00
warnings.h