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
|
@@ -56,7 +56,8 @@
|
|
|
56
56
|
#define RVALUE_SIZE (sizeof(struct RBasic) + sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]))
|
|
57
57
|
|
|
58
58
|
#if VM_CHECK_MODE > 0
|
|
59
|
-
#define VM_ASSERT(
|
|
59
|
+
#define VM_ASSERT(expr, ...) \
|
|
60
|
+
RUBY_ASSERT_MESG_WHEN(VM_CHECK_MODE > 0, expr, #expr RBIMPL_VA_OPT_ARGS(__VA_ARGS__))
|
|
60
61
|
#define VM_UNREACHABLE(func) rb_bug(#func ": unreachable")
|
|
61
62
|
#define RUBY_ASSERT_CRITICAL_SECTION
|
|
62
63
|
#define RUBY_DEBUG_THREAD_SCHEDULE() rb_thread_schedule()
|
|
@@ -69,7 +70,30 @@
|
|
|
69
70
|
#define RUBY_ASSERT_MUTEX_OWNED(mutex) VM_ASSERT(rb_mutex_owned_p(mutex))
|
|
70
71
|
|
|
71
72
|
#if defined(RUBY_ASSERT_CRITICAL_SECTION)
|
|
72
|
-
|
|
73
|
+
/*
|
|
74
|
+
# Critical Section Assertions
|
|
75
|
+
|
|
76
|
+
These assertions are used to ensure that context switching does not occur between two points in the code. In theory,
|
|
77
|
+
such code should already be protected by a mutex, but these assertions are used to ensure that the mutex is held.
|
|
78
|
+
|
|
79
|
+
The specific case where it can be useful is where a mutex is held further up the call stack, and the code in question
|
|
80
|
+
may not directly hold the mutex. In this case, the critical section assertions can be used to ensure that the mutex is
|
|
81
|
+
held by someone else.
|
|
82
|
+
|
|
83
|
+
These assertions are only enabled when RUBY_ASSERT_CRITICAL_SECTION is defined, which is only defined if VM_CHECK_MODE
|
|
84
|
+
is set.
|
|
85
|
+
|
|
86
|
+
## Example Usage
|
|
87
|
+
|
|
88
|
+
```c
|
|
89
|
+
RUBY_ASSERT_CRITICAL_SECTION_ENTER();
|
|
90
|
+
// ... some code which does not invoke rb_vm_check_ints() ...
|
|
91
|
+
RUBY_ASSERT_CRITICAL_SECTION_LEAVE();
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
If `rb_vm_check_ints()` is called between the `RUBY_ASSERT_CRITICAL_SECTION_ENTER()` and
|
|
95
|
+
`RUBY_ASSERT_CRITICAL_SECTION_LEAVE()`, a failed assertion will result.
|
|
96
|
+
*/
|
|
73
97
|
extern int ruby_assert_critical_section_entered;
|
|
74
98
|
#define RUBY_ASSERT_CRITICAL_SECTION_ENTER() do{ruby_assert_critical_section_entered += 1;}while(false)
|
|
75
99
|
#define RUBY_ASSERT_CRITICAL_SECTION_LEAVE() do{VM_ASSERT(ruby_assert_critical_section_entered > 0);ruby_assert_critical_section_entered -= 1;}while(false)
|
|
@@ -94,8 +118,10 @@ extern int ruby_assert_critical_section_entered;
|
|
|
94
118
|
#include "internal.h"
|
|
95
119
|
#include "internal/array.h"
|
|
96
120
|
#include "internal/basic_operators.h"
|
|
121
|
+
#include "internal/box.h"
|
|
97
122
|
#include "internal/sanitizers.h"
|
|
98
123
|
#include "internal/serial.h"
|
|
124
|
+
#include "internal/set_table.h"
|
|
99
125
|
#include "internal/vm.h"
|
|
100
126
|
#include "method.h"
|
|
101
127
|
#include "node.h"
|
|
@@ -105,15 +131,6 @@ extern int ruby_assert_critical_section_entered;
|
|
|
105
131
|
#include "vm_opts.h"
|
|
106
132
|
|
|
107
133
|
#include "ruby/thread_native.h"
|
|
108
|
-
|
|
109
|
-
#if USE_SHARED_GC
|
|
110
|
-
typedef struct gc_function_map {
|
|
111
|
-
void *(*objspace_alloc)(void);
|
|
112
|
-
} rb_gc_function_map_t;
|
|
113
|
-
|
|
114
|
-
#define rb_gc_functions (&GET_VM()->gc_functions_map)
|
|
115
|
-
#endif
|
|
116
|
-
|
|
117
134
|
/*
|
|
118
135
|
* implementation selector of get_insn_info algorithm
|
|
119
136
|
* 0: linear search
|
|
@@ -238,14 +255,14 @@ union ic_serial_entry {
|
|
|
238
255
|
VALUE data[2];
|
|
239
256
|
};
|
|
240
257
|
|
|
258
|
+
#define IMEMO_CONST_CACHE_SHAREABLE IMEMO_FL_USER0
|
|
259
|
+
|
|
241
260
|
// imemo_constcache
|
|
242
261
|
struct iseq_inline_constant_cache_entry {
|
|
243
262
|
VALUE flags;
|
|
244
263
|
|
|
245
|
-
VALUE value;
|
|
246
|
-
|
|
247
|
-
VALUE _unused2; // v2
|
|
248
|
-
const rb_cref_t *ic_cref; // v3
|
|
264
|
+
VALUE value;
|
|
265
|
+
const rb_cref_t *ic_cref;
|
|
249
266
|
};
|
|
250
267
|
STATIC_ASSERT(sizeof_iseq_inline_constant_cache_entry,
|
|
251
268
|
(offsetof(struct iseq_inline_constant_cache_entry, ic_cref) +
|
|
@@ -269,7 +286,7 @@ struct iseq_inline_constant_cache {
|
|
|
269
286
|
};
|
|
270
287
|
|
|
271
288
|
struct iseq_inline_iv_cache_entry {
|
|
272
|
-
|
|
289
|
+
uint64_t value; // dest_shape_id in former half, attr_index in latter half
|
|
273
290
|
ID iv_set_name;
|
|
274
291
|
};
|
|
275
292
|
|
|
@@ -348,8 +365,6 @@ pathobj_realpath(VALUE pathobj)
|
|
|
348
365
|
}
|
|
349
366
|
|
|
350
367
|
/* Forward declarations */
|
|
351
|
-
struct rb_rjit_unit;
|
|
352
|
-
|
|
353
368
|
typedef uintptr_t iseq_bits_t;
|
|
354
369
|
|
|
355
370
|
#define ISEQ_IS_SIZE(body) (body->ic_size + body->ivc_size + body->ise_size + body->icvarc_size)
|
|
@@ -378,9 +393,12 @@ enum rb_builtin_attr {
|
|
|
378
393
|
BUILTIN_ATTR_SINGLE_NOARG_LEAF = 0x02,
|
|
379
394
|
// This attribute signals JIT to duplicate the iseq for each block iseq so that its `yield` will be monomorphic.
|
|
380
395
|
BUILTIN_ATTR_INLINE_BLOCK = 0x04,
|
|
396
|
+
// The iseq acts like a C method in backtraces.
|
|
397
|
+
BUILTIN_ATTR_C_TRACE = 0x08,
|
|
381
398
|
};
|
|
382
399
|
|
|
383
400
|
typedef VALUE (*rb_jit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *);
|
|
401
|
+
typedef VALUE (*rb_zjit_func_t)(struct rb_execution_context_struct *, struct rb_control_frame_struct *, rb_jit_func_t);
|
|
384
402
|
|
|
385
403
|
struct rb_iseq_constant_body {
|
|
386
404
|
enum rb_iseq_type type;
|
|
@@ -427,6 +445,7 @@ struct rb_iseq_constant_body {
|
|
|
427
445
|
unsigned int anon_rest: 1;
|
|
428
446
|
unsigned int anon_kwrest: 1;
|
|
429
447
|
unsigned int use_block: 1;
|
|
448
|
+
unsigned int forwardable: 1;
|
|
430
449
|
} flags;
|
|
431
450
|
|
|
432
451
|
unsigned int size;
|
|
@@ -477,6 +496,12 @@ struct rb_iseq_constant_body {
|
|
|
477
496
|
|
|
478
497
|
const ID *local_table; /* must free */
|
|
479
498
|
|
|
499
|
+
enum lvar_state {
|
|
500
|
+
lvar_uninitialized,
|
|
501
|
+
lvar_initialized,
|
|
502
|
+
lvar_reassigned,
|
|
503
|
+
} *lvar_states;
|
|
504
|
+
|
|
480
505
|
/* catch table */
|
|
481
506
|
struct iseq_catch_table *catch_table;
|
|
482
507
|
|
|
@@ -516,31 +541,28 @@ struct rb_iseq_constant_body {
|
|
|
516
541
|
|
|
517
542
|
const rb_iseq_t *mandatory_only_iseq;
|
|
518
543
|
|
|
519
|
-
#if
|
|
544
|
+
#if USE_YJIT || USE_ZJIT
|
|
520
545
|
// Function pointer for JIT code on jit_exec()
|
|
521
546
|
rb_jit_func_t jit_entry;
|
|
522
547
|
// Number of calls on jit_exec()
|
|
523
548
|
long unsigned jit_entry_calls;
|
|
524
|
-
#endif
|
|
525
|
-
|
|
526
|
-
#if USE_YJIT
|
|
527
549
|
// Function pointer for JIT code on jit_exec_exception()
|
|
528
550
|
rb_jit_func_t jit_exception;
|
|
529
551
|
// Number of calls on jit_exec_exception()
|
|
530
552
|
long unsigned jit_exception_calls;
|
|
531
553
|
#endif
|
|
532
554
|
|
|
533
|
-
#if USE_RJIT
|
|
534
|
-
// RJIT stores some data on each iseq.
|
|
535
|
-
VALUE rjit_blocks;
|
|
536
|
-
#endif
|
|
537
|
-
|
|
538
555
|
#if USE_YJIT
|
|
539
556
|
// YJIT stores some data on each iseq.
|
|
540
557
|
void *yjit_payload;
|
|
541
558
|
// Used to estimate how frequently this ISEQ gets called
|
|
542
559
|
uint64_t yjit_calls_at_interv;
|
|
543
560
|
#endif
|
|
561
|
+
|
|
562
|
+
#if USE_ZJIT
|
|
563
|
+
// ZJIT stores some data on each iseq.
|
|
564
|
+
void *zjit_payload;
|
|
565
|
+
#endif
|
|
544
566
|
};
|
|
545
567
|
|
|
546
568
|
/* T_IMEMO/iseq */
|
|
@@ -586,6 +608,12 @@ rb_iseq_check(const rb_iseq_t *iseq)
|
|
|
586
608
|
return iseq;
|
|
587
609
|
}
|
|
588
610
|
|
|
611
|
+
static inline bool
|
|
612
|
+
rb_iseq_attr_p(const rb_iseq_t *iseq, enum rb_builtin_attr attr)
|
|
613
|
+
{
|
|
614
|
+
return (ISEQ_BODY(iseq)->builtin_attrs & attr) == attr;
|
|
615
|
+
}
|
|
616
|
+
|
|
589
617
|
static inline const rb_iseq_t *
|
|
590
618
|
def_iseq_ptr(rb_method_definition_t *def)
|
|
591
619
|
{
|
|
@@ -616,10 +644,9 @@ typedef struct rb_at_exit_list {
|
|
|
616
644
|
struct rb_at_exit_list *next;
|
|
617
645
|
} rb_at_exit_list;
|
|
618
646
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
void
|
|
622
|
-
void rb_objspace_call_finalizer(struct rb_objspace *);
|
|
647
|
+
void *rb_objspace_alloc(void);
|
|
648
|
+
void rb_objspace_free(void *objspace);
|
|
649
|
+
void rb_objspace_call_finalizer(void);
|
|
623
650
|
|
|
624
651
|
typedef struct rb_hook_list_struct {
|
|
625
652
|
struct rb_event_hook_struct *hooks;
|
|
@@ -660,12 +687,15 @@ typedef struct rb_vm_struct {
|
|
|
660
687
|
bool terminate_waiting;
|
|
661
688
|
|
|
662
689
|
#ifndef RUBY_THREAD_PTHREAD_H
|
|
690
|
+
// win32
|
|
663
691
|
bool barrier_waiting;
|
|
664
692
|
unsigned int barrier_cnt;
|
|
665
|
-
rb_nativethread_cond_t
|
|
693
|
+
rb_nativethread_cond_t barrier_complete_cond;
|
|
694
|
+
rb_nativethread_cond_t barrier_release_cond;
|
|
666
695
|
#endif
|
|
667
696
|
} sync;
|
|
668
697
|
|
|
698
|
+
#ifdef RUBY_THREAD_PTHREAD_H
|
|
669
699
|
// ractor scheduling
|
|
670
700
|
struct {
|
|
671
701
|
rb_nativethread_lock_t lock;
|
|
@@ -699,7 +729,10 @@ typedef struct rb_vm_struct {
|
|
|
699
729
|
bool barrier_waiting;
|
|
700
730
|
unsigned int barrier_waiting_cnt;
|
|
701
731
|
unsigned int barrier_serial;
|
|
732
|
+
struct rb_ractor_struct *barrier_ractor;
|
|
733
|
+
unsigned int barrier_lock_rec;
|
|
702
734
|
} sched;
|
|
735
|
+
#endif
|
|
703
736
|
} ractor;
|
|
704
737
|
|
|
705
738
|
#ifdef USE_SIGALTSTACK
|
|
@@ -707,7 +740,6 @@ typedef struct rb_vm_struct {
|
|
|
707
740
|
#endif
|
|
708
741
|
|
|
709
742
|
rb_serial_t fork_gen;
|
|
710
|
-
struct ccan_list_head waiting_fds; /* <=> struct waiting_fd */
|
|
711
743
|
|
|
712
744
|
/* set in single-threaded processes only: */
|
|
713
745
|
volatile int ubf_async_safe;
|
|
@@ -722,18 +754,11 @@ typedef struct rb_vm_struct {
|
|
|
722
754
|
struct global_object_list *global_object_list;
|
|
723
755
|
const VALUE special_exceptions[ruby_special_error_count];
|
|
724
756
|
|
|
757
|
+
/* Ruby Box */
|
|
758
|
+
rb_box_t *root_box;
|
|
759
|
+
rb_box_t *main_box;
|
|
760
|
+
|
|
725
761
|
/* load */
|
|
726
|
-
VALUE top_self;
|
|
727
|
-
VALUE load_path;
|
|
728
|
-
VALUE load_path_snapshot;
|
|
729
|
-
VALUE load_path_check_cache;
|
|
730
|
-
VALUE expanded_load_path;
|
|
731
|
-
VALUE loaded_features;
|
|
732
|
-
VALUE loaded_features_snapshot;
|
|
733
|
-
VALUE loaded_features_realpaths;
|
|
734
|
-
VALUE loaded_features_realpath_map;
|
|
735
|
-
struct st_table *loaded_features_index;
|
|
736
|
-
struct st_table *loading_table;
|
|
737
762
|
// For running the init function of statically linked
|
|
738
763
|
// extensions when they are loaded
|
|
739
764
|
struct st_table *static_ext_inits;
|
|
@@ -743,9 +768,6 @@ typedef struct rb_vm_struct {
|
|
|
743
768
|
VALUE cmd[RUBY_NSIG];
|
|
744
769
|
} trap_list;
|
|
745
770
|
|
|
746
|
-
/* relation table of ensure - rollback for callcc */
|
|
747
|
-
struct st_table *ensure_rollback_table;
|
|
748
|
-
|
|
749
771
|
/* postponed_job (async-signal-safe, and thread-safe) */
|
|
750
772
|
struct rb_postponed_job_queue *postponed_job_queue;
|
|
751
773
|
|
|
@@ -759,28 +781,30 @@ typedef struct rb_vm_struct {
|
|
|
759
781
|
VALUE coverages, me2counter;
|
|
760
782
|
int coverage_mode;
|
|
761
783
|
|
|
762
|
-
struct
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
784
|
+
struct {
|
|
785
|
+
struct rb_objspace *objspace;
|
|
786
|
+
struct gc_mark_func_data_struct {
|
|
787
|
+
void *data;
|
|
788
|
+
void (*mark_func)(VALUE v, void *data);
|
|
789
|
+
} *mark_func_data;
|
|
790
|
+
} gc;
|
|
766
791
|
|
|
767
792
|
rb_at_exit_list *at_exit;
|
|
768
793
|
|
|
769
|
-
st_table *frozen_strings;
|
|
770
|
-
|
|
771
794
|
const struct rb_builtin_function *builtin_function_table;
|
|
772
795
|
|
|
773
796
|
st_table *ci_table;
|
|
774
797
|
struct rb_id_table *negative_cme_table;
|
|
775
798
|
st_table *overloaded_cme_table; // cme -> overloaded_cme
|
|
776
|
-
|
|
777
|
-
|
|
799
|
+
set_table *unused_block_warning_table;
|
|
800
|
+
set_table *cc_refinement_table;
|
|
778
801
|
|
|
779
802
|
// This id table contains a mapping from ID to ICs. It does this with ID
|
|
780
803
|
// keys and nested st_tables as values. The nested tables have ICs as keys
|
|
781
804
|
// and Qtrue as values. It is used when inline constant caches need to be
|
|
782
805
|
// invalidated or ISEQs are being freed.
|
|
783
806
|
struct rb_id_table *constant_cache;
|
|
807
|
+
ID inserting_constant_cache_id;
|
|
784
808
|
|
|
785
809
|
#ifndef VM_GLOBAL_CC_CACHE_TABLE_SIZE
|
|
786
810
|
#define VM_GLOBAL_CC_CACHE_TABLE_SIZE 1023
|
|
@@ -798,9 +822,10 @@ typedef struct rb_vm_struct {
|
|
|
798
822
|
size_t fiber_vm_stack_size;
|
|
799
823
|
size_t fiber_machine_stack_size;
|
|
800
824
|
} default_params;
|
|
801
|
-
|
|
802
825
|
} rb_vm_t;
|
|
803
826
|
|
|
827
|
+
extern bool ruby_vm_during_cleanup;
|
|
828
|
+
|
|
804
829
|
/* default values */
|
|
805
830
|
|
|
806
831
|
#define RUBY_VM_SIZE_ALIGN 4096
|
|
@@ -819,7 +844,7 @@ typedef struct rb_vm_struct {
|
|
|
819
844
|
#define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */
|
|
820
845
|
#endif
|
|
821
846
|
|
|
822
|
-
#if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer)
|
|
847
|
+
#if __has_feature(memory_sanitizer) || __has_feature(address_sanitizer) || __has_feature(leak_sanitizer)
|
|
823
848
|
/* It seems sanitizers consume A LOT of machine stacks */
|
|
824
849
|
#undef RUBY_VM_THREAD_MACHINE_STACK_SIZE
|
|
825
850
|
#define RUBY_VM_THREAD_MACHINE_STACK_SIZE (1024 * 1024 * sizeof(VALUE))
|
|
@@ -986,17 +1011,6 @@ struct rb_unblock_callback {
|
|
|
986
1011
|
|
|
987
1012
|
struct rb_mutex_struct;
|
|
988
1013
|
|
|
989
|
-
typedef struct rb_ensure_entry {
|
|
990
|
-
VALUE marker;
|
|
991
|
-
VALUE (*e_proc)(VALUE);
|
|
992
|
-
VALUE data2;
|
|
993
|
-
} rb_ensure_entry_t;
|
|
994
|
-
|
|
995
|
-
typedef struct rb_ensure_list {
|
|
996
|
-
struct rb_ensure_list *next;
|
|
997
|
-
struct rb_ensure_entry entry;
|
|
998
|
-
} rb_ensure_list_t;
|
|
999
|
-
|
|
1000
1014
|
typedef struct rb_fiber_struct rb_fiber_t;
|
|
1001
1015
|
|
|
1002
1016
|
struct rb_waiting_list {
|
|
@@ -1035,9 +1049,6 @@ struct rb_execution_context_struct {
|
|
|
1035
1049
|
const VALUE *root_lep;
|
|
1036
1050
|
VALUE root_svar;
|
|
1037
1051
|
|
|
1038
|
-
/* ensure & callcc */
|
|
1039
|
-
rb_ensure_list_t *ensure_list;
|
|
1040
|
-
|
|
1041
1052
|
/* trace information */
|
|
1042
1053
|
struct rb_trace_arg_struct *trace_arg;
|
|
1043
1054
|
|
|
@@ -1052,6 +1063,11 @@ struct rb_execution_context_struct {
|
|
|
1052
1063
|
|
|
1053
1064
|
VALUE private_const_reference;
|
|
1054
1065
|
|
|
1066
|
+
struct {
|
|
1067
|
+
VALUE obj;
|
|
1068
|
+
VALUE fields_obj;
|
|
1069
|
+
} gen_fields_cache;
|
|
1070
|
+
|
|
1055
1071
|
/* for GC */
|
|
1056
1072
|
struct {
|
|
1057
1073
|
VALUE *stack_start;
|
|
@@ -1095,7 +1111,7 @@ typedef struct rb_ractor_struct rb_ractor_t;
|
|
|
1095
1111
|
struct rb_native_thread;
|
|
1096
1112
|
|
|
1097
1113
|
typedef struct rb_thread_struct {
|
|
1098
|
-
struct ccan_list_node lt_node; // managed by a ractor
|
|
1114
|
+
struct ccan_list_node lt_node; // managed by a ractor (r->threads.set)
|
|
1099
1115
|
VALUE self;
|
|
1100
1116
|
rb_ractor_t *ractor;
|
|
1101
1117
|
rb_vm_t *vm;
|
|
@@ -1146,6 +1162,7 @@ typedef struct rb_thread_struct {
|
|
|
1146
1162
|
struct rb_unblock_callback unblock;
|
|
1147
1163
|
VALUE locking_mutex;
|
|
1148
1164
|
struct rb_mutex_struct *keeping_mutexes;
|
|
1165
|
+
struct ccan_list_head interrupt_exec_tasks;
|
|
1149
1166
|
|
|
1150
1167
|
struct rb_waiting_list *join_list;
|
|
1151
1168
|
|
|
@@ -1168,9 +1185,6 @@ typedef struct rb_thread_struct {
|
|
|
1168
1185
|
thread_invoke_type_func
|
|
1169
1186
|
} invoke_type;
|
|
1170
1187
|
|
|
1171
|
-
/* statistics data for profiler */
|
|
1172
|
-
VALUE stat_insn_usage;
|
|
1173
|
-
|
|
1174
1188
|
/* fiber */
|
|
1175
1189
|
rb_fiber_t *root_fiber;
|
|
1176
1190
|
|
|
@@ -1213,7 +1227,7 @@ rb_iseq_t *rb_iseq_new (const VALUE ast_value, VALUE name, VALUE path, V
|
|
|
1213
1227
|
rb_iseq_t *rb_iseq_new_top (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, const rb_iseq_t *parent);
|
|
1214
1228
|
rb_iseq_t *rb_iseq_new_main (const VALUE ast_value, VALUE path, VALUE realpath, const rb_iseq_t *parent, int opt);
|
|
1215
1229
|
rb_iseq_t *rb_iseq_new_eval (const VALUE ast_value, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth);
|
|
1216
|
-
rb_iseq_t *rb_iseq_new_with_opt(
|
|
1230
|
+
rb_iseq_t *rb_iseq_new_with_opt( VALUE ast_value, VALUE name, VALUE path, VALUE realpath, int first_lineno, const rb_iseq_t *parent, int isolated_depth,
|
|
1217
1231
|
enum rb_iseq_type, const rb_compile_option_t*,
|
|
1218
1232
|
VALUE script_lines);
|
|
1219
1233
|
|
|
@@ -1262,8 +1276,8 @@ typedef struct {
|
|
|
1262
1276
|
|
|
1263
1277
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
1264
1278
|
VALUE rb_proc_isolate(VALUE self);
|
|
1265
|
-
VALUE rb_proc_isolate_bang(VALUE self);
|
|
1266
|
-
VALUE rb_proc_ractor_make_shareable(VALUE
|
|
1279
|
+
VALUE rb_proc_isolate_bang(VALUE self, VALUE replace_self);
|
|
1280
|
+
VALUE rb_proc_ractor_make_shareable(VALUE proc, VALUE replace_self);
|
|
1267
1281
|
RUBY_SYMBOL_EXPORT_END
|
|
1268
1282
|
|
|
1269
1283
|
typedef struct {
|
|
@@ -1296,6 +1310,15 @@ enum vm_check_match_type {
|
|
|
1296
1310
|
#define VM_CHECKMATCH_TYPE_MASK 0x03
|
|
1297
1311
|
#define VM_CHECKMATCH_ARRAY 0x04
|
|
1298
1312
|
|
|
1313
|
+
enum vm_opt_newarray_send_type {
|
|
1314
|
+
VM_OPT_NEWARRAY_SEND_MAX = 1,
|
|
1315
|
+
VM_OPT_NEWARRAY_SEND_MIN = 2,
|
|
1316
|
+
VM_OPT_NEWARRAY_SEND_HASH = 3,
|
|
1317
|
+
VM_OPT_NEWARRAY_SEND_PACK = 4,
|
|
1318
|
+
VM_OPT_NEWARRAY_SEND_PACK_BUFFER = 5,
|
|
1319
|
+
VM_OPT_NEWARRAY_SEND_INCLUDE_P = 6,
|
|
1320
|
+
};
|
|
1321
|
+
|
|
1299
1322
|
enum vm_special_object_type {
|
|
1300
1323
|
VM_SPECIAL_OBJECT_VMCORE = 1,
|
|
1301
1324
|
VM_SPECIAL_OBJECT_CBASE,
|
|
@@ -1337,11 +1360,11 @@ typedef rb_control_frame_t *
|
|
|
1337
1360
|
|
|
1338
1361
|
enum vm_frame_env_flags {
|
|
1339
1362
|
/* Frame/Environment flag bits:
|
|
1340
|
-
* MMMM MMMM MMMM MMMM
|
|
1363
|
+
* MMMM MMMM MMMM MMMM ___F FFFF FFFE EEEX (LSB)
|
|
1341
1364
|
*
|
|
1342
1365
|
* X : tag for GC marking (It seems as Fixnum)
|
|
1343
1366
|
* EEE : 4 bits Env flags
|
|
1344
|
-
* FF..:
|
|
1367
|
+
* FF..: 8 bits Frame flags
|
|
1345
1368
|
* MM..: 15 bits frame magic (to check frame corruption)
|
|
1346
1369
|
*/
|
|
1347
1370
|
|
|
@@ -1364,8 +1387,9 @@ enum vm_frame_env_flags {
|
|
|
1364
1387
|
VM_FRAME_FLAG_CFRAME = 0x0080,
|
|
1365
1388
|
VM_FRAME_FLAG_LAMBDA = 0x0100,
|
|
1366
1389
|
VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM = 0x0200,
|
|
1367
|
-
VM_FRAME_FLAG_CFRAME_KW
|
|
1368
|
-
VM_FRAME_FLAG_PASSED
|
|
1390
|
+
VM_FRAME_FLAG_CFRAME_KW = 0x0400,
|
|
1391
|
+
VM_FRAME_FLAG_PASSED = 0x0800,
|
|
1392
|
+
VM_FRAME_FLAG_BOX_REQUIRE = 0x1000,
|
|
1369
1393
|
|
|
1370
1394
|
/* env flag */
|
|
1371
1395
|
VM_ENV_FLAG_LOCAL = 0x0002,
|
|
@@ -1409,12 +1433,31 @@ VM_ENV_FLAGS(const VALUE *ep, long flag)
|
|
|
1409
1433
|
return flags & flag;
|
|
1410
1434
|
}
|
|
1411
1435
|
|
|
1436
|
+
static inline unsigned long
|
|
1437
|
+
VM_ENV_FLAGS_UNCHECKED(const VALUE *ep, long flag)
|
|
1438
|
+
{
|
|
1439
|
+
VALUE flags = ep[VM_ENV_DATA_INDEX_FLAGS];
|
|
1440
|
+
return flags & flag;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
static inline unsigned long
|
|
1444
|
+
VM_ENV_FRAME_TYPE_P(const VALUE *ep, unsigned long frame_type)
|
|
1445
|
+
{
|
|
1446
|
+
return VM_ENV_FLAGS(ep, VM_FRAME_MAGIC_MASK) == frame_type;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1412
1449
|
static inline unsigned long
|
|
1413
1450
|
VM_FRAME_TYPE(const rb_control_frame_t *cfp)
|
|
1414
1451
|
{
|
|
1415
1452
|
return VM_ENV_FLAGS(cfp->ep, VM_FRAME_MAGIC_MASK);
|
|
1416
1453
|
}
|
|
1417
1454
|
|
|
1455
|
+
static inline unsigned long
|
|
1456
|
+
VM_FRAME_TYPE_UNCHECKED(const rb_control_frame_t *cfp)
|
|
1457
|
+
{
|
|
1458
|
+
return VM_ENV_FLAGS_UNCHECKED(cfp->ep, VM_FRAME_MAGIC_MASK);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1418
1461
|
static inline int
|
|
1419
1462
|
VM_FRAME_LAMBDA_P(const rb_control_frame_t *cfp)
|
|
1420
1463
|
{
|
|
@@ -1433,6 +1476,12 @@ VM_FRAME_FINISHED_P(const rb_control_frame_t *cfp)
|
|
|
1433
1476
|
return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_FINISH) != 0;
|
|
1434
1477
|
}
|
|
1435
1478
|
|
|
1479
|
+
static inline int
|
|
1480
|
+
VM_FRAME_FINISHED_P_UNCHECKED(const rb_control_frame_t *cfp)
|
|
1481
|
+
{
|
|
1482
|
+
return VM_ENV_FLAGS_UNCHECKED(cfp->ep, VM_FRAME_FLAG_FINISH) != 0;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1436
1485
|
static inline int
|
|
1437
1486
|
VM_FRAME_BMETHOD_P(const rb_control_frame_t *cfp)
|
|
1438
1487
|
{
|
|
@@ -1458,12 +1507,30 @@ VM_FRAME_CFRAME_P(const rb_control_frame_t *cfp)
|
|
|
1458
1507
|
return cframe_p;
|
|
1459
1508
|
}
|
|
1460
1509
|
|
|
1510
|
+
static inline int
|
|
1511
|
+
VM_FRAME_CFRAME_P_UNCHECKED(const rb_control_frame_t *cfp)
|
|
1512
|
+
{
|
|
1513
|
+
return VM_ENV_FLAGS_UNCHECKED(cfp->ep, VM_FRAME_FLAG_CFRAME) != 0;
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1461
1516
|
static inline int
|
|
1462
1517
|
VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp)
|
|
1463
1518
|
{
|
|
1464
1519
|
return !VM_FRAME_CFRAME_P(cfp);
|
|
1465
1520
|
}
|
|
1466
1521
|
|
|
1522
|
+
static inline int
|
|
1523
|
+
VM_FRAME_RUBYFRAME_P_UNCHECKED(const rb_control_frame_t *cfp)
|
|
1524
|
+
{
|
|
1525
|
+
return !VM_FRAME_CFRAME_P_UNCHECKED(cfp);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
static inline int
|
|
1529
|
+
VM_FRAME_NS_REQUIRE_P(const rb_control_frame_t *cfp)
|
|
1530
|
+
{
|
|
1531
|
+
return VM_ENV_FLAGS(cfp->ep, VM_FRAME_FLAG_BOX_REQUIRE) != 0;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1467
1534
|
#define RUBYVM_CFUNC_FRAME_P(cfp) \
|
|
1468
1535
|
(VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
|
|
1469
1536
|
|
|
@@ -1476,20 +1543,57 @@ VM_ENV_LOCAL_P(const VALUE *ep)
|
|
|
1476
1543
|
return VM_ENV_FLAGS(ep, VM_ENV_FLAG_LOCAL) ? 1 : 0;
|
|
1477
1544
|
}
|
|
1478
1545
|
|
|
1546
|
+
static inline int
|
|
1547
|
+
VM_ENV_LOCAL_P_UNCHECKED(const VALUE *ep)
|
|
1548
|
+
{
|
|
1549
|
+
return VM_ENV_FLAGS_UNCHECKED(ep, VM_ENV_FLAG_LOCAL) ? 1 : 0;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
static inline const VALUE *
|
|
1553
|
+
VM_ENV_PREV_EP_UNCHECKED(const VALUE *ep)
|
|
1554
|
+
{
|
|
1555
|
+
return GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1479
1558
|
static inline const VALUE *
|
|
1480
1559
|
VM_ENV_PREV_EP(const VALUE *ep)
|
|
1481
1560
|
{
|
|
1482
1561
|
VM_ASSERT(VM_ENV_LOCAL_P(ep) == 0);
|
|
1483
|
-
return
|
|
1562
|
+
return VM_ENV_PREV_EP_UNCHECKED(ep);
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
static inline bool
|
|
1566
|
+
VM_ENV_BOXED_P(const VALUE *ep)
|
|
1567
|
+
{
|
|
1568
|
+
return VM_ENV_FRAME_TYPE_P(ep, VM_FRAME_MAGIC_CLASS) || VM_ENV_FRAME_TYPE_P(ep, VM_FRAME_MAGIC_TOP);
|
|
1484
1569
|
}
|
|
1485
1570
|
|
|
1486
1571
|
static inline VALUE
|
|
1487
1572
|
VM_ENV_BLOCK_HANDLER(const VALUE *ep)
|
|
1488
1573
|
{
|
|
1574
|
+
if (VM_ENV_BOXED_P(ep)) {
|
|
1575
|
+
VM_ASSERT(VM_ENV_LOCAL_P(ep));
|
|
1576
|
+
return VM_BLOCK_HANDLER_NONE;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1489
1579
|
VM_ASSERT(VM_ENV_LOCAL_P(ep));
|
|
1490
1580
|
return ep[VM_ENV_DATA_INDEX_SPECVAL];
|
|
1491
1581
|
}
|
|
1492
1582
|
|
|
1583
|
+
static inline const rb_box_t *
|
|
1584
|
+
VM_ENV_BOX(const VALUE *ep)
|
|
1585
|
+
{
|
|
1586
|
+
VM_ASSERT(VM_ENV_BOXED_P(ep));
|
|
1587
|
+
VM_ASSERT(VM_ENV_LOCAL_P(ep));
|
|
1588
|
+
return (const rb_box_t *)GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]);
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
static inline const rb_box_t *
|
|
1592
|
+
VM_ENV_BOX_UNCHECKED(const VALUE *ep)
|
|
1593
|
+
{
|
|
1594
|
+
return (const rb_box_t *)GC_GUARDED_PTR_REF(ep[VM_ENV_DATA_INDEX_SPECVAL]);
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1493
1597
|
#if VM_CHECK_MODE > 0
|
|
1494
1598
|
int rb_vm_ep_in_heap_p(const VALUE *ep);
|
|
1495
1599
|
#endif
|
|
@@ -1501,22 +1605,13 @@ VM_ENV_ESCAPED_P(const VALUE *ep)
|
|
|
1501
1605
|
return VM_ENV_FLAGS(ep, VM_ENV_FLAG_ESCAPED) ? 1 : 0;
|
|
1502
1606
|
}
|
|
1503
1607
|
|
|
1504
|
-
#if VM_CHECK_MODE > 0
|
|
1505
|
-
static inline int
|
|
1506
|
-
vm_assert_env(VALUE obj)
|
|
1507
|
-
{
|
|
1508
|
-
VM_ASSERT(imemo_type_p(obj, imemo_env));
|
|
1509
|
-
return 1;
|
|
1510
|
-
}
|
|
1511
|
-
#endif
|
|
1512
|
-
|
|
1513
1608
|
RBIMPL_ATTR_NONNULL((1))
|
|
1514
1609
|
static inline VALUE
|
|
1515
1610
|
VM_ENV_ENVVAL(const VALUE *ep)
|
|
1516
1611
|
{
|
|
1517
1612
|
VALUE envval = ep[VM_ENV_DATA_INDEX_ENV];
|
|
1518
1613
|
VM_ASSERT(VM_ENV_ESCAPED_P(ep));
|
|
1519
|
-
VM_ASSERT(
|
|
1614
|
+
VM_ASSERT(envval == Qundef || imemo_type_p(envval, imemo_env));
|
|
1520
1615
|
return envval;
|
|
1521
1616
|
}
|
|
1522
1617
|
|
|
@@ -1819,7 +1914,7 @@ NORETURN(void rb_bug_for_fatal_signal(ruby_sighandler_t default_sighandler, int
|
|
|
1819
1914
|
|
|
1820
1915
|
/* functions about thread/vm execution */
|
|
1821
1916
|
RUBY_SYMBOL_EXPORT_BEGIN
|
|
1822
|
-
VALUE rb_iseq_eval(const rb_iseq_t *iseq);
|
|
1917
|
+
VALUE rb_iseq_eval(const rb_iseq_t *iseq, const rb_box_t *box);
|
|
1823
1918
|
VALUE rb_iseq_eval_main(const rb_iseq_t *iseq);
|
|
1824
1919
|
VALUE rb_iseq_path(const rb_iseq_t *iseq);
|
|
1825
1920
|
VALUE rb_iseq_realpath(const rb_iseq_t *iseq);
|
|
@@ -1848,6 +1943,7 @@ rb_vm_make_lambda(const rb_execution_context_t *ec, const struct rb_captured_blo
|
|
|
1848
1943
|
|
|
1849
1944
|
VALUE rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *src_cfp);
|
|
1850
1945
|
VALUE rb_vm_env_local_variables(const rb_env_t *env);
|
|
1946
|
+
VALUE rb_vm_env_numbered_parameters(const rb_env_t *env);
|
|
1851
1947
|
const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env);
|
|
1852
1948
|
const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars);
|
|
1853
1949
|
void rb_vm_inc_const_missing_count(void);
|
|
@@ -1864,10 +1960,11 @@ void rb_thread_wakeup_timer_thread(int);
|
|
|
1864
1960
|
static inline void
|
|
1865
1961
|
rb_vm_living_threads_init(rb_vm_t *vm)
|
|
1866
1962
|
{
|
|
1867
|
-
ccan_list_head_init(&vm->waiting_fds);
|
|
1868
1963
|
ccan_list_head_init(&vm->workqueue);
|
|
1869
1964
|
ccan_list_head_init(&vm->ractor.set);
|
|
1965
|
+
#ifdef RUBY_THREAD_PTHREAD_H
|
|
1870
1966
|
ccan_list_head_init(&vm->ractor.sched.zombie_threads);
|
|
1967
|
+
#endif
|
|
1871
1968
|
}
|
|
1872
1969
|
|
|
1873
1970
|
typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
|
|
@@ -1877,6 +1974,7 @@ VALUE *rb_vm_svar_lep(const rb_execution_context_t *ec, const rb_control_frame_t
|
|
|
1877
1974
|
int rb_vm_get_sourceline(const rb_control_frame_t *);
|
|
1878
1975
|
void rb_vm_stack_to_heap(rb_execution_context_t *ec);
|
|
1879
1976
|
void ruby_thread_init_stack(rb_thread_t *th, void *local_in_parent_frame);
|
|
1977
|
+
void rb_thread_malloc_stack_set(rb_thread_t *th, void *stack);
|
|
1880
1978
|
rb_thread_t * ruby_thread_from_native(void);
|
|
1881
1979
|
int ruby_thread_set_native(rb_thread_t *th);
|
|
1882
1980
|
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
|
|
@@ -1891,9 +1989,10 @@ void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE
|
|
|
1891
1989
|
|
|
1892
1990
|
void rb_gc_mark_machine_context(const rb_execution_context_t *ec);
|
|
1893
1991
|
|
|
1894
|
-
|
|
1992
|
+
rb_cref_t *rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass);
|
|
1895
1993
|
|
|
1896
1994
|
const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
|
|
1995
|
+
const rb_callable_method_entry_t *rb_vm_frame_method_entry_unchecked(const rb_control_frame_t *cfp);
|
|
1897
1996
|
|
|
1898
1997
|
#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
|
|
1899
1998
|
|
|
@@ -1959,14 +2058,16 @@ rb_ec_vm_ptr(const rb_execution_context_t *ec)
|
|
|
1959
2058
|
}
|
|
1960
2059
|
}
|
|
1961
2060
|
|
|
2061
|
+
NOINLINE(struct rb_execution_context_struct *rb_current_ec_noinline(void));
|
|
2062
|
+
|
|
1962
2063
|
static inline rb_execution_context_t *
|
|
1963
2064
|
rb_current_execution_context(bool expect_ec)
|
|
1964
2065
|
{
|
|
1965
2066
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
|
1966
|
-
#ifdef
|
|
1967
|
-
rb_execution_context_t *ec = rb_current_ec();
|
|
2067
|
+
#ifdef RB_THREAD_CURRENT_EC_NOINLINE
|
|
2068
|
+
rb_execution_context_t * volatile ec = rb_current_ec();
|
|
1968
2069
|
#else
|
|
1969
|
-
rb_execution_context_t *ec = ruby_current_ec;
|
|
2070
|
+
rb_execution_context_t * volatile ec = ruby_current_ec;
|
|
1970
2071
|
#endif
|
|
1971
2072
|
|
|
1972
2073
|
/* On the shared objects, `__tls_get_addr()` is used to access the TLS
|
|
@@ -1983,7 +2084,7 @@ rb_current_execution_context(bool expect_ec)
|
|
|
1983
2084
|
*/
|
|
1984
2085
|
VM_ASSERT(ec == rb_current_ec_noinline());
|
|
1985
2086
|
#else
|
|
1986
|
-
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
|
|
2087
|
+
rb_execution_context_t * volatile ec = native_tls_get(ruby_current_ec_key);
|
|
1987
2088
|
#endif
|
|
1988
2089
|
VM_ASSERT(!expect_ec || ec != NULL);
|
|
1989
2090
|
return ec;
|
|
@@ -2032,12 +2133,21 @@ void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec,
|
|
|
2032
2133
|
unsigned int recorded_lock_rec,
|
|
2033
2134
|
unsigned int current_lock_rec);
|
|
2034
2135
|
|
|
2136
|
+
/* This technically is a data race, as it's checked without the lock, however we
|
|
2137
|
+
* check against a value only our own thread will write. */
|
|
2138
|
+
NO_SANITIZE("thread", static inline bool
|
|
2139
|
+
vm_locked_by_ractor_p(rb_vm_t *vm, rb_ractor_t *cr))
|
|
2140
|
+
{
|
|
2141
|
+
VM_ASSERT(cr == GET_RACTOR());
|
|
2142
|
+
return vm->ractor.sync.lock_owner == cr;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2035
2145
|
static inline unsigned int
|
|
2036
2146
|
rb_ec_vm_lock_rec(const rb_execution_context_t *ec)
|
|
2037
2147
|
{
|
|
2038
2148
|
rb_vm_t *vm = rb_ec_vm_ptr(ec);
|
|
2039
2149
|
|
|
2040
|
-
if (vm
|
|
2150
|
+
if (!vm_locked_by_ractor_p(vm, rb_ec_ractor_ptr(ec))) {
|
|
2041
2151
|
return 0;
|
|
2042
2152
|
}
|
|
2043
2153
|
else {
|
|
@@ -2064,8 +2174,12 @@ enum {
|
|
|
2064
2174
|
#define RUBY_VM_SET_TRAP_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TRAP_INTERRUPT_MASK)
|
|
2065
2175
|
#define RUBY_VM_SET_TERMINATE_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, TERMINATE_INTERRUPT_MASK)
|
|
2066
2176
|
#define RUBY_VM_SET_VM_BARRIER_INTERRUPT(ec) ATOMIC_OR((ec)->interrupt_flag, VM_BARRIER_INTERRUPT_MASK)
|
|
2067
|
-
|
|
2068
|
-
|
|
2177
|
+
|
|
2178
|
+
static inline bool
|
|
2179
|
+
RUBY_VM_INTERRUPTED(rb_execution_context_t *ec)
|
|
2180
|
+
{
|
|
2181
|
+
return (ATOMIC_LOAD_RELAXED(ec->interrupt_flag) & ~(ec->interrupt_mask) & (PENDING_INTERRUPT_MASK|TRAP_INTERRUPT_MASK));
|
|
2182
|
+
}
|
|
2069
2183
|
|
|
2070
2184
|
static inline bool
|
|
2071
2185
|
RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec)
|
|
@@ -2078,7 +2192,7 @@ RUBY_VM_INTERRUPTED_ANY(rb_execution_context_t *ec)
|
|
|
2078
2192
|
RUBY_VM_SET_TIMER_INTERRUPT(ec);
|
|
2079
2193
|
}
|
|
2080
2194
|
#endif
|
|
2081
|
-
return ec->interrupt_flag & ~(ec)->interrupt_mask;
|
|
2195
|
+
return ATOMIC_LOAD_RELAXED(ec->interrupt_flag) & ~(ec)->interrupt_mask;
|
|
2082
2196
|
}
|
|
2083
2197
|
|
|
2084
2198
|
VALUE rb_exc_set_backtrace(VALUE exc, VALUE bt);
|
|
@@ -2112,7 +2226,7 @@ rb_vm_check_ints(rb_execution_context_t *ec)
|
|
|
2112
2226
|
VM_ASSERT(ruby_assert_critical_section_entered == 0);
|
|
2113
2227
|
#endif
|
|
2114
2228
|
|
|
2115
|
-
VM_ASSERT(ec ==
|
|
2229
|
+
VM_ASSERT(ec == rb_current_ec_noinline());
|
|
2116
2230
|
|
|
2117
2231
|
if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(ec))) {
|
|
2118
2232
|
rb_threadptr_execute_interrupts(rb_ec_thread_ptr(ec), 0);
|
|
@@ -2139,7 +2253,7 @@ struct rb_trace_arg_struct {
|
|
|
2139
2253
|
};
|
|
2140
2254
|
|
|
2141
2255
|
void rb_hook_list_mark(rb_hook_list_t *hooks);
|
|
2142
|
-
void
|
|
2256
|
+
void rb_hook_list_mark_and_move(rb_hook_list_t *hooks);
|
|
2143
2257
|
void rb_hook_list_free(rb_hook_list_t *hooks);
|
|
2144
2258
|
void rb_hook_list_connect_tracepoint(VALUE target, rb_hook_list_t *list, VALUE tpval, unsigned int target_line);
|
|
2145
2259
|
void rb_hook_list_remove_tracepoint(rb_hook_list_t *list, VALUE tpval);
|