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
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
#ifndef INTERNAL_CLASS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
-
#define INTERNAL_CLASS_H
|
|
3
|
-
/**
|
|
4
|
-
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
-
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
-
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
-
* modify this file, provided that the conditions mentioned in the
|
|
8
|
-
* file COPYING are met. Consult the file for details.
|
|
9
|
-
* @brief Internal header for Class.
|
|
10
|
-
*/
|
|
11
|
-
#include "id.h"
|
|
12
|
-
#include "id_table.h" /* for struct rb_id_table */
|
|
13
|
-
#include "internal/serial.h" /* for rb_serial_t */
|
|
14
|
-
#include "internal/static_assert.h"
|
|
15
|
-
#include "internal/variable.h" /* for rb_class_ivar_set */
|
|
16
|
-
#include "ruby/internal/stdbool.h" /* for bool */
|
|
17
|
-
#include "ruby/intern.h" /* for rb_alloc_func_t */
|
|
18
|
-
#include "ruby/ruby.h" /* for struct RBasic */
|
|
19
|
-
#include "shape.h"
|
|
20
|
-
#include "ruby_assert.h"
|
|
21
|
-
#include "vm_core.h"
|
|
22
|
-
#include "vm_sync.h"
|
|
23
|
-
#include "method.h" /* for rb_cref_t */
|
|
24
|
-
|
|
25
|
-
#ifdef RCLASS_SUPER
|
|
26
|
-
# undef RCLASS_SUPER
|
|
27
|
-
#endif
|
|
28
|
-
|
|
29
|
-
struct rb_subclass_entry {
|
|
30
|
-
VALUE klass;
|
|
31
|
-
struct rb_subclass_entry *next;
|
|
32
|
-
struct rb_subclass_entry *prev;
|
|
33
|
-
};
|
|
34
|
-
typedef struct rb_subclass_entry rb_subclass_entry_t;
|
|
35
|
-
|
|
36
|
-
struct rb_cvar_class_tbl_entry {
|
|
37
|
-
uint32_t index;
|
|
38
|
-
rb_serial_t global_cvar_state;
|
|
39
|
-
const rb_cref_t * cref;
|
|
40
|
-
VALUE class_value;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
struct rb_classext_struct {
|
|
44
|
-
VALUE *iv_ptr;
|
|
45
|
-
struct rb_id_table *const_tbl;
|
|
46
|
-
struct rb_id_table *callable_m_tbl;
|
|
47
|
-
struct rb_id_table *cc_tbl; /* ID -> [[ci1, cc1], [ci2, cc2] ...] */
|
|
48
|
-
struct rb_id_table *cvc_tbl;
|
|
49
|
-
size_t superclass_depth;
|
|
50
|
-
VALUE *superclasses;
|
|
51
|
-
struct rb_subclass_entry *subclasses;
|
|
52
|
-
struct rb_subclass_entry *subclass_entry;
|
|
53
|
-
/**
|
|
54
|
-
* In the case that this is an `ICLASS`, `module_subclasses` points to the link
|
|
55
|
-
* in the module's `subclasses` list that indicates that the klass has been
|
|
56
|
-
* included. Hopefully that makes sense.
|
|
57
|
-
*/
|
|
58
|
-
struct rb_subclass_entry *module_subclass_entry;
|
|
59
|
-
const VALUE origin_;
|
|
60
|
-
const VALUE refined_class;
|
|
61
|
-
union {
|
|
62
|
-
struct {
|
|
63
|
-
rb_alloc_func_t allocator;
|
|
64
|
-
} class;
|
|
65
|
-
struct {
|
|
66
|
-
VALUE attached_object;
|
|
67
|
-
} singleton_class;
|
|
68
|
-
} as;
|
|
69
|
-
const VALUE includer;
|
|
70
|
-
attr_index_t max_iv_count;
|
|
71
|
-
unsigned char variation_count;
|
|
72
|
-
bool permanent_classpath : 1;
|
|
73
|
-
bool cloned : 1;
|
|
74
|
-
VALUE classpath;
|
|
75
|
-
};
|
|
76
|
-
typedef struct rb_classext_struct rb_classext_t;
|
|
77
|
-
|
|
78
|
-
STATIC_ASSERT(shape_max_variations, SHAPE_MAX_VARIATIONS < (1 << (sizeof(((rb_classext_t *)0)->variation_count) * CHAR_BIT)));
|
|
79
|
-
|
|
80
|
-
struct RClass {
|
|
81
|
-
struct RBasic basic;
|
|
82
|
-
VALUE super;
|
|
83
|
-
struct rb_id_table *m_tbl;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// Assert that classes can be embedded in size_pools[2] (which has 160B slot size)
|
|
87
|
-
STATIC_ASSERT(sizeof_rb_classext_t, sizeof(struct RClass) + sizeof(rb_classext_t) <= 4 * RVALUE_SIZE);
|
|
88
|
-
|
|
89
|
-
struct RClass_and_rb_classext_t {
|
|
90
|
-
struct RClass rclass;
|
|
91
|
-
rb_classext_t classext;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
#define RCLASS_EXT(c) (&((struct RClass_and_rb_classext_t*)(c))->classext)
|
|
95
|
-
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
|
|
96
|
-
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
|
|
97
|
-
#define RCLASS_IVPTR(c) (RCLASS_EXT(c)->iv_ptr)
|
|
98
|
-
#define RCLASS_CALLABLE_M_TBL(c) (RCLASS_EXT(c)->callable_m_tbl)
|
|
99
|
-
#define RCLASS_CC_TBL(c) (RCLASS_EXT(c)->cc_tbl)
|
|
100
|
-
#define RCLASS_CVC_TBL(c) (RCLASS_EXT(c)->cvc_tbl)
|
|
101
|
-
#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin_)
|
|
102
|
-
#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
|
|
103
|
-
#define RCLASS_INCLUDER(c) (RCLASS_EXT(c)->includer)
|
|
104
|
-
#define RCLASS_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->subclass_entry)
|
|
105
|
-
#define RCLASS_MODULE_SUBCLASS_ENTRY(c) (RCLASS_EXT(c)->module_subclass_entry)
|
|
106
|
-
#define RCLASS_SUBCLASSES(c) (RCLASS_EXT(c)->subclasses)
|
|
107
|
-
#define RCLASS_SUPERCLASS_DEPTH(c) (RCLASS_EXT(c)->superclass_depth)
|
|
108
|
-
#define RCLASS_SUPERCLASSES(c) (RCLASS_EXT(c)->superclasses)
|
|
109
|
-
#define RCLASS_ATTACHED_OBJECT(c) (RCLASS_EXT(c)->as.singleton_class.attached_object)
|
|
110
|
-
|
|
111
|
-
#define RCLASS_IS_ROOT FL_USER0
|
|
112
|
-
#define RICLASS_IS_ORIGIN FL_USER0
|
|
113
|
-
#define RCLASS_SUPERCLASSES_INCLUDE_SELF FL_USER2
|
|
114
|
-
#define RICLASS_ORIGIN_SHARED_MTBL FL_USER3
|
|
115
|
-
|
|
116
|
-
static inline st_table *
|
|
117
|
-
RCLASS_IV_HASH(VALUE obj)
|
|
118
|
-
{
|
|
119
|
-
RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
|
|
120
|
-
RUBY_ASSERT(rb_shape_obj_too_complex(obj));
|
|
121
|
-
return (st_table *)RCLASS_IVPTR(obj);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
static inline void
|
|
125
|
-
RCLASS_SET_IV_HASH(VALUE obj, const st_table *tbl)
|
|
126
|
-
{
|
|
127
|
-
RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
|
|
128
|
-
RUBY_ASSERT(rb_shape_obj_too_complex(obj));
|
|
129
|
-
RCLASS_IVPTR(obj) = (VALUE *)tbl;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
static inline uint32_t
|
|
133
|
-
RCLASS_IV_COUNT(VALUE obj)
|
|
134
|
-
{
|
|
135
|
-
RUBY_ASSERT(RB_TYPE_P(obj, RUBY_T_CLASS) || RB_TYPE_P(obj, RUBY_T_MODULE));
|
|
136
|
-
if (rb_shape_obj_too_complex(obj)) {
|
|
137
|
-
uint32_t count;
|
|
138
|
-
|
|
139
|
-
// "Too complex" classes could have their IV hash mutated in
|
|
140
|
-
// parallel, so lets lock around getting the hash size.
|
|
141
|
-
RB_VM_LOCK_ENTER();
|
|
142
|
-
{
|
|
143
|
-
count = (uint32_t)rb_st_table_size(RCLASS_IV_HASH(obj));
|
|
144
|
-
}
|
|
145
|
-
RB_VM_LOCK_LEAVE();
|
|
146
|
-
|
|
147
|
-
return count;
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
return rb_shape_get_shape_by_id(RCLASS_SHAPE_ID(obj))->next_iv_index;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
static inline void
|
|
155
|
-
RCLASS_SET_M_TBL(VALUE klass, struct rb_id_table *table)
|
|
156
|
-
{
|
|
157
|
-
RUBY_ASSERT(!RB_OBJ_PROMOTED(klass));
|
|
158
|
-
RCLASS_M_TBL(klass) = table;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/* class.c */
|
|
162
|
-
void rb_class_subclass_add(VALUE super, VALUE klass);
|
|
163
|
-
void rb_class_remove_from_super_subclasses(VALUE);
|
|
164
|
-
void rb_class_update_superclasses(VALUE);
|
|
165
|
-
size_t rb_class_superclasses_memsize(VALUE);
|
|
166
|
-
void rb_class_remove_subclass_head(VALUE);
|
|
167
|
-
int rb_singleton_class_internal_p(VALUE sklass);
|
|
168
|
-
VALUE rb_class_boot(VALUE);
|
|
169
|
-
VALUE rb_class_s_alloc(VALUE klass);
|
|
170
|
-
VALUE rb_module_s_alloc(VALUE klass);
|
|
171
|
-
void rb_module_set_initialized(VALUE module);
|
|
172
|
-
void rb_module_check_initializable(VALUE module);
|
|
173
|
-
VALUE rb_make_metaclass(VALUE, VALUE);
|
|
174
|
-
VALUE rb_include_class_new(VALUE, VALUE);
|
|
175
|
-
void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
|
|
176
|
-
void rb_class_detach_subclasses(VALUE);
|
|
177
|
-
void rb_class_detach_module_subclasses(VALUE);
|
|
178
|
-
void rb_class_remove_from_module_subclasses(VALUE);
|
|
179
|
-
VALUE rb_define_class_id_under_no_pin(VALUE outer, ID id, VALUE super);
|
|
180
|
-
VALUE rb_obj_methods(int argc, const VALUE *argv, VALUE obj);
|
|
181
|
-
VALUE rb_obj_protected_methods(int argc, const VALUE *argv, VALUE obj);
|
|
182
|
-
VALUE rb_obj_private_methods(int argc, const VALUE *argv, VALUE obj);
|
|
183
|
-
VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
|
|
184
|
-
VALUE rb_class_undefined_instance_methods(VALUE mod);
|
|
185
|
-
VALUE rb_special_singleton_class(VALUE);
|
|
186
|
-
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
|
|
187
|
-
VALUE rb_singleton_class_get(VALUE obj);
|
|
188
|
-
void rb_undef_methods_from(VALUE klass, VALUE super);
|
|
189
|
-
|
|
190
|
-
static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
|
|
191
|
-
static inline void RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass);
|
|
192
|
-
static inline VALUE RCLASS_SUPER(VALUE klass);
|
|
193
|
-
static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
|
|
194
|
-
static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
|
|
195
|
-
|
|
196
|
-
VALUE rb_class_inherited(VALUE, VALUE);
|
|
197
|
-
VALUE rb_keyword_error_new(const char *, VALUE);
|
|
198
|
-
|
|
199
|
-
static inline bool
|
|
200
|
-
RCLASS_SINGLETON_P(VALUE klass)
|
|
201
|
-
{
|
|
202
|
-
return RB_TYPE_P(klass, T_CLASS) && FL_TEST_RAW(klass, FL_SINGLETON);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
static inline rb_alloc_func_t
|
|
206
|
-
RCLASS_ALLOCATOR(VALUE klass)
|
|
207
|
-
{
|
|
208
|
-
if (RCLASS_SINGLETON_P(klass)) {
|
|
209
|
-
return 0;
|
|
210
|
-
}
|
|
211
|
-
return RCLASS_EXT(klass)->as.class.allocator;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
static inline void
|
|
215
|
-
RCLASS_SET_ALLOCATOR(VALUE klass, rb_alloc_func_t allocator)
|
|
216
|
-
{
|
|
217
|
-
assert(!RCLASS_SINGLETON_P(klass));
|
|
218
|
-
RCLASS_EXT(klass)->as.class.allocator = allocator;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
static inline void
|
|
222
|
-
RCLASS_SET_ORIGIN(VALUE klass, VALUE origin)
|
|
223
|
-
{
|
|
224
|
-
RB_OBJ_WRITE(klass, &RCLASS_ORIGIN(klass), origin);
|
|
225
|
-
if (klass != origin) FL_SET(origin, RICLASS_IS_ORIGIN);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
static inline void
|
|
229
|
-
RICLASS_SET_ORIGIN_SHARED_MTBL(VALUE iclass)
|
|
230
|
-
{
|
|
231
|
-
FL_SET(iclass, RICLASS_ORIGIN_SHARED_MTBL);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
static inline bool
|
|
235
|
-
RICLASS_OWNS_M_TBL_P(VALUE iclass)
|
|
236
|
-
{
|
|
237
|
-
return FL_TEST_RAW(iclass, RICLASS_IS_ORIGIN | RICLASS_ORIGIN_SHARED_MTBL) == RICLASS_IS_ORIGIN;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
static inline void
|
|
241
|
-
RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass)
|
|
242
|
-
{
|
|
243
|
-
RB_OBJ_WRITE(iclass, &RCLASS_INCLUDER(iclass), klass);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
static inline VALUE
|
|
247
|
-
RCLASS_SUPER(VALUE klass)
|
|
248
|
-
{
|
|
249
|
-
return RCLASS(klass)->super;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
static inline VALUE
|
|
253
|
-
RCLASS_SET_SUPER(VALUE klass, VALUE super)
|
|
254
|
-
{
|
|
255
|
-
if (super) {
|
|
256
|
-
rb_class_remove_from_super_subclasses(klass);
|
|
257
|
-
rb_class_subclass_add(super, klass);
|
|
258
|
-
}
|
|
259
|
-
RB_OBJ_WRITE(klass, &RCLASS(klass)->super, super);
|
|
260
|
-
rb_class_update_superclasses(klass);
|
|
261
|
-
return super;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
static inline void
|
|
265
|
-
RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent)
|
|
266
|
-
{
|
|
267
|
-
assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE);
|
|
268
|
-
assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING);
|
|
269
|
-
|
|
270
|
-
RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath);
|
|
271
|
-
RCLASS_EXT(klass)->permanent_classpath = permanent;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
static inline VALUE
|
|
275
|
-
RCLASS_SET_ATTACHED_OBJECT(VALUE klass, VALUE attached_object)
|
|
276
|
-
{
|
|
277
|
-
assert(RCLASS_SINGLETON_P(klass));
|
|
278
|
-
|
|
279
|
-
RB_OBJ_WRITE(klass, &RCLASS_EXT(klass)->as.singleton_class.attached_object, attached_object);
|
|
280
|
-
return attached_object;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
#endif /* INTERNAL_CLASS_H */
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file regexp.h
|
|
3
|
-
*
|
|
4
|
-
* A regular expression parser.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef PRISM_REGEXP_H
|
|
7
|
-
#define PRISM_REGEXP_H
|
|
8
|
-
|
|
9
|
-
#include "prism/defines.h"
|
|
10
|
-
#include "prism/parser.h"
|
|
11
|
-
#include "prism/encoding.h"
|
|
12
|
-
#include "prism/util/pm_memchr.h"
|
|
13
|
-
#include "prism/util/pm_string_list.h"
|
|
14
|
-
#include "prism/util/pm_string.h"
|
|
15
|
-
|
|
16
|
-
#include <stdbool.h>
|
|
17
|
-
#include <stddef.h>
|
|
18
|
-
#include <string.h>
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Parse a regular expression and extract the names of all of the named capture
|
|
22
|
-
* groups.
|
|
23
|
-
*
|
|
24
|
-
* @param source The source code to parse.
|
|
25
|
-
* @param size The size of the source code.
|
|
26
|
-
* @param named_captures The list to add the names of the named capture groups.
|
|
27
|
-
* @param encoding_changed Whether or not the encoding changed from the default.
|
|
28
|
-
* @param encoding The encoding of the source code.
|
|
29
|
-
* @return Whether or not the parsing was successful.
|
|
30
|
-
*/
|
|
31
|
-
PRISM_EXPORTED_FUNCTION bool pm_regexp_named_capture_group_names(const uint8_t *source, size_t size, pm_string_list_t *named_captures, bool encoding_changed, const pm_encoding_t *encoding);
|
|
32
|
-
|
|
33
|
-
#endif
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file pm_string_list.h
|
|
3
|
-
*
|
|
4
|
-
* A list of strings.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef PRISM_STRING_LIST_H
|
|
7
|
-
#define PRISM_STRING_LIST_H
|
|
8
|
-
|
|
9
|
-
#include "prism/defines.h"
|
|
10
|
-
#include "prism/util/pm_string.h"
|
|
11
|
-
|
|
12
|
-
#include <stddef.h>
|
|
13
|
-
#include <stdlib.h>
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A list of strings.
|
|
17
|
-
*/
|
|
18
|
-
typedef struct {
|
|
19
|
-
/** The length of the string list. */
|
|
20
|
-
size_t length;
|
|
21
|
-
|
|
22
|
-
/** The capacity of the string list that has been allocated. */
|
|
23
|
-
size_t capacity;
|
|
24
|
-
|
|
25
|
-
/** A pointer to the start of the string list. */
|
|
26
|
-
pm_string_t *strings;
|
|
27
|
-
} pm_string_list_t;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Append a pm_string_t to the given string list.
|
|
31
|
-
*
|
|
32
|
-
* @param string_list The string list to append to.
|
|
33
|
-
* @param string The string to append.
|
|
34
|
-
*/
|
|
35
|
-
void pm_string_list_append(pm_string_list_t *string_list, pm_string_t *string);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Free the memory associated with the string list.
|
|
39
|
-
*
|
|
40
|
-
* @param string_list The string list to free.
|
|
41
|
-
*/
|
|
42
|
-
PRISM_EXPORTED_FUNCTION void pm_string_list_free(pm_string_list_t *string_list);
|
|
43
|
-
|
|
44
|
-
#endif
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
#ifndef RUBY_SHAPE_H
|
|
2
|
-
#define RUBY_SHAPE_H
|
|
3
|
-
|
|
4
|
-
#include "internal/gc.h"
|
|
5
|
-
|
|
6
|
-
#if (SIZEOF_UINT64_T <= SIZEOF_VALUE)
|
|
7
|
-
|
|
8
|
-
#define SIZEOF_SHAPE_T 4
|
|
9
|
-
#define SHAPE_IN_BASIC_FLAGS 1
|
|
10
|
-
typedef uint32_t attr_index_t;
|
|
11
|
-
typedef uint32_t shape_id_t;
|
|
12
|
-
# define SHAPE_ID_NUM_BITS 32
|
|
13
|
-
|
|
14
|
-
#else
|
|
15
|
-
|
|
16
|
-
#define SIZEOF_SHAPE_T 2
|
|
17
|
-
#define SHAPE_IN_BASIC_FLAGS 0
|
|
18
|
-
typedef uint16_t attr_index_t;
|
|
19
|
-
typedef uint16_t shape_id_t;
|
|
20
|
-
# define SHAPE_ID_NUM_BITS 16
|
|
21
|
-
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
|
-
typedef uint32_t redblack_id_t;
|
|
25
|
-
|
|
26
|
-
#define MAX_IVARS (attr_index_t)(-1)
|
|
27
|
-
|
|
28
|
-
# define SHAPE_MASK (((uintptr_t)1 << SHAPE_ID_NUM_BITS) - 1)
|
|
29
|
-
# define SHAPE_FLAG_MASK (((VALUE)-1) >> SHAPE_ID_NUM_BITS)
|
|
30
|
-
|
|
31
|
-
# define SHAPE_FLAG_SHIFT ((SIZEOF_VALUE * 8) - SHAPE_ID_NUM_BITS)
|
|
32
|
-
|
|
33
|
-
# define SHAPE_MAX_VARIATIONS 8
|
|
34
|
-
|
|
35
|
-
# define INVALID_SHAPE_ID SHAPE_MASK
|
|
36
|
-
# define ROOT_SHAPE_ID 0x0
|
|
37
|
-
|
|
38
|
-
# define SPECIAL_CONST_SHAPE_ID (ROOT_SHAPE_ID + 1)
|
|
39
|
-
# define OBJ_TOO_COMPLEX_SHAPE_ID (SPECIAL_CONST_SHAPE_ID + 1)
|
|
40
|
-
# define FIRST_T_OBJECT_SHAPE_ID (OBJ_TOO_COMPLEX_SHAPE_ID + 1)
|
|
41
|
-
|
|
42
|
-
typedef struct redblack_node redblack_node_t;
|
|
43
|
-
|
|
44
|
-
struct rb_shape {
|
|
45
|
-
struct rb_id_table * edges; // id_table from ID (ivar) to next shape
|
|
46
|
-
ID edge_name; // ID (ivar) for transition from parent to rb_shape
|
|
47
|
-
attr_index_t next_iv_index;
|
|
48
|
-
uint32_t capacity; // Total capacity of the object with this shape
|
|
49
|
-
uint8_t type;
|
|
50
|
-
uint8_t size_pool_index;
|
|
51
|
-
shape_id_t parent_id;
|
|
52
|
-
redblack_node_t * ancestor_index;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
typedef struct rb_shape rb_shape_t;
|
|
56
|
-
|
|
57
|
-
struct redblack_node {
|
|
58
|
-
ID key;
|
|
59
|
-
rb_shape_t * value;
|
|
60
|
-
redblack_id_t l;
|
|
61
|
-
redblack_id_t r;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
enum shape_type {
|
|
65
|
-
SHAPE_ROOT,
|
|
66
|
-
SHAPE_IVAR,
|
|
67
|
-
SHAPE_FROZEN,
|
|
68
|
-
SHAPE_T_OBJECT,
|
|
69
|
-
SHAPE_OBJ_TOO_COMPLEX,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
typedef struct {
|
|
73
|
-
/* object shapes */
|
|
74
|
-
rb_shape_t *shape_list;
|
|
75
|
-
rb_shape_t *root_shape;
|
|
76
|
-
shape_id_t next_shape_id;
|
|
77
|
-
|
|
78
|
-
redblack_node_t *shape_cache;
|
|
79
|
-
unsigned int cache_size;
|
|
80
|
-
} rb_shape_tree_t;
|
|
81
|
-
RUBY_EXTERN rb_shape_tree_t *rb_shape_tree_ptr;
|
|
82
|
-
|
|
83
|
-
static inline rb_shape_tree_t *
|
|
84
|
-
rb_current_shape_tree(void)
|
|
85
|
-
{
|
|
86
|
-
return rb_shape_tree_ptr;
|
|
87
|
-
}
|
|
88
|
-
#define GET_SHAPE_TREE() rb_current_shape_tree()
|
|
89
|
-
|
|
90
|
-
static inline shape_id_t
|
|
91
|
-
get_shape_id_from_flags(VALUE obj)
|
|
92
|
-
{
|
|
93
|
-
RUBY_ASSERT(!RB_SPECIAL_CONST_P(obj));
|
|
94
|
-
return (shape_id_t)(SHAPE_MASK & ((RBASIC(obj)->flags) >> SHAPE_FLAG_SHIFT));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
static inline void
|
|
98
|
-
set_shape_id_in_flags(VALUE obj, shape_id_t shape_id)
|
|
99
|
-
{
|
|
100
|
-
// Ractors are occupying the upper 32 bits of flags, but only in debug mode
|
|
101
|
-
// Object shapes are occupying top bits
|
|
102
|
-
RBASIC(obj)->flags &= SHAPE_FLAG_MASK;
|
|
103
|
-
RBASIC(obj)->flags |= ((VALUE)(shape_id) << SHAPE_FLAG_SHIFT);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
#if SHAPE_IN_BASIC_FLAGS
|
|
108
|
-
static inline shape_id_t
|
|
109
|
-
RBASIC_SHAPE_ID(VALUE obj)
|
|
110
|
-
{
|
|
111
|
-
return get_shape_id_from_flags(obj);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
static inline void
|
|
115
|
-
RBASIC_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
|
|
116
|
-
{
|
|
117
|
-
set_shape_id_in_flags(obj, shape_id);
|
|
118
|
-
}
|
|
119
|
-
#endif
|
|
120
|
-
|
|
121
|
-
static inline shape_id_t
|
|
122
|
-
ROBJECT_SHAPE_ID(VALUE obj)
|
|
123
|
-
{
|
|
124
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
125
|
-
return get_shape_id_from_flags(obj);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
static inline void
|
|
129
|
-
ROBJECT_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
|
|
130
|
-
{
|
|
131
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
132
|
-
set_shape_id_in_flags(obj, shape_id);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
static inline shape_id_t
|
|
136
|
-
RCLASS_SHAPE_ID(VALUE obj)
|
|
137
|
-
{
|
|
138
|
-
RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE));
|
|
139
|
-
return get_shape_id_from_flags(obj);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
static inline void
|
|
143
|
-
RCLASS_SET_SHAPE_ID(VALUE obj, shape_id_t shape_id)
|
|
144
|
-
{
|
|
145
|
-
RUBY_ASSERT(RB_TYPE_P(obj, T_CLASS) || RB_TYPE_P(obj, T_MODULE));
|
|
146
|
-
set_shape_id_in_flags(obj, shape_id);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
rb_shape_t * rb_shape_get_root_shape(void);
|
|
150
|
-
int32_t rb_shape_id_offset(void);
|
|
151
|
-
|
|
152
|
-
rb_shape_t * rb_shape_get_parent(rb_shape_t * shape);
|
|
153
|
-
|
|
154
|
-
RUBY_FUNC_EXPORTED rb_shape_t *rb_shape_get_shape_by_id(shape_id_t shape_id);
|
|
155
|
-
RUBY_FUNC_EXPORTED shape_id_t rb_shape_get_shape_id(VALUE obj);
|
|
156
|
-
rb_shape_t * rb_shape_get_next_iv_shape(rb_shape_t * shape, ID id);
|
|
157
|
-
bool rb_shape_get_iv_index(rb_shape_t * shape, ID id, attr_index_t * value);
|
|
158
|
-
bool rb_shape_get_iv_index_with_hint(shape_id_t shape_id, ID id, attr_index_t * value, shape_id_t *shape_id_hint);
|
|
159
|
-
RUBY_FUNC_EXPORTED bool rb_shape_obj_too_complex(VALUE obj);
|
|
160
|
-
|
|
161
|
-
void rb_shape_set_shape(VALUE obj, rb_shape_t* shape);
|
|
162
|
-
rb_shape_t* rb_shape_get_shape(VALUE obj);
|
|
163
|
-
int rb_shape_frozen_shape_p(rb_shape_t* shape);
|
|
164
|
-
rb_shape_t* rb_shape_transition_shape_frozen(VALUE obj);
|
|
165
|
-
bool rb_shape_transition_shape_remove_ivar(VALUE obj, ID id, rb_shape_t *shape, VALUE * removed);
|
|
166
|
-
rb_shape_t* rb_shape_get_next(rb_shape_t* shape, VALUE obj, ID id);
|
|
167
|
-
|
|
168
|
-
rb_shape_t * rb_shape_rebuild_shape(rb_shape_t * initial_shape, rb_shape_t * dest_shape);
|
|
169
|
-
|
|
170
|
-
static inline uint32_t
|
|
171
|
-
ROBJECT_IV_CAPACITY(VALUE obj)
|
|
172
|
-
{
|
|
173
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
174
|
-
// Asking for capacity doesn't make sense when the object is using
|
|
175
|
-
// a hash table for storing instance variables
|
|
176
|
-
RUBY_ASSERT(!rb_shape_obj_too_complex(obj));
|
|
177
|
-
return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->capacity;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
static inline st_table *
|
|
181
|
-
ROBJECT_IV_HASH(VALUE obj)
|
|
182
|
-
{
|
|
183
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
184
|
-
RUBY_ASSERT(rb_shape_obj_too_complex(obj));
|
|
185
|
-
return (st_table *)ROBJECT(obj)->as.heap.ivptr;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
static inline void
|
|
189
|
-
ROBJECT_SET_IV_HASH(VALUE obj, const st_table *tbl)
|
|
190
|
-
{
|
|
191
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
192
|
-
RUBY_ASSERT(rb_shape_obj_too_complex(obj));
|
|
193
|
-
ROBJECT(obj)->as.heap.ivptr = (VALUE *)tbl;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
size_t rb_id_table_size(const struct rb_id_table *tbl);
|
|
197
|
-
|
|
198
|
-
static inline uint32_t
|
|
199
|
-
ROBJECT_IV_COUNT(VALUE obj)
|
|
200
|
-
{
|
|
201
|
-
if (rb_shape_obj_too_complex(obj)) {
|
|
202
|
-
return (uint32_t)rb_st_table_size(ROBJECT_IV_HASH(obj));
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
RBIMPL_ASSERT_TYPE(obj, RUBY_T_OBJECT);
|
|
206
|
-
RUBY_ASSERT(!rb_shape_obj_too_complex(obj));
|
|
207
|
-
return rb_shape_get_shape_by_id(ROBJECT_SHAPE_ID(obj))->next_iv_index;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
static inline uint32_t
|
|
212
|
-
RBASIC_IV_COUNT(VALUE obj)
|
|
213
|
-
{
|
|
214
|
-
return rb_shape_get_shape_by_id(rb_shape_get_shape_id(obj))->next_iv_index;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
rb_shape_t *rb_shape_traverse_from_new_root(rb_shape_t *initial_shape, rb_shape_t *orig_shape);
|
|
218
|
-
|
|
219
|
-
bool rb_shape_set_shape_id(VALUE obj, shape_id_t shape_id);
|
|
220
|
-
|
|
221
|
-
VALUE rb_obj_debug_shape(VALUE self, VALUE obj);
|
|
222
|
-
|
|
223
|
-
// For ext/objspace
|
|
224
|
-
RUBY_SYMBOL_EXPORT_BEGIN
|
|
225
|
-
typedef void each_shape_callback(rb_shape_t * shape, void *data);
|
|
226
|
-
void rb_shape_each_shape(each_shape_callback callback, void *data);
|
|
227
|
-
size_t rb_shape_memsize(rb_shape_t *shape);
|
|
228
|
-
size_t rb_shape_edges_count(rb_shape_t *shape);
|
|
229
|
-
size_t rb_shape_depth(rb_shape_t *shape);
|
|
230
|
-
shape_id_t rb_shape_id(rb_shape_t * shape);
|
|
231
|
-
RUBY_SYMBOL_EXPORT_END
|
|
232
|
-
|
|
233
|
-
#endif
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
#ifndef RUBY_RJIT_H
|
|
2
|
-
#define RUBY_RJIT_H 1
|
|
3
|
-
/**********************************************************************
|
|
4
|
-
|
|
5
|
-
rjit.h - Interface to RJIT
|
|
6
|
-
|
|
7
|
-
Copyright (C) 2023 Takashi Kokubun <k0kubun@ruby-lang.org>.
|
|
8
|
-
|
|
9
|
-
**********************************************************************/
|
|
10
|
-
|
|
11
|
-
#include "ruby/internal/config.h" // defines USE_RJIT
|
|
12
|
-
#include "ruby/internal/stdbool.h"
|
|
13
|
-
#include "vm_core.h"
|
|
14
|
-
|
|
15
|
-
# if USE_RJIT
|
|
16
|
-
|
|
17
|
-
#include "ruby.h"
|
|
18
|
-
#include "vm_core.h"
|
|
19
|
-
|
|
20
|
-
// RJIT options which can be defined on the MRI command line.
|
|
21
|
-
struct rb_rjit_options {
|
|
22
|
-
// Converted from "rjit" feature flag to tell the enablement
|
|
23
|
-
// information to ruby_show_version().
|
|
24
|
-
bool on;
|
|
25
|
-
// Size of executable memory block in MiB
|
|
26
|
-
unsigned int exec_mem_size;
|
|
27
|
-
// Number of calls to trigger JIT compilation
|
|
28
|
-
unsigned int call_threshold;
|
|
29
|
-
// Collect RJIT statistics
|
|
30
|
-
bool stats;
|
|
31
|
-
// Do not start RJIT until RJIT.enable is called
|
|
32
|
-
bool disable;
|
|
33
|
-
// Allow TracePoint during JIT compilation
|
|
34
|
-
bool trace;
|
|
35
|
-
// Trace side exit locations
|
|
36
|
-
bool trace_exits;
|
|
37
|
-
// Enable disasm of all JIT code
|
|
38
|
-
bool dump_disasm;
|
|
39
|
-
// Verify context objects
|
|
40
|
-
bool verify_ctx;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
RUBY_SYMBOL_EXPORT_BEGIN
|
|
44
|
-
RUBY_EXTERN struct rb_rjit_options rb_rjit_opts;
|
|
45
|
-
RUBY_EXTERN bool rb_rjit_call_p;
|
|
46
|
-
|
|
47
|
-
#define rb_rjit_call_threshold() rb_rjit_opts.call_threshold
|
|
48
|
-
|
|
49
|
-
extern void rb_rjit_compile(const rb_iseq_t *iseq);
|
|
50
|
-
RUBY_SYMBOL_EXPORT_END
|
|
51
|
-
|
|
52
|
-
extern void rb_rjit_cancel_all(const char *reason);
|
|
53
|
-
extern void rb_rjit_init(const struct rb_rjit_options *opts);
|
|
54
|
-
extern void rb_rjit_free_iseq(const rb_iseq_t *iseq);
|
|
55
|
-
extern void rb_rjit_iseq_update_references(struct rb_iseq_constant_body *const body);
|
|
56
|
-
extern void rb_rjit_mark(void);
|
|
57
|
-
extern void rb_rjit_iseq_mark(VALUE rjit_blocks);
|
|
58
|
-
extern void rjit_notify_waitpid(int exit_code);
|
|
59
|
-
|
|
60
|
-
extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
|
|
61
|
-
extern void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme);
|
|
62
|
-
extern void rb_rjit_before_ractor_spawn(void);
|
|
63
|
-
extern void rb_rjit_constant_state_changed(ID id);
|
|
64
|
-
extern void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx);
|
|
65
|
-
extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events);
|
|
66
|
-
|
|
67
|
-
extern void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop);
|
|
68
|
-
extern void rb_rjit_before_ractor_spawn(void);
|
|
69
|
-
extern void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events);
|
|
70
|
-
extern void rb_rjit_collect_vm_usage_insn(int insn);
|
|
71
|
-
|
|
72
|
-
extern bool rb_rjit_enabled;
|
|
73
|
-
extern bool rb_rjit_stats_enabled;
|
|
74
|
-
extern bool rb_rjit_trace_exits_enabled;
|
|
75
|
-
|
|
76
|
-
# else // USE_RJIT
|
|
77
|
-
|
|
78
|
-
static inline void rb_rjit_compile(const rb_iseq_t *iseq){}
|
|
79
|
-
|
|
80
|
-
static inline void rb_rjit_cancel_all(const char *reason){}
|
|
81
|
-
static inline void rb_rjit_free_iseq(const rb_iseq_t *iseq){}
|
|
82
|
-
static inline void rb_rjit_mark(void){}
|
|
83
|
-
|
|
84
|
-
static inline void rb_rjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {}
|
|
85
|
-
static inline void rb_rjit_cme_invalidate(rb_callable_method_entry_t *cme) {}
|
|
86
|
-
static inline void rb_rjit_before_ractor_spawn(void) {}
|
|
87
|
-
static inline void rb_rjit_constant_state_changed(ID id) {}
|
|
88
|
-
static inline void rb_rjit_constant_ic_update(const rb_iseq_t *const iseq, IC ic, unsigned insn_idx) {}
|
|
89
|
-
static inline void rb_rjit_tracing_invalidate_all(rb_event_flag_t new_iseq_events) {}
|
|
90
|
-
|
|
91
|
-
#define rb_rjit_enabled false
|
|
92
|
-
#define rb_rjit_call_p false
|
|
93
|
-
#define rb_rjit_stats_enabled false
|
|
94
|
-
#define rb_rjit_trace_exits_enabled false
|
|
95
|
-
|
|
96
|
-
#define rb_rjit_call_threshold() UINT_MAX
|
|
97
|
-
|
|
98
|
-
static inline void rb_rjit_collect_vm_usage_insn(int insn) {}
|
|
99
|
-
|
|
100
|
-
# endif // USE_RJIT
|
|
101
|
-
#endif // RUBY_RJIT_H
|