* toml: parse deeply nested inline tables and arrays in less stack
Since #29578 sum type values are tagged unions stored inline, so every
`ast.Value` local and temporary of the recursive parser functions takes
the size of the largest variant. The frames of `inline_table`, `value`
and `array` grew to 5-7 KB each, and one level of inline table nesting
took 18 KB of stack (tcc, arm64), so the toml CI job overflowed the 8 MB
main thread on `qa-table-inline-nested-1000.toml` of the iarna suite.
The recursive path now writes each value into its destination slot
instead of returning it: `value_into`, `array_into` (which pushes a
placeholder and parses into it) and `assigned_value_into`, called from
`noinline` key parsers. The work around the recursive calls (separators,
comments, errors, insertion, the immutable keys of the enclosing inline
tables, now kept in `outer_immutables`) moves to `noinline` helpers.
One level of inline table nesting now takes 3.9 KB, an array level
2.3 KB (were 18.4 KB and 6.6 KB). `value()` and `array()` keep their
public signatures.
nested_depth_test.v parses 1001 levels of inline tables, arrays and
dotted keys in inline tables, and 500 levels of arrays of inline tables,
each in a spawned thread (8 MB stack on every 64-bit target).
* toml: keep dotted keys and table headers from extending arrays of tables
Since da62dd4bd7, find_in_table_view selects the last element of any
array segment for every caller. Table headers need that for their
leading segments (`[[fruit]]` then `[fruit.physical]`), but two callers
must not descend into an array:
- the dotted keys of key/value pairs, which may only extend tables, so
`[[tab.arr]]`, `[tab]`, `arr.val1=1` was accepted (toml-test
invalid/array/extend-defined-aot.toml). The same held for static
arrays: `a=[{}]` followed by `a.b=1`;
- the last segment of a `[x]` header, so `[[tbl]]` followed by `[tbl]`
was accepted as a redeclaration (toml-test
invalid/table/duplicate-key-07.toml).
Add find_key_table_view, which never enters arrays, and use it for the
dotted keys in root tables, table contents, inline tables and array
of tables entries. allocate_in_table now resolves the header's parent
path as before but requires its last segment to be a table.
array_of_tables_extension_test covers both toml-test cases, the static
array and inline table variants, and the valid documents that still
need to descend into arrays of tables.