debase-ruby_core_source 3.3.6 → 4.0.0.preview2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +10 -0
- data/Rakefile +3 -1
- data/debase-ruby_core_source.gemspec +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/builtin.h +7 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/darray.h +1 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/id.h +5 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns.inc +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/insns_info.inc +310 -175
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/basic_operators.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/bits.h +82 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/encoding.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/error.h +26 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/fixnum.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/gc.h +14 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/imemo.h +6 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/io.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/parse.h +2 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/proc.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/ractor.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/sanitizers.h +31 -39
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/string.h +22 -10
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/thread.h +23 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/vm.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/method.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/optunifs.inc +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/parse.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/ast.h +427 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/defines.h +8 -7
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/diagnostic.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/extension.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prism.h +47 -11
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/version.h +2 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism_compile.h +5 -5
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/ractor_core.h +6 -6
- data/lib/debase/ruby_core_source/ruby-3.4.0-p-1/revision.h +5 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/rubyparser.h +3 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/thread_pthread.h +0 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/version.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm.inc +151 -88
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_core.h +40 -12
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_sync.h +3 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vmtc.inc +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/yjit.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/builtin.h +7 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/darray.h +101 -14
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/debug_counter.h +6 -4
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/dln.h +1 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/eval_intern.h +7 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/id.h +16 -5
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/id_table.h +15 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns.inc +49 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/insns_info.inc +2432 -721
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/array.h +3 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/basic_operators.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/bignum.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/bits.h +82 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cmdlineopt.h +3 -4
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/encoding.h +4 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/error.h +35 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/eval.h +8 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/fixnum.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/gc.h +54 -30
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/hash.h +3 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/imemo.h +94 -32
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/inits.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/io.h +30 -7
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/load.h +2 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/numeric.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/object.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/parse.h +18 -4
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/proc.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/ractor.h +4 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/re.h +7 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/sanitizers.h +88 -39
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/signal.h +1 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/st.h +1 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/string.h +39 -18
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/struct.h +38 -5
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/symbol.h +4 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/thread.h +42 -9
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/time.h +4 -1
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/variable.h +13 -11
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/internal/vm.h +6 -7
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal.h +0 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/iseq.h +19 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/known_errors.inc +103 -103
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/method.h +18 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node.h +14 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/optunifs.inc +1 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/parse.h +37 -36
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/ast.h +2495 -507
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/defines.h +61 -7
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/diagnostic.h +31 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/extension.h +5 -5
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/node.h +0 -21
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/options.h +186 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/parser.h +85 -40
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prism.h +88 -16
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/static_literals.h +3 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_buffer.h +18 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_char.h +1 -2
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_constant_pool.h +0 -8
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_integer.h +26 -15
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_list.h +6 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_newline_list.h +11 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_string.h +39 -13
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/version.h +3 -3
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism_compile.h +30 -12
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/ractor_core.h +47 -134
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regenc.h +9 -4
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/regint.h +0 -5
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/regparse.h +2 -2
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +5 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/rubyparser.h +214 -250
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/symbol.h +8 -10
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/thread_pthread.h +36 -27
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/variable.h +8 -20
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm.inc +884 -344
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_callinfo.h +110 -75
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_core.h +220 -106
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_exec.h +15 -4
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_insnhelper.h +11 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vm_sync.h +23 -4
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/vmtc.inc +42 -6
- data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/yjit.h +5 -3
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/zjit.h +47 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- data/lib/debase/ruby_core_source.rb +4 -2
- data/test/deduce_source_dir_test.rb +31 -0
- metadata +307 -293
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/internal/class.h +0 -283
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/regexp.h +0 -33
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/prism/util/pm_string_list.h +0 -44
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/revision.h +0 -5
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview1/shape.h +0 -233
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/revision.h +0 -5
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit.h +0 -101
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/rjit_c.h +0 -165
- data/lib/debase/ruby_core_source/ruby-3.4.0-preview2/ruby_atomic.h +0 -23
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/addr2line.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/build_assert/build_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/check_type/check_type.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/container_of/container_of.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/list/list.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ccan/str/str.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/constant.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/debug_counter.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/dln.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/encindex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/eval_intern.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/hrtime.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/id_table.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/array.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/bignum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/class.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cmdlineopt.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compar.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compile.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/compilers.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/complex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/cont.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/dir.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/enumerator.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/eval.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/file.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/internal/hash.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/inits.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/load.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/loadpath.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/math.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/missing.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/numeric.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/object.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/process.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/random.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/range.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/rational.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/re.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/ruby_parser.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/serial.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/signal.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/st.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/static_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/struct.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/symbol.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/time.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/transcode.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/util.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/variable.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal/warnings.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/internal.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/iseq.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/known_errors.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/node_name.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/optinsn.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_bits.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_node.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_st.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/parser_value.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/encoding.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/node.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/options.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/pack.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/parser.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/prettyprint.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/regexp.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/static_literals.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_buffer.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_char.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_constant_pool.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_integer.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_list.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_memchr.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_newline_list.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/prism/util/pm_string.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strncasecmp.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/prism/util/pm_strpbrk.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/probes_helper.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regenc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/regint.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/regparse.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/rjit_c.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/ruby_atomic.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/shape.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/siphash.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/symbol.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_none.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/thread_win32.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/timev.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/transcode_data.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/variable.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_call_iseq_optimized.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_callinfo.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_debug.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_exec.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-3.4.0-p-1}/vm_insnhelper.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-3.4.0-p-1}/vm_opts.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/addr2line.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/build_assert/build_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/check_type/check_type.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/container_of/container_of.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/list/list.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ccan/str/str.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/constant.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/encindex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/hrtime.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compar.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compile.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/compilers.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/complex.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/cont.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/dir.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enc.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enum.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/enumerator.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/file.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/loadpath.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/math.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/missing.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/process.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/random.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/range.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/rational.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/ruby_parser.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/serial.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/static_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/transcode.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/util.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/internal/warnings.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/node_name.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/optinsn.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_bits.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_node.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_st.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/parser_value.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/encoding.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/pack.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/prettyprint.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_memchr.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strncasecmp.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/prism/util/pm_strpbrk.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/probes_helper.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/ruby_assert.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/siphash.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_none.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/thread_win32.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/timev.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/transcode_data.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/version.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_call_iseq_optimized.inc +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_debug.h +0 -0
- /data/lib/debase/ruby_core_source/{ruby-3.4.0-preview2 → ruby-4.0.0-preview2}/vm_opts.h +0 -0
|
@@ -80,6 +80,17 @@ pm_newline_list_clear(pm_newline_list_t *list);
|
|
|
80
80
|
*/
|
|
81
81
|
bool pm_newline_list_append(pm_newline_list_t *list, const uint8_t *cursor);
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Returns the line of the given offset. If the offset is not in the list, the
|
|
85
|
+
* line of the closest offset less than the given offset is returned.
|
|
86
|
+
*
|
|
87
|
+
* @param list The list to search.
|
|
88
|
+
* @param cursor A pointer to the offset to search for.
|
|
89
|
+
* @param start_line The line to start counting from.
|
|
90
|
+
* @return The line of the given offset.
|
|
91
|
+
*/
|
|
92
|
+
int32_t pm_newline_list_line(const pm_newline_list_t *list, const uint8_t *cursor, int32_t start_line);
|
|
93
|
+
|
|
83
94
|
/**
|
|
84
95
|
* Returns the line and column of the given offset. If the offset is not in the
|
|
85
96
|
* list, the line and column of the closest offset less than the given offset
|
data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/util/pm_string.h
RENAMED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#include "prism/defines.h"
|
|
10
10
|
|
|
11
11
|
#include <assert.h>
|
|
12
|
+
#include <errno.h>
|
|
12
13
|
#include <stdbool.h>
|
|
13
14
|
#include <stddef.h>
|
|
14
15
|
#include <stdlib.h>
|
|
@@ -21,6 +22,9 @@
|
|
|
21
22
|
#include <fcntl.h>
|
|
22
23
|
#include <sys/mman.h>
|
|
23
24
|
#include <sys/stat.h>
|
|
25
|
+
#elif defined(PRISM_HAS_FILESYSTEM)
|
|
26
|
+
#include <fcntl.h>
|
|
27
|
+
#include <sys/stat.h>
|
|
24
28
|
#endif
|
|
25
29
|
|
|
26
30
|
/**
|
|
@@ -41,11 +45,11 @@ typedef struct {
|
|
|
41
45
|
/** This is a slice of another string, and should not be freed. */
|
|
42
46
|
PM_STRING_SHARED,
|
|
43
47
|
|
|
44
|
-
/** This string owns its memory, and should be freed using `pm_string_free`. */
|
|
48
|
+
/** This string owns its memory, and should be freed using `pm_string_free()`. */
|
|
45
49
|
PM_STRING_OWNED,
|
|
46
50
|
|
|
47
51
|
#ifdef PRISM_HAS_MMAP
|
|
48
|
-
/** This string is a memory-mapped file, and should be freed using `pm_string_free`. */
|
|
52
|
+
/** This string is a memory-mapped file, and should be freed using `pm_string_free()`. */
|
|
49
53
|
PM_STRING_MAPPED
|
|
50
54
|
#endif
|
|
51
55
|
} type;
|
|
@@ -92,6 +96,26 @@ void pm_string_owned_init(pm_string_t *string, uint8_t *source, size_t length);
|
|
|
92
96
|
*/
|
|
93
97
|
void pm_string_constant_init(pm_string_t *string, const char *source, size_t length);
|
|
94
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Represents the result of calling pm_string_mapped_init or
|
|
101
|
+
* pm_string_file_init. We need this additional information because there is
|
|
102
|
+
* not a platform-agnostic way to indicate that the file that was attempted to
|
|
103
|
+
* be opened was a directory.
|
|
104
|
+
*/
|
|
105
|
+
typedef enum {
|
|
106
|
+
/** Indicates that the string was successfully initialized. */
|
|
107
|
+
PM_STRING_INIT_SUCCESS = 0,
|
|
108
|
+
/**
|
|
109
|
+
* Indicates a generic error from a string_*_init function, where the type
|
|
110
|
+
* of error should be read from `errno` or `GetLastError()`.
|
|
111
|
+
*/
|
|
112
|
+
PM_STRING_INIT_ERROR_GENERIC = 1,
|
|
113
|
+
/**
|
|
114
|
+
* Indicates that the file that was attempted to be opened was a directory.
|
|
115
|
+
*/
|
|
116
|
+
PM_STRING_INIT_ERROR_DIRECTORY = 2
|
|
117
|
+
} pm_string_init_result_t;
|
|
118
|
+
|
|
95
119
|
/**
|
|
96
120
|
* Read the file indicated by the filepath parameter into source and load its
|
|
97
121
|
* contents and size into the given `pm_string_t`. The given `pm_string_t`
|
|
@@ -105,9 +129,11 @@ void pm_string_constant_init(pm_string_t *string, const char *source, size_t len
|
|
|
105
129
|
*
|
|
106
130
|
* @param string The string to initialize.
|
|
107
131
|
* @param filepath The filepath to read.
|
|
108
|
-
* @return
|
|
132
|
+
* @return The success of the read, indicated by the value of the enum.
|
|
133
|
+
*
|
|
134
|
+
* \public \memberof pm_string_t
|
|
109
135
|
*/
|
|
110
|
-
PRISM_EXPORTED_FUNCTION
|
|
136
|
+
PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_t *string, const char *filepath);
|
|
111
137
|
|
|
112
138
|
/**
|
|
113
139
|
* Read the file indicated by the filepath parameter into source and load its
|
|
@@ -116,17 +142,11 @@ PRISM_EXPORTED_FUNCTION bool pm_string_mapped_init(pm_string_t *string, const ch
|
|
|
116
142
|
*
|
|
117
143
|
* @param string The string to initialize.
|
|
118
144
|
* @param filepath The filepath to read.
|
|
119
|
-
* @return
|
|
120
|
-
*/
|
|
121
|
-
PRISM_EXPORTED_FUNCTION bool pm_string_file_init(pm_string_t *string, const char *filepath);
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Returns the memory size associated with the string.
|
|
145
|
+
* @return The success of the read, indicated by the value of the enum.
|
|
125
146
|
*
|
|
126
|
-
*
|
|
127
|
-
* @return The size of the memory associated with the string.
|
|
147
|
+
* \public \memberof pm_string_t
|
|
128
148
|
*/
|
|
129
|
-
|
|
149
|
+
PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_file_init(pm_string_t *string, const char *filepath);
|
|
130
150
|
|
|
131
151
|
/**
|
|
132
152
|
* Ensure the string is owned. If it is not, then reinitialize it as owned and
|
|
@@ -153,6 +173,8 @@ int pm_string_compare(const pm_string_t *left, const pm_string_t *right);
|
|
|
153
173
|
*
|
|
154
174
|
* @param string The string to get the length of.
|
|
155
175
|
* @return The length of the string.
|
|
176
|
+
*
|
|
177
|
+
* \public \memberof pm_string_t
|
|
156
178
|
*/
|
|
157
179
|
PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string);
|
|
158
180
|
|
|
@@ -161,6 +183,8 @@ PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string);
|
|
|
161
183
|
*
|
|
162
184
|
* @param string The string to get the start pointer of.
|
|
163
185
|
* @return The start pointer of the string.
|
|
186
|
+
*
|
|
187
|
+
* \public \memberof pm_string_t
|
|
164
188
|
*/
|
|
165
189
|
PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string);
|
|
166
190
|
|
|
@@ -168,6 +192,8 @@ PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *stri
|
|
|
168
192
|
* Free the associated memory of the given string.
|
|
169
193
|
*
|
|
170
194
|
* @param string The string to free.
|
|
195
|
+
*
|
|
196
|
+
* \public \memberof pm_string_t
|
|
171
197
|
*/
|
|
172
198
|
PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string);
|
|
173
199
|
|
data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism/version.h
RENAMED
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* The major version of the Prism library as an int.
|
|
11
11
|
*/
|
|
12
|
-
#define PRISM_VERSION_MAJOR
|
|
12
|
+
#define PRISM_VERSION_MAJOR 1
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* The minor version of the Prism library as an int.
|
|
16
16
|
*/
|
|
17
|
-
#define PRISM_VERSION_MINOR
|
|
17
|
+
#define PRISM_VERSION_MINOR 6
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The patch version of the Prism library as an int.
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
/**
|
|
25
25
|
* The version of the Prism library as a constant string.
|
|
26
26
|
*/
|
|
27
|
-
#define PRISM_VERSION "
|
|
27
|
+
#define PRISM_VERSION "1.6.0"
|
|
28
28
|
|
|
29
29
|
#endif
|
data/lib/debase/ruby_core_source/{ruby-3.4.0-preview1 → ruby-4.0.0-preview2}/prism_compile.h
RENAMED
|
@@ -29,6 +29,16 @@ typedef struct pm_scope_node {
|
|
|
29
29
|
const pm_parser_t *parser;
|
|
30
30
|
rb_encoding *encoding;
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* This is a pointer to the list of script lines for the ISEQs that will be
|
|
34
|
+
* associated with this scope node. It is only set if
|
|
35
|
+
* RubyVM.keep_script_lines is true. If it is set, it will be set to a
|
|
36
|
+
* pointer to an array that is always stack allocated (so no GC marking is
|
|
37
|
+
* needed by this struct). If it is not set, it will be NULL. It is
|
|
38
|
+
* inherited by all child scopes.
|
|
39
|
+
*/
|
|
40
|
+
VALUE *script_lines;
|
|
41
|
+
|
|
32
42
|
/**
|
|
33
43
|
* This is the encoding of the actual filepath object that will be used when
|
|
34
44
|
* a __FILE__ node is compiled or when the path has to be set on a syntax
|
|
@@ -36,14 +46,16 @@ typedef struct pm_scope_node {
|
|
|
36
46
|
*/
|
|
37
47
|
rb_encoding *filepath_encoding;
|
|
38
48
|
|
|
39
|
-
// The size of the local table
|
|
40
|
-
//
|
|
41
|
-
// locals and hidden variables
|
|
49
|
+
// The size of the local table on the iseq which includes locals and hidden
|
|
50
|
+
// variables.
|
|
42
51
|
int local_table_for_iseq_size;
|
|
43
52
|
|
|
44
53
|
ID *constants;
|
|
45
54
|
st_table *index_lookup_table;
|
|
46
55
|
|
|
56
|
+
// The current coverage setting, passed down through the various scopes.
|
|
57
|
+
int coverage_enabled;
|
|
58
|
+
|
|
47
59
|
/**
|
|
48
60
|
* This will only be set on the top-level scope node. It will contain all of
|
|
49
61
|
* the instructions pertaining to BEGIN{} nodes.
|
|
@@ -53,7 +65,6 @@ typedef struct pm_scope_node {
|
|
|
53
65
|
|
|
54
66
|
void pm_scope_node_init(const pm_node_t *node, pm_scope_node_t *scope, pm_scope_node_t *previous);
|
|
55
67
|
void pm_scope_node_destroy(pm_scope_node_t *scope_node);
|
|
56
|
-
bool *rb_ruby_prism_ptr(void);
|
|
57
68
|
|
|
58
69
|
typedef struct {
|
|
59
70
|
/** The parser that will do the actual parsing. */
|
|
@@ -72,17 +83,24 @@ typedef struct {
|
|
|
72
83
|
bool parsed;
|
|
73
84
|
} pm_parse_result_t;
|
|
74
85
|
|
|
86
|
+
#define PM_SPECIAL_CONSTANT_FLAG ((pm_constant_id_t)(1 << 31))
|
|
87
|
+
#define PM_CONSTANT_AND ((pm_constant_id_t)(idAnd | PM_SPECIAL_CONSTANT_FLAG))
|
|
88
|
+
#define PM_CONSTANT_DOT3 ((pm_constant_id_t)(idDot3 | PM_SPECIAL_CONSTANT_FLAG))
|
|
89
|
+
#define PM_CONSTANT_MULT ((pm_constant_id_t)(idMULT | PM_SPECIAL_CONSTANT_FLAG))
|
|
90
|
+
#define PM_CONSTANT_POW ((pm_constant_id_t)(idPow | PM_SPECIAL_CONSTANT_FLAG))
|
|
91
|
+
|
|
75
92
|
VALUE pm_load_file(pm_parse_result_t *result, VALUE filepath, bool load_error);
|
|
76
|
-
VALUE pm_parse_file(pm_parse_result_t *result, VALUE filepath);
|
|
77
|
-
VALUE pm_load_parse_file(pm_parse_result_t *result, VALUE filepath);
|
|
78
|
-
VALUE pm_parse_string(pm_parse_result_t *result, VALUE source, VALUE filepath);
|
|
93
|
+
VALUE pm_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lines);
|
|
94
|
+
VALUE pm_load_parse_file(pm_parse_result_t *result, VALUE filepath, VALUE *script_lines);
|
|
95
|
+
VALUE pm_parse_string(pm_parse_result_t *result, VALUE source, VALUE filepath, VALUE *script_lines);
|
|
79
96
|
VALUE pm_parse_stdin(pm_parse_result_t *result);
|
|
97
|
+
void pm_options_version_for_current_ruby_set(pm_options_t *options);
|
|
80
98
|
void pm_parse_result_free(pm_parse_result_t *result);
|
|
81
99
|
|
|
82
|
-
rb_iseq_t *pm_iseq_new(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type);
|
|
83
|
-
rb_iseq_t *pm_iseq_new_top(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
|
|
84
|
-
rb_iseq_t *pm_iseq_new_main(pm_scope_node_t *node, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt);
|
|
85
|
-
rb_iseq_t *pm_iseq_new_eval(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth);
|
|
86
|
-
rb_iseq_t *pm_iseq_new_with_opt(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, enum rb_iseq_type, const rb_compile_option_t*);
|
|
100
|
+
rb_iseq_t *pm_iseq_new(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, enum rb_iseq_type, int *error_state);
|
|
101
|
+
rb_iseq_t *pm_iseq_new_top(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent, int *error_state);
|
|
102
|
+
rb_iseq_t *pm_iseq_new_main(pm_scope_node_t *node, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt, int *error_state);
|
|
103
|
+
rb_iseq_t *pm_iseq_new_eval(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, int *error_state);
|
|
104
|
+
rb_iseq_t *pm_iseq_new_with_opt(pm_scope_node_t *node, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth, enum rb_iseq_type, const rb_compile_option_t *option, int *error_state);
|
|
87
105
|
|
|
88
106
|
VALUE pm_iseq_compile_node(rb_iseq_t *iseq, pm_scope_node_t *node);
|
|
@@ -9,122 +9,36 @@
|
|
|
9
9
|
#define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE)
|
|
10
10
|
#endif
|
|
11
11
|
|
|
12
|
-
enum rb_ractor_basket_type {
|
|
13
|
-
// basket is empty
|
|
14
|
-
basket_type_none,
|
|
15
|
-
|
|
16
|
-
// value is available
|
|
17
|
-
basket_type_ref,
|
|
18
|
-
basket_type_copy,
|
|
19
|
-
basket_type_move,
|
|
20
|
-
basket_type_will,
|
|
21
|
-
|
|
22
|
-
// basket should be deleted
|
|
23
|
-
basket_type_deleted,
|
|
24
|
-
|
|
25
|
-
// basket is reserved
|
|
26
|
-
basket_type_reserved,
|
|
27
|
-
|
|
28
|
-
// take_basket is available
|
|
29
|
-
basket_type_take_basket,
|
|
30
|
-
|
|
31
|
-
// basket is keeping by yielding ractor
|
|
32
|
-
basket_type_yielding,
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// per ractor taking configuration
|
|
36
|
-
struct rb_ractor_selector_take_config {
|
|
37
|
-
bool closed;
|
|
38
|
-
bool oneshot;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
struct rb_ractor_basket {
|
|
42
|
-
union {
|
|
43
|
-
enum rb_ractor_basket_type e;
|
|
44
|
-
rb_atomic_t atomic;
|
|
45
|
-
} type;
|
|
46
|
-
VALUE sender;
|
|
47
|
-
|
|
48
|
-
union {
|
|
49
|
-
struct {
|
|
50
|
-
VALUE v;
|
|
51
|
-
bool exception;
|
|
52
|
-
} send;
|
|
53
|
-
|
|
54
|
-
struct {
|
|
55
|
-
struct rb_ractor_basket *basket;
|
|
56
|
-
struct rb_ractor_selector_take_config *config;
|
|
57
|
-
} take;
|
|
58
|
-
} p; // payload
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
static inline bool
|
|
62
|
-
basket_type_p(struct rb_ractor_basket *b, enum rb_ractor_basket_type type)
|
|
63
|
-
{
|
|
64
|
-
return b->type.e == type;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
static inline bool
|
|
68
|
-
basket_none_p(struct rb_ractor_basket *b)
|
|
69
|
-
{
|
|
70
|
-
return basket_type_p(b, basket_type_none);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
struct rb_ractor_queue {
|
|
74
|
-
struct rb_ractor_basket *baskets;
|
|
75
|
-
int start;
|
|
76
|
-
int cnt;
|
|
77
|
-
int size;
|
|
78
|
-
unsigned int serial;
|
|
79
|
-
unsigned int reserved_cnt;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
enum rb_ractor_wait_status {
|
|
83
|
-
wait_none = 0x00,
|
|
84
|
-
wait_receiving = 0x01,
|
|
85
|
-
wait_taking = 0x02,
|
|
86
|
-
wait_yielding = 0x04,
|
|
87
|
-
wait_moving = 0x08,
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
enum rb_ractor_wakeup_status {
|
|
91
|
-
wakeup_none,
|
|
92
|
-
wakeup_by_send,
|
|
93
|
-
wakeup_by_yield,
|
|
94
|
-
wakeup_by_take,
|
|
95
|
-
wakeup_by_close,
|
|
96
|
-
wakeup_by_interrupt,
|
|
97
|
-
wakeup_by_retry,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
12
|
struct rb_ractor_sync {
|
|
101
13
|
// ractor lock
|
|
102
14
|
rb_nativethread_lock_t lock;
|
|
15
|
+
|
|
103
16
|
#if RACTOR_CHECK_MODE > 0
|
|
104
17
|
VALUE locked_by;
|
|
105
18
|
#endif
|
|
106
19
|
|
|
107
|
-
|
|
108
|
-
|
|
20
|
+
#ifndef RUBY_THREAD_PTHREAD_H
|
|
21
|
+
rb_nativethread_cond_t wakeup_cond;
|
|
22
|
+
#endif
|
|
109
23
|
|
|
110
|
-
//
|
|
111
|
-
struct
|
|
24
|
+
// incoming messages
|
|
25
|
+
struct ractor_queue *recv_queue;
|
|
112
26
|
|
|
113
|
-
//
|
|
114
|
-
struct
|
|
27
|
+
// waiting threads for receiving
|
|
28
|
+
struct ccan_list_head waiters;
|
|
115
29
|
|
|
116
|
-
//
|
|
117
|
-
|
|
30
|
+
// ports
|
|
31
|
+
VALUE default_port_value;
|
|
32
|
+
struct st_table *ports;
|
|
33
|
+
size_t next_port_id;
|
|
118
34
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
enum rb_ractor_wakeup_status wakeup_status;
|
|
122
|
-
rb_thread_t *waiting_thread;
|
|
123
|
-
} wait;
|
|
35
|
+
// monitors
|
|
36
|
+
struct ccan_list_head monitors;
|
|
124
37
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
38
|
+
// value
|
|
39
|
+
rb_ractor_t *successor;
|
|
40
|
+
VALUE legacy;
|
|
41
|
+
bool legacy_exc;
|
|
128
42
|
};
|
|
129
43
|
|
|
130
44
|
// created
|
|
@@ -150,12 +64,7 @@ enum ractor_status {
|
|
|
150
64
|
|
|
151
65
|
struct rb_ractor_struct {
|
|
152
66
|
struct rb_ractor_pub pub;
|
|
153
|
-
|
|
154
67
|
struct rb_ractor_sync sync;
|
|
155
|
-
VALUE receiving_mutex;
|
|
156
|
-
|
|
157
|
-
// vm wide barrier synchronization
|
|
158
|
-
rb_nativethread_cond_t barrier_wait_cond;
|
|
159
68
|
|
|
160
69
|
// thread management
|
|
161
70
|
struct {
|
|
@@ -167,6 +76,7 @@ struct rb_ractor_struct {
|
|
|
167
76
|
rb_execution_context_t *running_ec;
|
|
168
77
|
rb_thread_t *main;
|
|
169
78
|
} threads;
|
|
79
|
+
|
|
170
80
|
VALUE thgroup_default;
|
|
171
81
|
|
|
172
82
|
VALUE name;
|
|
@@ -180,6 +90,7 @@ struct rb_ractor_struct {
|
|
|
180
90
|
|
|
181
91
|
st_table *local_storage;
|
|
182
92
|
struct rb_id_table *idkey_local_storage;
|
|
93
|
+
VALUE local_storage_store_lock;
|
|
183
94
|
|
|
184
95
|
VALUE r_stdin;
|
|
185
96
|
VALUE r_stdout;
|
|
@@ -187,13 +98,8 @@ struct rb_ractor_struct {
|
|
|
187
98
|
VALUE verbose;
|
|
188
99
|
VALUE debug;
|
|
189
100
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// gc.c rb_objspace_reachable_objects_from
|
|
193
|
-
struct gc_mark_func_data_struct {
|
|
194
|
-
void *data;
|
|
195
|
-
void (*mark_func)(VALUE v, void *data);
|
|
196
|
-
} *mfd;
|
|
101
|
+
bool malloc_gc_disabled;
|
|
102
|
+
void *newobj_cache;
|
|
197
103
|
}; // rb_ractor_t is defined in vm_core.h
|
|
198
104
|
|
|
199
105
|
|
|
@@ -227,12 +133,16 @@ void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r);
|
|
|
227
133
|
void rb_ractor_terminate_interrupt_main_thread(rb_ractor_t *r);
|
|
228
134
|
void rb_ractor_terminate_all(void);
|
|
229
135
|
bool rb_ractor_main_p_(void);
|
|
230
|
-
void rb_ractor_finish_marking(void);
|
|
231
136
|
void rb_ractor_atfork(rb_vm_t *vm, rb_thread_t *th);
|
|
137
|
+
void rb_ractor_terminate_atfork(rb_vm_t *vm, rb_ractor_t *th);
|
|
138
|
+
VALUE rb_ractor_require(VALUE feature, bool silent);
|
|
139
|
+
VALUE rb_ractor_autoload_load(VALUE space, ID id);
|
|
232
140
|
|
|
233
141
|
VALUE rb_ractor_ensure_shareable(VALUE obj, VALUE name);
|
|
234
142
|
|
|
235
143
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
144
|
+
void rb_ractor_finish_marking(void);
|
|
145
|
+
|
|
236
146
|
bool rb_ractor_shareable_p_continue(VALUE obj);
|
|
237
147
|
|
|
238
148
|
// THIS FUNCTION SHOULD NOT CALL WHILE INCREMENTAL MARKING!!
|
|
@@ -283,12 +193,16 @@ rb_ractor_sleeper_thread_num(rb_ractor_t *r)
|
|
|
283
193
|
}
|
|
284
194
|
|
|
285
195
|
static inline void
|
|
286
|
-
rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th)
|
|
196
|
+
rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th, bool always_reset)
|
|
287
197
|
{
|
|
288
198
|
RUBY_DEBUG_LOG("th:%d->%u%s",
|
|
289
199
|
cr->threads.running_ec ? (int)rb_th_serial(cr->threads.running_ec->thread_ptr) : -1,
|
|
290
200
|
rb_th_serial(th), cr->threads.running_ec == th->ec ? " (same)" : "");
|
|
291
201
|
|
|
202
|
+
if (cr->threads.running_ec != th->ec || always_reset) {
|
|
203
|
+
th->running_time_us = 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
292
206
|
if (cr->threads.running_ec != th->ec) {
|
|
293
207
|
if (0) {
|
|
294
208
|
ruby_debug_printf("rb_ractor_thread_switch ec:%p->%p\n",
|
|
@@ -299,28 +213,21 @@ rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th)
|
|
|
299
213
|
return;
|
|
300
214
|
}
|
|
301
215
|
|
|
302
|
-
if (cr->threads.running_ec != th->ec) {
|
|
303
|
-
th->running_time_us = 0;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
216
|
cr->threads.running_ec = th->ec;
|
|
307
217
|
|
|
308
218
|
VM_ASSERT(cr == GET_RACTOR());
|
|
309
219
|
}
|
|
310
220
|
|
|
311
221
|
#define rb_ractor_set_current_ec(cr, ec) rb_ractor_set_current_ec_(cr, ec, __FILE__, __LINE__)
|
|
222
|
+
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
|
223
|
+
void rb_current_ec_set(rb_execution_context_t *ec);
|
|
224
|
+
#endif
|
|
312
225
|
|
|
313
226
|
static inline void
|
|
314
227
|
rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line)
|
|
315
228
|
{
|
|
316
229
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
|
317
|
-
|
|
318
|
-
# ifdef __APPLE__
|
|
319
230
|
rb_current_ec_set(ec);
|
|
320
|
-
# else
|
|
321
|
-
ruby_current_ec = ec;
|
|
322
|
-
# endif
|
|
323
|
-
|
|
324
231
|
#else
|
|
325
232
|
native_tls_set(ruby_current_ec_key, ec);
|
|
326
233
|
#endif
|
|
@@ -349,12 +256,6 @@ rb_ractor_setup_belonging_to(VALUE obj, uint32_t rid)
|
|
|
349
256
|
RACTOR_BELONGING_ID(obj) = rid;
|
|
350
257
|
}
|
|
351
258
|
|
|
352
|
-
static inline void
|
|
353
|
-
rb_ractor_setup_belonging(VALUE obj)
|
|
354
|
-
{
|
|
355
|
-
rb_ractor_setup_belonging_to(obj, rb_ractor_current_id());
|
|
356
|
-
}
|
|
357
|
-
|
|
358
259
|
static inline uint32_t
|
|
359
260
|
rb_ractor_belonging(VALUE obj)
|
|
360
261
|
{
|
|
@@ -366,9 +267,13 @@ rb_ractor_belonging(VALUE obj)
|
|
|
366
267
|
}
|
|
367
268
|
}
|
|
368
269
|
|
|
270
|
+
extern bool rb_ractor_ignore_belonging_flag;
|
|
271
|
+
|
|
369
272
|
static inline VALUE
|
|
370
273
|
rb_ractor_confirm_belonging(VALUE obj)
|
|
371
274
|
{
|
|
275
|
+
if (rb_ractor_ignore_belonging_flag) return obj;
|
|
276
|
+
|
|
372
277
|
uint32_t id = rb_ractor_belonging(obj);
|
|
373
278
|
|
|
374
279
|
if (id == 0) {
|
|
@@ -388,6 +293,14 @@ rb_ractor_confirm_belonging(VALUE obj)
|
|
|
388
293
|
}
|
|
389
294
|
return obj;
|
|
390
295
|
}
|
|
296
|
+
|
|
297
|
+
static inline void
|
|
298
|
+
rb_ractor_ignore_belonging(bool flag)
|
|
299
|
+
{
|
|
300
|
+
rb_ractor_ignore_belonging_flag = flag;
|
|
301
|
+
}
|
|
302
|
+
|
|
391
303
|
#else
|
|
392
304
|
#define rb_ractor_confirm_belonging(obj) obj
|
|
305
|
+
#define rb_ractor_ignore_belonging(flag) (0)
|
|
393
306
|
#endif
|
|
@@ -118,6 +118,11 @@ typedef struct {
|
|
|
118
118
|
|
|
119
119
|
typedef struct {
|
|
120
120
|
short int len;
|
|
121
|
+
#if defined(__has_attribute)
|
|
122
|
+
# if __has_attribute(nonstring)
|
|
123
|
+
__attribute__((nonstring))
|
|
124
|
+
# endif
|
|
125
|
+
#endif
|
|
121
126
|
const UChar name[6];
|
|
122
127
|
int ctype;
|
|
123
128
|
} PosixBracketEntryType;
|
|
@@ -187,8 +192,8 @@ ONIG_EXTERN int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigA
|
|
|
187
192
|
#define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
|
|
188
193
|
#define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
|
|
189
194
|
#define UNICODE_VALID_CODEPOINT_P(c) ( \
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
((c) <= 0x10ffff) && \
|
|
196
|
+
!((c) < 0x10000 && UTF16_IS_SURROGATE((c) >> 8)))
|
|
192
197
|
|
|
193
198
|
#define ONIGENC_ISO_8859_1_TO_LOWER_CASE(c) \
|
|
194
199
|
OnigEncISO_8859_1_ToLowerCaseTable[c]
|
|
@@ -234,8 +239,8 @@ extern int ONIG_ENC_REGISTER(const char *, OnigEncoding);
|
|
|
234
239
|
# define OnigEncodingDefine(f,n) \
|
|
235
240
|
OnigEncodingDeclare(n); \
|
|
236
241
|
void Init_##f(void) { \
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
ONIG_ENC_REGISTER(OnigEncodingName(n).name, \
|
|
243
|
+
&OnigEncodingName(n)); \
|
|
239
244
|
} \
|
|
240
245
|
OnigEncodingDeclare(n)
|
|
241
246
|
#else
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
/* #define USE_OP_PUSH_OR_JUMP_EXACT */
|
|
87
87
|
#define USE_QTFR_PEEK_NEXT
|
|
88
88
|
#define USE_ST_LIBRARY
|
|
89
|
-
#define USE_SUNDAY_QUICK_SEARCH
|
|
90
89
|
|
|
91
90
|
#define INIT_MATCH_STACK_SIZE 160
|
|
92
91
|
#define DEFAULT_MATCH_STACK_LIMIT_SIZE 0 /* unlimited */
|
|
@@ -163,9 +162,6 @@
|
|
|
163
162
|
rb_thread_check_ints(); \
|
|
164
163
|
} \
|
|
165
164
|
} while(0)
|
|
166
|
-
# define HANDLE_REG_TIMEOUT_IN_MATCH_AT do { \
|
|
167
|
-
rb_reg_raise_timeout(); \
|
|
168
|
-
} while (0)
|
|
169
165
|
# define onig_st_init_table st_init_table
|
|
170
166
|
# define onig_st_init_table_with_size st_init_table_with_size
|
|
171
167
|
# define onig_st_init_numtable st_init_numtable
|
|
@@ -1002,7 +998,6 @@ extern int onig_st_insert_strend(hash_table_type* table, const UChar* str_key, c
|
|
|
1002
998
|
extern size_t onig_memsize(const regex_t *reg);
|
|
1003
999
|
extern size_t onig_region_memsize(const struct re_registers *regs);
|
|
1004
1000
|
bool rb_reg_timeout_p(regex_t *reg, void *end_time);
|
|
1005
|
-
NORETURN(void rb_reg_raise_timeout(void));
|
|
1006
1001
|
#endif
|
|
1007
1002
|
|
|
1008
1003
|
RUBY_SYMBOL_EXPORT_END
|
|
@@ -69,8 +69,8 @@ RUBY_SYMBOL_EXPORT_BEGIN
|
|
|
69
69
|
#define NTYPE(node) ((node)->u.base.type)
|
|
70
70
|
#define SET_NTYPE(node, ntype) \
|
|
71
71
|
do { \
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
int value = ntype; \
|
|
73
|
+
memcpy(&((node)->u.base.type), &value, sizeof(int)); \
|
|
74
74
|
} while (0)
|
|
75
75
|
|
|
76
76
|
#define NSTR(node) (&((node)->u.str))
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#ifndef INTERNAL_ATOMIC_H
|
|
2
|
+
#define INTERNAL_ATOMIC_H
|
|
3
|
+
|
|
4
|
+
#include "ruby/atomic.h"
|
|
5
|
+
|
|
6
|
+
#define RUBY_ATOMIC_VALUE_LOAD(x) rbimpl_atomic_value_load(&(x), RBIMPL_ATOMIC_SEQ_CST)
|
|
7
|
+
|
|
8
|
+
/* shim macros only */
|
|
9
|
+
#define ATOMIC_ADD(var, val) RUBY_ATOMIC_ADD(var, val)
|
|
10
|
+
#define ATOMIC_CAS(var, oldval, newval) RUBY_ATOMIC_CAS(var, oldval, newval)
|
|
11
|
+
#define ATOMIC_DEC(var) RUBY_ATOMIC_DEC(var)
|
|
12
|
+
#define ATOMIC_EXCHANGE(var, val) RUBY_ATOMIC_EXCHANGE(var, val)
|
|
13
|
+
#define ATOMIC_FETCH_ADD(var, val) RUBY_ATOMIC_FETCH_ADD(var, val)
|
|
14
|
+
#define ATOMIC_FETCH_SUB(var, val) RUBY_ATOMIC_FETCH_SUB(var, val)
|
|
15
|
+
#define ATOMIC_INC(var) RUBY_ATOMIC_INC(var)
|
|
16
|
+
#define ATOMIC_OR(var, val) RUBY_ATOMIC_OR(var, val)
|
|
17
|
+
#define ATOMIC_PTR_CAS(var, oldval, newval) RUBY_ATOMIC_PTR_CAS(var, oldval, newval)
|
|
18
|
+
#define ATOMIC_PTR_EXCHANGE(var, val) RUBY_ATOMIC_PTR_EXCHANGE(var, val)
|
|
19
|
+
#define ATOMIC_SET(var, val) RUBY_ATOMIC_SET(var, val)
|
|
20
|
+
#define ATOMIC_SIZE_ADD(var, val) RUBY_ATOMIC_SIZE_ADD(var, val)
|
|
21
|
+
#define ATOMIC_SIZE_CAS(var, oldval, newval) RUBY_ATOMIC_SIZE_CAS(var, oldval, newval)
|
|
22
|
+
#define ATOMIC_SIZE_DEC(var) RUBY_ATOMIC_SIZE_DEC(var)
|
|
23
|
+
#define ATOMIC_SIZE_EXCHANGE(var, val) RUBY_ATOMIC_SIZE_EXCHANGE(var, val)
|
|
24
|
+
#define ATOMIC_SIZE_INC(var) RUBY_ATOMIC_SIZE_INC(var)
|
|
25
|
+
#define ATOMIC_SIZE_SUB(var, val) RUBY_ATOMIC_SIZE_SUB(var, val)
|
|
26
|
+
#define ATOMIC_SUB(var, val) RUBY_ATOMIC_SUB(var, val)
|
|
27
|
+
#define ATOMIC_VALUE_CAS(var, oldval, val) RUBY_ATOMIC_VALUE_CAS(var, oldval, val)
|
|
28
|
+
#define ATOMIC_VALUE_EXCHANGE(var, val) RUBY_ATOMIC_VALUE_EXCHANGE(var, val)
|
|
29
|
+
|
|
30
|
+
#define ATOMIC_LOAD_RELAXED(var) rbimpl_atomic_load(&(var), RBIMPL_ATOMIC_RELAXED)
|
|
31
|
+
|
|
32
|
+
typedef RBIMPL_ALIGNAS(8) uint64_t rbimpl_atomic_uint64_t;
|
|
33
|
+
|
|
34
|
+
static inline uint64_t
|
|
35
|
+
rbimpl_atomic_u64_load_relaxed(const volatile rbimpl_atomic_uint64_t *value)
|
|
36
|
+
{
|
|
37
|
+
#if defined(HAVE_GCC_ATOMIC_BUILTINS_64)
|
|
38
|
+
return __atomic_load_n(value, __ATOMIC_RELAXED);
|
|
39
|
+
#elif defined(_WIN32)
|
|
40
|
+
uint64_t val = *value;
|
|
41
|
+
return InterlockedCompareExchange64(RBIMPL_CAST((uint64_t *)value), val, val);
|
|
42
|
+
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
|
|
43
|
+
uint64_t val = *value;
|
|
44
|
+
return atomic_cas_64(value, val, val);
|
|
45
|
+
#else
|
|
46
|
+
return *value;
|
|
47
|
+
#endif
|
|
48
|
+
}
|
|
49
|
+
#define ATOMIC_U64_LOAD_RELAXED(var) rbimpl_atomic_u64_load_relaxed(&(var))
|
|
50
|
+
|
|
51
|
+
static inline void
|
|
52
|
+
rbimpl_atomic_u64_set_relaxed(volatile rbimpl_atomic_uint64_t *address, uint64_t value)
|
|
53
|
+
{
|
|
54
|
+
#if defined(HAVE_GCC_ATOMIC_BUILTINS_64)
|
|
55
|
+
__atomic_store_n(address, value, __ATOMIC_RELAXED);
|
|
56
|
+
#elif defined(_WIN32)
|
|
57
|
+
InterlockedExchange64(address, value);
|
|
58
|
+
#elif defined(__sun) && defined(HAVE_ATOMIC_H) && (defined(_LP64) || defined(_I32LPx))
|
|
59
|
+
atomic_swap_64(address, value);
|
|
60
|
+
#else
|
|
61
|
+
*address = value;
|
|
62
|
+
#endif
|
|
63
|
+
}
|
|
64
|
+
#define ATOMIC_U64_SET_RELAXED(var, val) rbimpl_atomic_u64_set_relaxed(&(var), val)
|
|
65
|
+
|
|
66
|
+
#endif
|